2
* Copyright 2006, 2007 Aaron Seigo <aseigo@kde.org>
3
* Copyright 2010 Chani Armitage <chani@kde.org>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2,
8
* or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details
15
* You should have received a copy of the GNU Library General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
#include <QWeakPointer>
30
#include <KUniqueApplication>
32
#include <Plasma/Plasma>
33
#include <plasma/packagemetadata.h>
39
class AccessAppletJob;
49
class ControllerWindow;
52
class InteractiveConsole;
56
class PlasmaApp : public KUniqueApplication
62
static PlasmaApp *self();
63
static bool hasComposite();
65
static void suspendStartup(bool completed);
66
DesktopCorona *corona();
69
* Should be called when a panel hides or unhides itself
71
void panelHidden(bool hidden);
74
* Returns the PanelViews
76
QList<PanelView*> panelViews() const;
77
PanelShadows *panelShadows() const;
79
ControllerWindow *showWidgetExplorer(int screen, Plasma::Containment *c);
80
void hideController(int screen);
83
* create a new activity based on the active one
85
void cloneCurrentActivity();
87
* create a new blank activity with @p plugin containment type
89
void createActivity(const QString &plugin);
91
* create a new activity from @p script
93
void createActivityFromScript(const QString &script, const QString &name = QString(), const QString &icon = QString(), const QStringList &startupApps = QStringList());
94
static bool isPanelContainment(Plasma::Containment *containment);
99
Atom m_XdndFinishedAtom;
100
Atom m_XdndPositionAtom;
101
Atom m_XdndStatusAtom;
102
Atom m_XdndVersionAtom;
106
// DBUS interface. if you change these methods, you MUST run:
107
// qdbuscpp2xml plasmaapp.h -o dbus/org.kde.plasma.App.xml
108
void toggleDashboard();
109
void showDashboard(bool show);
111
void showInteractiveConsole();
112
void loadScriptInInteractiveConsole(const QString &script);
114
Q_SCRIPTABLE void quit();
115
void setPerVirtualDesktopViews(bool perDesktopViews);
116
bool perVirtualDesktopViews() const;
117
void setFixedDashboard(bool fixedDashboard);
118
bool fixedDashboard() const;
120
void createWaitingPanels();
121
void createWaitingDesktops();
122
void createView(Plasma::Containment *containment);
124
void toggleActivityManager();
126
void addRemotePlasmoid(const QString &location);
130
PanelView *findPanelForTrigger(WId trigger) const;
131
bool x11EventFilter(XEvent *event);
133
void setControllerVisible(bool show);
137
DesktopView* viewForScreen(int screen, int desktop) const;
138
ControllerWindow *showController(int screen, Plasma::Containment *c, bool widgetExplorerMode);
139
bool canRelocatePanel(PanelView * view, Kephal::Screen *screen);
140
PanelView *createPanelView(Plasma::Containment *containment);
145
void containmentAdded(Plasma::Containment *containment);
146
void containmentScreenOwnerChanged(int, int, Plasma::Containment*);
148
void panelRemoved(QObject* panel);
149
void screenRemoved(int id);
150
void screenAdded(Kephal::Screen *screen);
151
void configureContainment(Plasma::Containment*);
152
void checkVirtualDesktopViews(int numDesktops);
153
void setWmClass(WId id);
154
void remotePlasmoidAdded(Plasma::PackageMetadata metadata);
155
void plasmoidAccessFinished(Plasma::AccessAppletJob *job);
156
void wallpaperCheckedIn();
157
void wallpaperCheckInTimeout();
158
void dashboardClosed();
159
void relocatePanels();
160
void executeCommands(const QList < QVariant > & commands);
163
DesktopCorona *m_corona;
164
PanelShadows *m_panelShadows;
166
QList<PanelView*> m_panels;
167
QList<QWeakPointer<Plasma::Containment> > m_panelsWaiting;
168
QList<QWeakPointer<Plasma::Containment> > m_panelRelocationCandidates;
170
QList<DesktopView*> m_desktops;
171
QList<QWeakPointer<Plasma::Containment> > m_desktopsWaiting;
173
QTimer m_panelViewCreationTimer;
174
QTimer m_desktopViewCreationTimer;
175
QWeakPointer<InteractiveConsole> m_console;
177
QSignalMapper *m_mapper;
178
QHash<int, QWeakPointer<ControllerWindow> > m_widgetExplorers;
179
int m_startupSuspendWaitCount;
180
bool m_ignoreDashboardClosures;
181
bool m_pendingFixedDashboard;
183
QString m_loadingActivity;
186
#endif // multiple inclusion guard