1/*****************************************************************
2ksmserver - the KDE session management server
3
4Copyright 2000 Matthias Ettrich <ettrich@kde.org>
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23******************************************************************/
24
25#ifndef SHUTDOWNDLG_H
26#define SHUTDOWNDLG_H
27
28#include <QDialog>
29#include <QPushButton>
30#include <kworkspace/kworkspace.h>
31
32class QMenu;
33class QTimer;
34class QTimeLine;
35class QLabel;
36class LogoutEffect;
37
38namespace Plasma
39{
40 class Svg;
41 class FrameSvg;
42}
43
44// The (singleton) widget that makes the desktop gray.
45class KSMShutdownFeedback : public QWidget
46{
47 Q_OBJECT
48
49public:
50 static void start();
51 static void stop();
52 static void logoutCanceled();
53
54protected:
55 ~KSMShutdownFeedback() {}
56
57 virtual void paintEvent( QPaintEvent* );
58
59private Q_SLOTS:
60 void slotPaintEffect();
61 void slotPaintEffectInitialized();
62
63private:
64 static KSMShutdownFeedback * s_pSelf;
65 KSMShutdownFeedback();
66 int m_currentY;
67 QPixmap m_pixmap;
68 LogoutEffect *effect;
69 bool initialized;
70};
71
72class QDeclarativeView;
73
74// The confirmation dialog
75class KSMShutdownDlg : public QDialog
76{
77 Q_OBJECT
78
79public:
80 static bool confirmShutdown(
81 bool maysd, bool choose, KWorkSpace::ShutdownType& sdtype, QString& bopt, const QString& theme );
82 bool eventFilter( QObject* watched, QEvent* event );
83
84public Q_SLOTS:
85 void slotLogout();
86 void slotHalt();
87 void slotReboot();
88 void slotReboot(int);
89 void slotSuspend(int);
90 void slotLockScreen();
91
92protected:
93 void resizeEvent(QResizeEvent *e);
94
95private:
96 KSMShutdownDlg( QWidget* parent, bool maysd, bool choose, KWorkSpace::ShutdownType sdtype, const QString& theme );
97 KWorkSpace::ShutdownType m_shutdownType;
98 QString m_bootOption;
99 QStringList rebootOptions;
100 QDeclarativeView* m_view;
101};
102
103#endif
104