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

« back to all changes in this revision

Viewing changes to plasma/netbook/containments/common/linearappletoverlay.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 2009 Marco Martin <notmart@gmail.com>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Library General Public License as
 
6
 *   published by the Free Software Foundation; either version 2, 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 Library General Public
 
15
 *   License 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
 */
 
19
 
 
20
#ifndef LINEARAPPLETOVERLAY_H
 
21
#define LINEARAPPLETOVERLAY_H
 
22
 
 
23
 
 
24
#include <QGraphicsWidget>
 
25
 
 
26
namespace Plasma
 
27
{
 
28
    class Applet;
 
29
    class Containment;
 
30
}
 
31
 
 
32
class Panel;
 
33
class AppletMoveSpacer;
 
34
class QGraphicsLinearLayout;
 
35
class QTimer;
 
36
 
 
37
class LinearAppletOverlay : public QGraphicsWidget
 
38
{
 
39
    Q_OBJECT
 
40
 
 
41
    friend class AppletMoveSpacer;
 
42
 
 
43
public:
 
44
    explicit LinearAppletOverlay(Plasma::Containment *parent = 0, QGraphicsLinearLayout *layout = 0);
 
45
    ~LinearAppletOverlay();
 
46
 
 
47
    void showSpacer(const QPointF &pos);
 
48
 
 
49
protected Q_SLOTS:
 
50
    void appletDestroyed();
 
51
    void spacerRequestedDrop(QGraphicsSceneDragDropEvent *event);
 
52
 
 
53
protected:
 
54
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0);
 
55
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
 
56
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
 
57
    void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
 
58
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
 
59
    void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
 
60
    void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
 
61
    void dropEvent(QGraphicsSceneDragDropEvent *event);
 
62
 
 
63
Q_SIGNALS:
 
64
    void dropRequested(QGraphicsSceneDragDropEvent *event);
 
65
 
 
66
private:
 
67
    Plasma::Applet *m_applet;
 
68
    Plasma::Containment *m_containment;
 
69
    QGraphicsLinearLayout *m_layout;
 
70
    Panel *m_panel;
 
71
    AppletMoveSpacer *m_spacer;
 
72
    int m_spacerIndex;
 
73
    bool m_clickDrag;
 
74
    QPointF m_origin;
 
75
};
 
76
 
 
77
#endif