Plasma
plasmaapp.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 #ifndef PLASMA_APP_H
00021 #define PLASMA_APP_H
00022
00023 #include <QHash>
00024 #include <QList>
00025 #include <QSize>
00026 #include <QPoint>
00027
00028 #include <KUniqueApplication>
00029
00030 #include <Plasma/Plasma>
00031
00032 namespace Plasma
00033 {
00034 class AppletBrowser;
00035 class Containment;
00036 class Corona;
00037 }
00038
00039 namespace Kephal {
00040 class Screen;
00041 }
00042
00043 class DesktopView;
00044 class BackgroundDialog;
00045 class RootWidget;
00046 class PanelView;
00047 class DesktopCorona;
00048
00049 class PlasmaApp : public KUniqueApplication
00050 {
00051 Q_OBJECT
00052 public:
00053 ~PlasmaApp();
00054
00055 static PlasmaApp* self();
00056 static bool hasComposite();
00057
00058 void notifyStartup(bool completed);
00059 Plasma::Corona* corona();
00060 void showAppletBrowser(Plasma::Containment *containment);
00061
00065 void createDesktopView(Plasma::Containment *containment, int id = 0);
00066
00070 void panelHidden(bool hidden);
00071
00075 Plasma::ZoomLevel desktopZoomLevel() const;
00076
00080 QList<PanelView*> panelViews() const;
00081
00082 #ifdef Q_WS_X11
00083 Atom m_XdndAwareAtom;
00084 Atom m_XdndEnterAtom;
00085 Atom m_XdndFinishedAtom;
00086 Atom m_XdndPositionAtom;
00087 Atom m_XdndStatusAtom;
00088 Atom m_XdndVersionAtom;
00089 #endif
00090
00091 public Q_SLOTS:
00092
00093
00094 void toggleDashboard();
00095
00099 void zoom(Plasma::Containment*, Plasma::ZoomDirection);
00100
00101 protected:
00102 #ifdef Q_WS_X11
00103 PanelView *findPanelForTrigger(WId trigger) const;
00104 bool x11EventFilter(XEvent *event);
00105 #endif
00106
00107 private:
00108 PlasmaApp(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap);
00109 DesktopView* viewForScreen(int screen, int desktop) const;
00110 void zoomIn(Plasma::Containment *containment);
00111 void zoomOut(Plasma::Containment *containment);
00112
00113 private Q_SLOTS:
00114 void setupDesktop();
00115 void cleanup();
00116 void containmentAdded(Plasma::Containment *containment);
00117 void syncConfig();
00118 void appletBrowserDestroyed();
00119 void createView(Plasma::Containment *containment);
00120 void panelRemoved(QObject* panel);
00121 void configDialogRemoved(QObject* configDialogRemoved);
00122 void screenRemoved(int id);
00123 void compositingChanged();
00124 void showAppletBrowser();
00125 void addContainment(Plasma::Containment *fromContainment = 0);
00126 void configureContainment(Plasma::Containment*);
00127
00128 private:
00129 DesktopCorona *m_corona;
00130 QList<PanelView*> m_panels;
00131 Plasma::AppletBrowser *m_appletBrowser;
00132 QList<DesktopView*> m_desktops;
00133 QHash<Plasma::Containment *, BackgroundDialog *> m_configDialogs;
00134 Plasma::ZoomLevel m_zoomLevel;
00135 int m_panelHidden;
00136 };
00137
00138 #endif // multiple inclusion guard