don't need the view id stuff here any more either :)
[kdebase.git] / workspace / plasma / shells / screensaver / plasmaapp.h
blobeca487a99574ed977d51422f2fadde4133fa5896
1 /*
2 * Copyright 2006, 2007 Aaron Seigo <aseigo@kde.org>
3 * Copyright 2008 Chani Armitage <chanika@gmail.com>
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.
21 #ifndef PLASMA_APP_H
22 #define PLASMA_APP_H
24 #include <QList>
26 #include <KUniqueApplication>
28 #include "ui_saverconfig.h"
30 namespace Plasma
32 class Containment;
33 class Corona;
34 } // namespace Plasma
36 class SaverView;
37 class KConfigDialog;
39 class PlasmaApp : public KUniqueApplication
41 Q_OBJECT
42 Q_CLASSINFO("D-Bus Interface", "org.kde.plasmaoverlay.App")
43 public:
44 ~PlasmaApp();
46 static PlasmaApp* self();
47 static bool hasComposite();
49 Plasma::Corona* corona();
51 void setActiveOpacity(qreal opacity);
52 void setIdleOpacity(qreal opacity);
53 qreal activeOpacity() const;
54 qreal idleOpacity() const;
56 Q_SIGNALS:
57 // DBUS interface.
58 //if you change stuff, remember to regenerate with:
59 //qdbuscpp2xml -S -M plasmaapp.h > org.kde.plasma-overlay.App.xml
61 //XXX can this be deleted? probably. if lockprocess really cares it can use the unmapnotify
62 void hidden();
64 public Q_SLOTS:
65 // DBUS interface.
66 //if you change stuff, remember to regenerate
67 /**
68 * tell plasma to go into active mode, ready for interaction
70 void activate();
72 /**
73 * tell plasma to go into idle mode
74 * this does not mean exit, it just means the computer is idle
76 void deactivate();
78 /**
79 * lock widgets
81 void lock();
83 //not really slots, but we want them in dbus
85 /**
86 * quit the application
87 * this is a duplicate so we can have everything we need in one dbus interface
89 void quit();
91 private Q_SLOTS:
92 void cleanup();
93 void createView(Plasma::Containment *containment);
94 void adjustSize(int screen);
95 void dialogDestroyed(QObject *obj);
96 void hideDialogs();
97 void showDialogs();
98 void createConfigurationInterface(KConfigDialog *parent);
99 void configAccepted();
101 protected:
102 bool eventFilter(QObject *obj, QEvent *event);
104 private:
105 PlasmaApp(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap);
107 Plasma::Corona *m_corona;
108 SaverView *m_view;
109 QList<QWidget*> m_dialogs;
110 Ui::saverConfig ui;
112 qreal m_activeOpacity;
113 qreal m_idleOpacity;
116 #endif // multiple inclusion guard