2
Copyright (c) 2007 Zack Rusin <zack@kde.org>
3
Copyright (c) 2008 Petri Damstén <damu@iki.fi>
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
7
in the Software without restriction, including without limitation the rights
8
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
copies of the Software, and to permit persons to whom the Software is
10
furnished to do so, subject to the following conditions:
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
#ifndef PLASMAWEBAPPLET_H
25
#define PLASMAWEBAPPLET_H
27
#include "webapplet.h"
30
#include <KTemporaryFile>
32
class PlasmaWebApplet : public WebApplet
35
Q_PROPERTY(QString name READ name)
36
Q_PROPERTY(uint id READ id)
37
Q_PROPERTY(QString pluginName READ pluginName)
38
Q_PROPERTY(QString icon READ icon)
39
Q_PROPERTY(QString category READ category)
40
Q_PROPERTY(int formFactor READ formFactor)
41
Q_PROPERTY(int location READ location)
44
PlasmaWebApplet(QObject *parent, const QVariantList &args);
45
virtual ~PlasmaWebApplet();
51
QString pluginName() const;
53
QString category() const;
54
bool shouldConserveResources() const;
55
int formFactor() const;
59
QStringList listAllDataEngines();
60
QObject* dataEngine(const QString& name);
62
QObject* globalConfig();
63
void setScrollBarPolicy(int orientation, int policy);
64
QVariantList screenRect();
65
void setConfigurationRequired(bool needsConfiguring, const QString &reason = QString());
66
QVariantList getContentsMargins();
67
void resize(qreal w, qreal h);
69
void setBackgroundHints(int hints);
70
int backgroundHints();
71
void setAspectRatioMode(int mode);
72
int aspectRatioMode();
73
void setMaximumSize(qreal w, qreal h);
74
QVariantList maximumSize();
75
void setMinimumSize(qreal w, qreal h);
76
QVariantList minimumSize();
77
void setPreferredSize(qreal w, qreal h);
78
QVariantList preferredSize();
79
void setGeometry(qreal x, qreal y, qreal w, qreal h);
80
QVariantList geometry();
81
void setPos(qreal x, qreal y);
83
void setFailedToLaunch(bool failed, const QString &reason = QString());
86
void setBusy(bool busy);
88
QVariant arg(int index) const;
89
QObject* objArg(int index) const;
90
void dataUpdated(const QString& source, const Plasma::DataEngine::Data &data);
93
void makeStylesheet();
96
QVariant callJsFunction(const QString &func, const QVariantList &args = QVariantList());
97
void constraintsEvent(Plasma::Constraints constraints);
100
virtual void loadFinished(bool success);
101
virtual void initJsObjects();
105
DataEngineDataWrapper m_dataEngineData;
106
ConfigGroupWrapper m_config;
107
ConfigGroupWrapper m_globalConfig;
108
KTemporaryFile m_styleSheetFile;
109
static QString s_jsConstants;