~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/desktop/applets/trash/trash.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright 2007 by Marco Martin <notmart@gmail.com>                    *
 
3
 *                                                                         *
 
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
 ***************************************************************************/
 
20
 
 
21
#ifndef TRASH_H
 
22
#define TRASH_H
 
23
 
 
24
#include <QAction>
 
25
#include <KMenu>
 
26
#include <QGraphicsView>
 
27
#include <KFileItem>
 
28
#include <KDirLister>
 
29
 
 
30
#include <Plasma/Applet>
 
31
 
 
32
class QAction;
 
33
 
 
34
class KCModuleProxy;
 
35
class KFilePlacesModel;
 
36
class KProcess;
 
37
 
 
38
namespace Plasma
 
39
{
 
40
    class IconWidget;
 
41
}
 
42
 
 
43
class Trash : public Plasma::Applet
 
44
{
 
45
    Q_OBJECT
 
46
    public:
 
47
        Trash(QObject *parent, const QVariantList &args);
 
48
        virtual QList<QAction*> contextualActions();
 
49
        ~Trash();
 
50
 
 
51
        void init();
 
52
        void constraintsEvent(Plasma::Constraints constraints);
 
53
        
 
54
    public slots:
 
55
        void slotOpen();
 
56
        void slotEmpty();
 
57
 
 
58
    protected:
 
59
        void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
 
60
        void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
 
61
        void dropEvent(QGraphicsSceneDragDropEvent *event);
 
62
        void createConfigurationInterface(KConfigDialog *parent);
 
63
        void createMenu();
 
64
        void updateIcon();
 
65
        QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
 
66
 
 
67
    protected slots:
 
68
        void popup();
 
69
        void slotClear();
 
70
        void slotCompleted();
 
71
        void slotDeleteItem(const KFileItem &);
 
72
        void slotApplyConfig();
 
73
        void emptyFinished(int exitCode, QProcess::ExitStatus exitStatus);
 
74
        
 
75
    private slots:
 
76
        void iconSizeChanged(int group);
 
77
 
 
78
    private:
 
79
        Plasma::IconWidget* m_icon;
 
80
        QList<QAction*> actions;
 
81
        KDirLister *m_dirLister;
 
82
        KMenu m_menu;
 
83
        QAction *emptyTrash;
 
84
        int m_count;
 
85
        bool m_showText;
 
86
        KFilePlacesModel *m_places;
 
87
        KCModuleProxy *m_proxy;
 
88
        KProcess *m_emptyProcess;
 
89
};
 
90
 
 
91
K_EXPORT_PLASMA_APPLET(trash, Trash)
 
92
 
 
93
#endif