2
Copyright 2011 Marco Martin <notmart@gmail.com>
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.
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.
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.
20
#ifndef APPLETCONTAINER_H
21
#define APPLETCONTAINER_H
23
#include <QDeclarativeItem>
29
class AppletContainer : public QDeclarativeItem
32
Q_PROPERTY(QGraphicsWidget *applet READ applet WRITE setApplet NOTIFY appletChanged)
34
Q_PROPERTY(int minimumWidth READ minimumWidth NOTIFY minimumWidthChanged)
35
Q_PROPERTY(int minimumHeight READ minimumHeight NOTIFY minimumHeightChanged)
37
Q_PROPERTY(int preferredWidth READ preferredWidth NOTIFY preferredWidthChanged)
38
Q_PROPERTY(int preferredHeight READ preferredHeight NOTIFY preferredHeightChanged)
40
Q_PROPERTY(int maximumWidth READ maximumWidth NOTIFY maximumWidthChanged)
41
Q_PROPERTY(int maximumHeight READ maximumHeight NOTIFY maximumHeightChanged)
43
Q_PROPERTY(ItemStatus status READ status WRITE setStatus NOTIFY statusChanged)
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 **/
55
AppletContainer(QDeclarativeItem *parent = 0);
58
QGraphicsWidget *applet() const;
59
void setApplet(QGraphicsWidget *applet);
61
int minimumWidth() const;
62
int minimumHeight() const;
64
int preferredWidth() const;
65
int preferredHeight() const;
67
int maximumWidth() const;
68
int maximumHeight() const;
70
void setStatus(const ItemStatus status);
71
ItemStatus status() const;
74
void appletChanged(QGraphicsWidget *applet);
76
void minimumWidthChanged(int);
77
void minimumHeightChanged(int);
79
void preferredWidthChanged(int);
80
void preferredHeightChanged(int);
82
void maximumWidthChanged(int);
83
void maximumHeightChanged(int);
89
void sizeHintChanged(Qt::SizeHint which);
90
void afterWidthChanged();
91
void afterHeightChanged();
94
QWeakPointer<Plasma::Applet>m_applet;