Plasma
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 PLASMA_CORONA_H
00022 #define PLASMA_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 class QGraphicsGridLayout;
00031
00032 namespace Plasma
00033 {
00034
00035 class Containment;
00036 class CoronaPrivate;
00037
00043 class PLASMA_EXPORT Corona : public QGraphicsScene
00044 {
00045 Q_OBJECT
00046
00047
00048
00049 public:
00050 explicit Corona(QObject * parent = 0);
00051 ~Corona();
00052
00057 void setAppletMimeType(const QString &mimetype);
00058
00062 QString appletMimeType();
00063
00067 QList<Containment*> containments() const;
00068
00072 void clearContainments();
00073
00077 KSharedConfig::Ptr config() const;
00078
00091 Containment *addContainment(const QString &name, const QVariantList &args = QVariantList());
00092
00100 Containment *containmentForScreen(int screen, int desktop = -1) const;
00101
00108 void addOffscreenWidget(QGraphicsWidget *widget);
00109
00114 void removeOffscreenWidget(QGraphicsWidget *widget);
00115
00121 virtual int numScreens() const;
00122
00129 virtual QRect screenGeometry(int id) const;
00130
00139 virtual QRegion availableScreenRegion(int id) const;
00140
00148 QPoint popupPosition(const QGraphicsItem *item, const QSize &size);
00149
00156 QList<Plasma::Location> freeEdges(int screen) const;
00157
00158 public Q_SLOTS:
00167 void initializeLayout(const QString &config = QString());
00168
00176 void loadLayout(const QString &config = QString());
00177
00182 void saveLayout(const QString &config = QString()) const;
00183
00187 ImmutabilityType immutability() const;
00188
00194 void setImmutability(const ImmutabilityType immutable);
00195
00200 void requestConfigSync();
00201
00209 void requireConfigSync();
00210
00211 Q_SIGNALS:
00216 void containmentAdded(Plasma::Containment *containment);
00217
00226 void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment);
00227
00234 void releaseVisualFocus();
00235
00239 void configSynced();
00240
00244 void availableScreenRegionChanged();
00245
00246 protected:
00250 virtual void loadDefaultLayout();
00251
00266 Containment *addContainmentDelayed(const QString &name,
00267 const QVariantList &args = QVariantList());
00268
00269
00270 void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
00271 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
00272 void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
00273
00274 private:
00275 CoronaPrivate *const d;
00276
00277 Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
00278 Q_PRIVATE_SLOT(d, void offscreenWidgetDestroyed(QObject *))
00279 Q_PRIVATE_SLOT(d, void syncConfig())
00280
00281 friend class CoronaPrivate;
00282 };
00283
00284 }
00285
00286 #endif
00287