~ubuntu-branches/ubuntu/saucy/plasma-mobile/saucy

« back to all changes in this revision

Viewing changes to components/mobilecomponents/appletcontainer.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-09-17 14:08:58 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20130917140858-wv7n3z6t95iy1fs9
Tags: 1:0.5-0ubuntu1
* New upstream release LP: #1227602
* Use epoch to sync with upstream version number
* Build-dep on libxcursor-dev
* Add kubuntu_no_contourd.diff to disable contourd from building,
  does not compile with 4.11 and not used by default
* Depend on renamed package ksplash-theme-active
* Add kubuntu_no_dirmodel.diff to prevert compile of dirmodel,
  included in kde-runtime 4.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright 2011 Marco Martin <notmart@gmail.com>
3
 
 
4
 
    This library is free software; you can redistribute it and/or
5
 
    modify it under the terms of the GNU Library General Public
6
 
    License as published by the Free Software Foundation; either
7
 
    version 2 of the License, or (at your option) any later version.
8
 
 
9
 
    This library 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 GNU
12
 
    Library General Public License for more details.
13
 
 
14
 
    You should have received a copy of the GNU Library General Public License
15
 
    along with this library; see the file COPYING.LIB.  If not, write to
16
 
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 
    Boston, MA 02110-1301, USA.
18
 
*/
19
 
 
20
 
#ifndef APPLETCONTAINER_H
21
 
#define APPLETCONTAINER_H
22
 
 
23
 
#include <QDeclarativeItem>
24
 
 
25
 
namespace Plasma {
26
 
    class Applet;
27
 
}
28
 
 
29
 
class AppletContainer : public QDeclarativeItem
30
 
{
31
 
    Q_OBJECT
32
 
    Q_PROPERTY(QGraphicsWidget *applet READ applet WRITE setApplet NOTIFY appletChanged)
33
 
 
34
 
    Q_PROPERTY(int minimumWidth READ minimumWidth NOTIFY minimumWidthChanged)
35
 
    Q_PROPERTY(int minimumHeight READ minimumHeight NOTIFY minimumHeightChanged)
36
 
 
37
 
    Q_PROPERTY(int preferredWidth READ preferredWidth NOTIFY preferredWidthChanged)
38
 
    Q_PROPERTY(int preferredHeight READ preferredHeight NOTIFY preferredHeightChanged)
39
 
 
40
 
    Q_PROPERTY(int maximumWidth READ maximumWidth NOTIFY maximumWidthChanged)
41
 
    Q_PROPERTY(int maximumHeight READ maximumHeight NOTIFY maximumHeightChanged)
42
 
 
43
 
    Q_PROPERTY(ItemStatus status READ status WRITE setStatus NOTIFY statusChanged)
44
 
    Q_ENUMS(ItemStatus)
45
 
 
46
 
public:
47
 
    enum ItemStatus {
48
 
        UnknownStatus = 0, /**< The status is unknown **/
49
 
        PassiveStatus = 1, /**< The Item is passive **/
50
 
        ActiveStatus = 2, /**< The Item is active **/
51
 
        NeedsAttentionStatus = 3, /**< The Item needs attention **/
52
 
        AcceptingInputStatus = 4 /**< The Item is accepting input **/
53
 
    };
54
 
 
55
 
    AppletContainer(QDeclarativeItem *parent = 0);
56
 
    ~AppletContainer();
57
 
 
58
 
    QGraphicsWidget *applet() const;
59
 
    void setApplet(QGraphicsWidget *applet);
60
 
 
61
 
    int minimumWidth() const;
62
 
    int minimumHeight() const;
63
 
 
64
 
    int preferredWidth() const;
65
 
    int preferredHeight() const;
66
 
 
67
 
    int maximumWidth() const;
68
 
    int maximumHeight() const;
69
 
 
70
 
    void setStatus(const ItemStatus status);
71
 
    ItemStatus status() const;
72
 
 
73
 
Q_SIGNALS:
74
 
    void appletChanged(QGraphicsWidget *applet);
75
 
 
76
 
    void minimumWidthChanged(int);
77
 
    void minimumHeightChanged(int);
78
 
 
79
 
    void preferredWidthChanged(int);
80
 
    void preferredHeightChanged(int);
81
 
 
82
 
    void maximumWidthChanged(int);
83
 
    void maximumHeightChanged(int);
84
 
 
85
 
    void statusChanged();
86
 
 
87
 
 
88
 
protected Q_SLOTS:
89
 
    void sizeHintChanged(Qt::SizeHint which);
90
 
    void afterWidthChanged();
91
 
    void afterHeightChanged();
92
 
 
93
 
private:
94
 
    QWeakPointer<Plasma::Applet>m_applet;
95
 
};
96
 
 
97
 
#endif