Applets
trash.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TRASH_H
00022 #define TRASH_H
00023
00024 #include <KUrl>
00025 #include <QAction>
00026 #include <KMenu>
00027 #include <QGraphicsView>
00028 #include <KFileItem>
00029 #include <KDirLister>
00030
00031 #include <plasma/applet.h>
00032
00033 class KPropertiesDialog;
00034 class KFilePlacesModel;
00035 class QAction;
00036
00037 namespace Plasma
00038 {
00039 class Icon;
00040 }
00041
00042 class Trash : public Plasma::Applet
00043 {
00044 Q_OBJECT
00045 public:
00046 Trash(QObject *parent, const QVariantList &args);
00047 virtual QList<QAction*> contextualActions();
00048 ~Trash();
00049
00050 void init();
00051 void constraintsEvent(Plasma::Constraints constraints);
00052
00053 public slots:
00054 void slotOpen();
00055 void slotEmpty();
00056
00057 protected:
00058 void dropEvent(QGraphicsSceneDragDropEvent *event);
00059 void createMenu();
00060 void setIcon();
00061
00062 protected slots:
00063 void popup();
00064 void slotClear();
00065 void slotCompleted();
00066 void slotDeleteItem(const KFileItem &);
00067
00068 private:
00069 Plasma::Icon* m_icon;
00070 QList<QAction*> actions;
00071 KPropertiesDialog *m_dialog;
00072 KDirLister *m_dirLister;
00073 KUrl m_trashUrl;
00074 KMenu m_menu;
00075 QAction *emptyTrash;
00076 int m_count;
00077 bool m_showText;
00078
00079
00080 KFilePlacesModel *m_places;
00081 };
00082
00083 K_EXPORT_PLASMA_APPLET(trash, Trash)
00084
00085 #endif