2
* Copyright 2008 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 Library General Public License as
6
* published by the Free Software Foundation; either version 2, or
7
* (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.
20
#ifndef DESKTOPCORONA_H
21
#define DESKTOPCORONA_H
23
#include <QtGui/QGraphicsScene>
26
#include <Plasma/Corona>
32
class KActivityController;
44
* @short A Corona with desktop-y considerations
46
class DesktopCorona : public Plasma::Corona
51
explicit DesktopCorona(QObject * parent = 0);
55
* Loads the default (system wide) layout for this user
57
void loadDefaultLayout();
60
* Ensures we have the necessary containments for every screen
62
void checkScreens(bool signalWhenExists = false);
65
* Ensures we have the necessary containments for the given screen
67
void checkScreen(int screen, bool signalWhenExists = false);
69
int numScreens() const;
70
QRect screenGeometry(int id) const;
71
QRegion availableScreenRegion(int id) const;
72
int screenId(const QPoint &pos) const;
74
bool loadDefaultLayoutScripts();
75
void processUpdateScripts();
78
* Ensures activities exist for the containments
80
void checkActivities();
83
* @return the Activity object for the given activity id
85
Activity* activity(const QString &id);
88
QRect availableScreenRect(int id) const;
90
void addPanel(QAction *action);
91
void addPanel(const QString &plugin);
92
void populateAddPanelsMenu();
93
void activateNextActivity();
94
void activatePreviousActivity();
95
void evaluateScripts(const QStringList &scripts);
98
void screenAdded(Kephal::Screen *s);
99
void saveDefaultSetup();
100
void printScriptError(const QString &error);
101
void printScriptMessage(const QString &error);
102
void updateImmutability(Plasma::ImmutabilityType immutability);
103
void checkAddPanelAction(const QStringList &sycocaChanges = QStringList());
104
void currentActivityChanged(const QString &activity);
105
void activityAdded(const QString &id);
106
void activityRemoved(const QString &id);
111
Plasma::Applet *loadDefaultApplet(const QString &pluginName, Plasma::Containment *c);
112
void checkDesktop(Activity *activity, bool signalWhenExists, int screen, int desktop = -1);
114
QAction *m_addPanelAction;
115
QMenu *m_addPanelsMenu;
116
KActivityController *m_activityController;
117
QHash<QString, Activity*> m_activities;