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