not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / screensaver / scrnsave.h
blob1cf966b98a67245468a1d4dd38547e68f9f542b0
1 //-----------------------------------------------------------------------------
2 //
3 // KDE Display screen saver setup module
4 //
5 // Copyright (c) Martin R. Jones 1996
6 // Copyright (C) Chris Howells 2004
7 //
9 #ifndef __SCRNSAVE_H__
10 #define __SCRNSAVE_H__
12 #include <QWidget>
13 //Added by qt3to4:
14 #include <QMouseEvent>
15 #include <QLabel>
16 #include <QResizeEvent>
17 #include <QKeyEvent>
18 #include <kcmodule.h>
20 #include "kssmonitor.h"
21 #include "saverconfig.h"
22 #include "testwin.h"
23 #include "advanceddialog.h"
24 #include "saverlist.h"
26 class QTimer;
27 class QSpinBox;
28 class QCheckBox;
29 class QLabel;
30 class Q3ListView;
31 class Q3ListViewItem;
32 class QPushButton;
33 class K3Process;
35 //===========================================================================
36 class KScreenSaver : public KCModule
38 Q_OBJECT
39 public:
40 KScreenSaver(QWidget *parent, const QVariantList &);
41 ~KScreenSaver();
43 virtual void load();
44 virtual void save();
45 virtual void defaults();
47 void updateValues();
48 void readSettings();
50 protected Q_SLOTS:
51 void slotEnable( bool );
52 void slotScreenSaver( Q3ListViewItem* );
53 void slotSetup();
54 void slotAdvanced();
55 void slotTest();
56 void slotStopTest();
57 void slotTimeoutChanged( int );
58 void slotLockTimeoutChanged( int );
59 void slotLock( bool );
60 void slotSetupDone(K3Process*);
61 // when selecting a new screensaver, the old preview will
62 // be killed. -- This callback is responsible for restarting the
63 // new preview
64 void slotPreviewExited(K3Process *);
65 void findSavers();
66 void slotEnablePlasma(bool enable);
67 void slotPlasmaSetup();
69 protected:
70 void writeSettings();
71 void getSaverNames();
72 void setMonitor();
73 void setDefaults();
74 void resizeEvent( QResizeEvent * );
75 void mousePressEvent(QMouseEvent *);
76 void keyPressEvent(QKeyEvent *);
78 protected:
79 TestWin *mTestWin;
80 K3Process *mTestProc;
81 K3Process *mSetupProc;
82 K3Process *mPreviewProc;
83 KSSMonitor *mMonitor;
84 QPushButton *mSetupBt;
85 QPushButton *mTestBt;
86 QPushButton *mPlasmaSetup;
87 Q3ListView *mSaverListView;
88 QSpinBox *mWaitEdit;
89 QSpinBox *mWaitLockEdit;
90 QCheckBox *mLockCheckBox;
91 QCheckBox *mStarsCheckBox;
92 QCheckBox *mEnabledCheckBox;
93 QCheckBox *mPlasmaCheckBox;
94 QLabel *mMonitorLabel;
95 QLabel *mActivateLbl;
96 QLabel *mLockLbl;
97 KService::List mSaverServices;
98 SaverList mSaverList;
99 QTimer *mLoadTimer;
100 QGroupBox *mSaverGroup;
101 QGroupBox *mSettingsGroup;
103 int mSelected;
104 int mPrevSelected;
105 int mNumLoaded;
106 bool mChanged;
107 bool mTesting;
109 // Settings
110 int mTimeout;
111 int mLockTimeout;
112 bool mLock;
113 bool mEnabled;
114 QString mSaver;
115 bool mImmutable;
116 bool mPlasmaEnabled;
119 #endif