2 * Copyright 2006, 2007 Aaron Seigo <aseigo@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <KUniqueApplication>
30 #include <Plasma/Plasma>
44 class BackgroundDialog
;
49 class PlasmaApp
: public KUniqueApplication
55 static PlasmaApp
* self();
56 static bool hasComposite();
58 void notifyStartup(bool completed
);
59 Plasma::Corona
* corona();
60 void showAppletBrowser(Plasma::Containment
*containment
);
63 * Creates a view for the given containment
65 void createDesktopView(Plasma::Containment
*containment
, int id
= 0);
68 * Should be called when a panel hides or unhides itself
70 void panelHidden(bool hidden
);
73 * Current desktop zoom level
75 Plasma::ZoomLevel
desktopZoomLevel() const;
78 * Returns the PanelViews
80 QList
<PanelView
*> panelViews() const;
85 Atom m_XdndFinishedAtom
;
86 Atom m_XdndPositionAtom
;
87 Atom m_XdndStatusAtom
;
88 Atom m_XdndVersionAtom
;
92 // DBUS interface. if you change these methods, you MUST run:
93 // qdbuscpp2xml plasmaapp.h -o dbus/org.kde.plasma.App.xml
94 void toggleDashboard();
97 * Request a zoom based on the containment
99 void zoom(Plasma::Containment
*, Plasma::ZoomDirection
);
103 PanelView
*findPanelForTrigger(WId trigger
) const;
104 bool x11EventFilter(XEvent
*event
);
108 PlasmaApp(Display
* display
, Qt::HANDLE visual
, Qt::HANDLE colormap
);
109 DesktopView
* viewForScreen(int screen
, int desktop
) const;
110 void zoomIn(Plasma::Containment
*containment
);
111 void zoomOut(Plasma::Containment
*containment
);
116 void containmentAdded(Plasma::Containment
*containment
);
118 void appletBrowserDestroyed();
119 void createView(Plasma::Containment
*containment
);
120 void panelRemoved(QObject
* panel
);
121 void configDialogRemoved(QObject
* configDialogRemoved
);
122 void screenRemoved(int id
);
123 void compositingChanged();
124 void showAppletBrowser();
125 void addContainment(Plasma::Containment
*fromContainment
= 0);
126 void configureContainment(Plasma::Containment
*);
129 DesktopCorona
*m_corona
;
130 QList
<PanelView
*> m_panels
;
131 Plasma::AppletBrowser
*m_appletBrowser
;
132 QList
<DesktopView
*> m_desktops
;
133 QHash
<Plasma::Containment
*, BackgroundDialog
*> m_configDialogs
;
134 Plasma::ZoomLevel m_zoomLevel
;
138 #endif // multiple inclusion guard