2
* Copyright 2006-2008 Aaron Seigo <aseigo@kde.org>
3
* Copyright 2009 Marco Martin <notmart@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.
25
#include <KUniqueApplication>
27
#include <plasma/plasma.h>
54
class PlasmaApp : public KUniqueApplication
60
static PlasmaApp* self();
61
static bool hasComposite();
63
void suspendStartup(bool suspend);
64
Plasma::Corona* corona();
67
* Sets the view to be a desktop window if @p isDesktop is true
68
* or an ordinary window otherwise.
70
* Desktop windows are displayed beneath all other windows, have
71
* no window decoration and occupy the full size of the screen.
73
* The default behaviour is not to register the view as the desktop
76
void setIsDesktop(bool isDesktop);
78
NetView *controlBar() const;
80
NetView *mainView() const;
82
QWidget *widgetExplorer() const;
85
* Returns true if this widget is currently a desktop window.
88
bool isDesktop() const;
90
void showWidgetExplorer(Plasma::Containment *containment);
93
void setAutoHideControlBar(bool autoHide);
96
bool eventFilter(QObject *watched, QEvent *event);
97
bool x11EventFilter(XEvent *event);
98
//true if the application has an active window
99
bool hasForegroundWindows() const;
100
//more strict than hasForegroundWindows, the mainview has to be not only active, but also on top of other windows
101
bool mainViewOnTop() const;
105
void reserveStruts();
106
void createUnhideTrigger();
107
void destroyUnHideTrigger();
112
void positionPanel();
113
void createView(Plasma::Containment *containment);
114
void adjustSize(Kephal::Screen *);
115
void controlBarMoved(const NetView *controlBar);
116
void showWidgetExplorer();
117
void widgetExplorerDestroyed();
118
void closeWidgetExplorer();
119
void mainContainmentActivated();
120
//TODO: probably those functions can go in netview
121
void controlBarVisibilityUpdate();
122
void showControlBar();
123
void hideControlBar();
124
void setControlBarVisible(bool visible);
125
void toggleControlBarVisibility();
126
void lowerMainView();
127
void configureContainment(Plasma::Containment *containment);
128
void updateToolBoxVisibility(bool visible);
129
void unhideHintMousePoll();
130
void wallpaperCheckedIn();
131
void wallpaperCheckInTimeout();
135
void controlBarChanged();
139
Plasma::Dialog *m_widgetExplorerView;
140
Plasma::WidgetExplorer *m_widgetExplorer;
142
Window m_unhideTrigger;
144
QRect m_unhideTriggerGeom;
147
QTimer *m_mousePollTimer;
148
NetView *m_controlBar;
151
bool m_autoHideControlBar;
152
QTimer *m_unHideTimer;
153
ShadowWindow *m_shadowWindow;
154
int m_startupSuspendWaitCount;
157
#endif // multiple inclusion guard