Plasma
plasmawebapplet.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PLASMAWEBAPPLET_H
00025 #define PLASMAWEBAPPLET_H
00026
00027 #include "webapplet.h"
00028 #include "plasmajs.h"
00029
00030 #include <KTemporaryFile>
00031
00032 class PlasmaWebApplet : public WebApplet
00033 {
00034 Q_OBJECT
00035 Q_PROPERTY(QString name READ name)
00036 Q_PROPERTY(uint id READ id)
00037 Q_PROPERTY(QString pluginName READ pluginName)
00038 Q_PROPERTY(QString icon READ icon)
00039 Q_PROPERTY(QString category READ category)
00040 Q_PROPERTY(int formFactor READ formFactor)
00041 Q_PROPERTY(int location READ location)
00042 public:
00043 PlasmaWebApplet(QObject *parent, const QVariantList &args);
00044 virtual ~PlasmaWebApplet();
00045
00046 virtual bool init();
00047
00048 QString name() const;
00049 uint id() const;
00050 QString pluginName() const;
00051 QString icon() const;
00052 QString category() const;
00053 bool shouldConserveResources() const;
00054 int formFactor() const;
00055 int location() const;
00056
00057 public slots:
00058 QObject* dataEngine(const QString& name);
00059 QObject* config();
00060 QObject* globalConfig();
00061 void setScrollBarPolicy(int orientation, int policy);
00062 void setDefaultSize(qreal w, qreal h);
00063 QVariantList screenRect();
00064 void setConfigurationRequired(bool needsConfiguring);
00065 QVariantList getContentsMargins();
00066 void resize(qreal w, qreal h);
00067 QVariantList size();
00068 void setBackgroundHints(int hints);
00069 int backgroundHints();
00070 void setAspectRatioMode(int mode);
00071 int aspectRatioMode();
00072 void setMaximumSize(qreal w, qreal h);
00073 QVariantList maximumSize();
00074 void setMinimumSize(qreal w, qreal h);
00075 QVariantList minimumSize();
00076 void setPreferredSize(qreal w, qreal h);
00077 QVariantList preferredSize();
00078 void setGeometry(qreal x, qreal y, qreal w, qreal h);
00079 QVariantList geometry();
00080 void setPos(qreal x, qreal y);
00081 QVariantList pos();
00082
00083 QVariant arg(int index) const;
00084 QObject* objArg(int index) const;
00085 void dataUpdated(const QString& source, const Plasma::DataEngine::Data &data);
00086 void configChanged();
00087 void themeChanged();
00088 void makeStylesheet();
00089
00090 protected:
00091 QVariant callJsFunction(const QString &func, const QVariantList &args = QVariantList());
00092 void constraintsEvent(Plasma::Constraints constraints);
00093
00094 protected slots:
00095 virtual void loadFinished(bool success);
00096 virtual void initJsObjects();
00097
00098 private:
00099 QVariantList m_args;
00100 DataEngineDataWrapper m_dataEngineData;
00101 ConfigGroupWrapper m_config;
00102 ConfigGroupWrapper m_globalConfig;
00103 KTemporaryFile m_temp;
00104 bool m_useDefaultSize;
00105 static QString m_jsConstants;
00106 };
00107
00108 #endif