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

« back to all changes in this revision

Viewing changes to plasma/desktop/containments/desktop/desktop.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 Aaron Seigo <aseigo@kde.org>
 
3
*   Copyright 2008 by Alexis Ménard <darktears31@gmail.com>
 
4
*
 
5
*
 
6
*   This program is free software; you can redistribute it and/or modify
 
7
*   it under the terms of the GNU Library General Public License version 2,
 
8
*   or (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 Library General Public
 
16
*   License 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 PLASMA_DESKTOP_H
 
22
#define PLASMA_DESKTOP_H
 
23
 
 
24
#include <QGraphicsItem>
 
25
#include <QObject>
 
26
#include <QStyleOptionGraphicsItem>
 
27
 
 
28
 
 
29
#include <Plasma/Containment>
 
30
#include <Plasma/Animator>
 
31
 
 
32
#include "desktoplayout.h"
 
33
 
 
34
class QTimer;
 
35
 
 
36
namespace Plasma
 
37
{
 
38
}
 
39
 
 
40
/*class Tool : public QObject, public QGraphicsItem
 
41
{
 
42
    Q_OBJECT
 
43
 
 
44
public:
 
45
    explicit Tool(QGraphicsItem *parent = 0);
 
46
    QRectF boundingRect() const;
 
47
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
 
48
 
 
49
};*/
 
50
 
 
51
class DefaultDesktop : public Plasma::Containment
 
52
{
 
53
    Q_OBJECT
 
54
 
 
55
public:
 
56
    DefaultDesktop(QObject *parent, const QVariantList &args);
 
57
    ~DefaultDesktop();
 
58
    void constraintsEvent(Plasma::Constraints constraints);
 
59
 
 
60
protected:
 
61
    void dropEvent(QGraphicsSceneDragDropEvent *event);
 
62
    void keyPressEvent(QKeyEvent *event);
 
63
 
 
64
protected Q_SLOTS:
 
65
    void onAppletAdded(Plasma::Applet *, const QPointF &);
 
66
    void onAppletRemoved(Plasma::Applet *);
 
67
    void onAppletTransformedByUser();
 
68
    void onAppletTransformedItself();
 
69
    void refreshWorkingArea();
 
70
 
 
71
private:
 
72
    DesktopLayout *m_layout;
 
73
    QTimer *m_delayedRefreshTimer;
 
74
    int m_refreshFails;
 
75
    bool dropping;
 
76
    bool m_startupCompleted;
 
77
 
 
78
    static const int DELAYED_REFRESH_WAIT = 100;
 
79
    static const int MAX_REFRESH_FAILS = 20;
 
80
};
 
81
 
 
82
#endif // PLASMA_PANEL_H