Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / plasma / applets / icon / icon.h
blobff898a55fa089d3031cf1f271283c029e44d7a0a
1 /***************************************************************************
2 * Copyright 2005,2006,2007 by Siraj Razick *
3 * siraj@kdemail.net *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
19 ***************************************************************************/
21 #ifndef ICON_APPLET_H
22 #define ICON_APPLET_H
24 #include <KMimeType>
25 #include <KUrl>
27 #include <plasma/applet.h>
29 class KPropertiesDialog;
30 class QGraphicsItem;
31 class QGraphicsSceneMouseEvent;
32 class QEvent;
34 namespace Plasma
36 class Icon;
39 class IconApplet : public Plasma::Applet
41 Q_OBJECT
42 public:
43 IconApplet(QObject *parent, const QVariantList &args);
44 ~IconApplet();
46 void init();
47 void setUrl(const KUrl& url);
48 void constraintsUpdated(Plasma::Constraints constraints);
49 void showConfigurationInterface();
50 void setDisplayLines(int displayLines);
51 int displayLines();
52 QSizeF sizeHint() const;
53 Qt::Orientations expandingDirections() const;
54 QPainterPath shape() const;
56 public slots:
57 void openUrl();
59 protected:
60 void dropEvent(QGraphicsSceneDragDropEvent *event);
61 void saveState(KConfigGroup *cg) const;
63 protected slots:
64 void acceptedPropertiesDialog();
65 void propertiesDialogClosed();
67 private:
68 //dropUrls from DolphinDropController
69 void dropUrls(const KUrl::List& urls,
70 const KUrl& destination,
71 Qt::KeyboardModifiers modifier);
73 Plasma::Icon* m_icon;
74 QString m_text;
75 QString m_genericName;
76 KPropertiesDialog *m_dialog;
77 KMimeType::Ptr m_mimetype;
78 KUrl m_url;
79 int m_displayLines;
82 K_EXPORT_PLASMA_APPLET(icon, IconApplet)
84 #endif