add more spacing
[personal-kdebase.git] / workspace / plasma / applets / icon / icon.h
blob35d38471145f3d8d8b11d9caa3b276ab00235d0a
1 /***************************************************************************
2 * Copyright 2007 by Aaron Seigo <aseigo@kde.org *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
20 #ifndef ICON_APPLET_H
21 #define ICON_APPLET_H
23 #include <KMimeType>
24 #include <KUrl>
26 #include <Plasma/Applet>
28 class KPropertiesDialog;
29 class QGraphicsItem;
30 class QGraphicsSceneMouseEvent;
31 class QEvent;
33 namespace Plasma
35 class IconWidget;
38 class IconApplet : public Plasma::Applet
40 Q_OBJECT
41 public:
42 IconApplet(QObject *parent, const QVariantList &args);
43 ~IconApplet();
45 void init();
46 void setUrl(const KUrl& url);
47 void constraintsEvent(Plasma::Constraints constraints);
48 void setDisplayLines(int displayLines);
49 int displayLines();
50 QPainterPath shape() const;
52 public slots:
53 void openUrl();
55 protected:
56 void dropEvent(QGraphicsSceneDragDropEvent *event);
57 void saveState(KConfigGroup &cg) const;
58 void showConfigurationInterface();
60 private slots:
61 void acceptedPropertiesDialog();
62 void propertiesDialogClosed();
64 private:
65 //dropUrls from DolphinDropController
66 void dropUrls(const KUrl::List& urls,
67 const KUrl& destination,
68 Qt::KeyboardModifiers modifier);
70 Plasma::IconWidget* m_icon;
71 QString m_text;
72 QString m_genericName;
73 KPropertiesDialog *m_dialog;
74 KMimeType::Ptr m_mimetype;
75 KUrl m_url;
78 K_EXPORT_PLASMA_APPLET(icon, IconApplet)
80 #endif