X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=screenlitkeeper.h;fp=screenlitkeeper.h;h=24dd565c3309e897a8a620af9e1784729a4146e8;hb=6eaae217ae97f15f57bf0425efd13b375a1bc8c0;hp=0000000000000000000000000000000000000000;hpb=86f34fc32149646c3e6fb0dad1f437eac203f030;p=ghostsoverboard diff --git a/screenlitkeeper.h b/screenlitkeeper.h new file mode 100644 index 0000000..24dd565 --- /dev/null +++ b/screenlitkeeper.h @@ -0,0 +1,69 @@ +/************************************************************************** + ScreenLitKeeper + + Copyright (C) 2010 Heli Hyvättinen + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +**************************************************************************/ + + + + + +#ifndef SCREENLITKEEPER_H +#define SCREENLITKEEPER_H + +#include +#include +using namespace QtMobility; + + +/*! Allows keeping the sreen lit by disabling the screensaver + +Works at least on N900. +The sreen can be set to be kept lit or not. +To use this class, you must have the following lines in your .pro file: +CONFIG += mobility +MOBILITY += systeminfo + +@author Heli Hyvättinen +@date 2010-09-07 +@version 1 + + */ + +class ScreenLitKeeper : public QObject +{ + Q_OBJECT +public: + explicit ScreenLitKeeper(QObject *parent = 0); + +signals: + +public slots: + /*! +Sets whether the screen is to be kept lit +@param keepLit true for keeping lit, false for allowing blanking +*/ + + void keepScreenLit(bool keepLit); + +private: + QSystemScreenSaver * p_screensaver_; + bool isKeptLit_; + +}; + +#endif // SCREENLITKEEPER_H