Updated the web pages
[chessclock] / classes / screenlitkeeper.h
1 /**************************************************************************
2         ScreenLitKeeper
3
4         Copyright (C) 2010  Heli Hyvättinen
5         
6         This file is free software: you can redistribute it and/or modify
7         it under the terms of the GNU General Public License as published by
8         the Free Software Foundation, either version 3 of the License, or
9         (at your option) any later version.
10
11         This program is distributed in the hope that it will be useful,
12         but WITHOUT ANY WARRANTY; without even the implied warranty of
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14         GNU General Public License for more details.
15
16         You should have received a copy of the GNU General Public License
17         along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 **************************************************************************/
20
21
22
23
24
25 #ifndef SCREENLITKEEPER_H
26 #define SCREENLITKEEPER_H
27
28 #include <QObject>
29 #include <QSystemScreenSaver>
30 using namespace QtMobility;
31
32
33 /*! Allows keeping the sreen lit by disabling the screensaver
34
35 Works at least on N900.
36 The sreen can be set to be kept lit or not.
37 To use this class, you must have the following lines  in your .pro file:
38 CONFIG += mobility
39 MOBILITY += systeminfo
40
41 @author Heli Hyvättinen
42 @date 2010-09-07
43 @version 1
44
45   */
46
47 class ScreenLitKeeper : public QObject
48 {
49     Q_OBJECT
50 public:
51     explicit ScreenLitKeeper(QObject *parent = 0);
52
53 signals:
54
55 public slots:
56  /*!
57 Sets whether the screen is to be kept lit
58 @param keepLit true for keeping lit, false for allowing blanking
59 */
60
61     void keepScreenLit(bool keepLit);
62
63 private:
64      QSystemScreenSaver * p_screensaver_;
65      bool isKeptLit_;
66
67 };
68
69 #endif // SCREENLITKEEPER_H