libplasma
corona.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 #ifndef CORONA_H
00022 #define CORONA_H
00023
00024 #include <QtGui/QGraphicsScene>
00025
00026 #include <plasma/applet.h>
00027 #include <plasma/plasma.h>
00028 #include <plasma/plasma_export.h>
00029
00030 namespace Plasma
00031 {
00032
00033 class Containment;
00034 class CoronaPrivate;
00035
00039 class PLASMA_EXPORT Corona : public QGraphicsScene
00040 {
00041 Q_OBJECT
00042
00043
00044
00045 public:
00046 explicit Corona(QObject * parent = 0);
00047 ~Corona();
00048
00053 void setAppletMimeType(const QString &mimetype);
00054
00058 QString appletMimeType();
00059
00063 QList<Containment*> containments() const;
00064
00068 void clearContainments();
00069
00073 KSharedConfig::Ptr config() const;
00074
00087 Containment* addContainment(const QString& name, const QVariantList& args = QVariantList());
00088
00094 Containment* containmentForScreen(int screen) const;
00095
00096 public Q_SLOTS:
00105 void initializeLayout(const QString &config = QString());
00106
00114 void loadLayout(const QString &config = QString());
00115
00120 void saveLayout(const QString &config = QString()) const;
00121
00125 ImmutabilityType immutability() const;
00126
00131 void setImmutability(const ImmutabilityType immutable);
00132
00137 void requestConfigSync();
00138
00139 Q_SIGNALS:
00144 void containmentAdded(Plasma::Containment *containment);
00145
00154 void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment);
00155
00162 void releaseVisualFocus();
00163
00167 void configSynced();
00168
00169 protected:
00173 virtual void loadDefaultLayout();
00174
00189 Containment *addContainmentDelayed(const QString& name, const QVariantList& args = QVariantList());
00190
00191
00192 void dragEnterEvent(QGraphicsSceneDragDropEvent* event);
00193 void dragLeaveEvent(QGraphicsSceneDragDropEvent* event);
00194 void dragMoveEvent(QGraphicsSceneDragDropEvent* event);
00195
00196 private:
00197 CoronaPrivate * const d;
00198
00199 Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
00200 Q_PRIVATE_SLOT(d, void syncConfig())
00201
00202 friend class CoronaPrivate;
00203 };
00204
00205 }
00206
00207 #endif
00208
00209