diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-08-21 21:26:05 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-08-21 21:26:05 +0200 |
commit | 29b50d195f91ee5131805a0ca9fe45ab77655c8a (patch) | |
tree | 2ccda3f73a19fa8f03e6c02f9113728e5aad1d44 /src/brightnesschooserimpl.h | |
download | klcddimmer-29b50d195f91ee5131805a0ca9fe45ab77655c8a.tar.gz klcddimmer-29b50d195f91ee5131805a0ca9fe45ab77655c8a.zip |
Initial import of klcddimmer 0.3
Diffstat (limited to 'src/brightnesschooserimpl.h')
-rw-r--r-- | src/brightnesschooserimpl.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/brightnesschooserimpl.h b/src/brightnesschooserimpl.h new file mode 100644 index 0000000..2bf2fa9 --- /dev/null +++ b/src/brightnesschooserimpl.h @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2005 by Lorenzo Bettini * + * http://www.lorenzobettini.it * + * * + * This program 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef BRIGHTNESSCHOOSERIMPL_H +#define BRIGHTNESSCHOOSERIMPL_H + +#include <brightnesschooser.h> + +class QProcess; + +/** +Implementation slots for BrightnessChooser + +@author Lorenzo Bettini, http://www.lorenzobettini.it,, +*/ +class BrightnessChooserImpl : public BrightnessChooser +{ +Q_OBJECT +public: + BrightnessChooserImpl(QWidget *parent = 0, const char *name = 0); + + ~BrightnessChooserImpl(); + + /** + * Updates the slider properties according to the global + * properties. + */ + void updateSlider(); + + /** + * Returns the current value of brightness. + * @return + */ + const QString getValue(); + + /** + * Sets the current value of brightness + * @param val + */ + void setValue(const QString &val); + + /// retrieve the current brightness + void getBrightness(); + + protected slots: + void updateBrightness(); + void updateValue(int); + void readFromStderr(); + void readFromStdout(); + void readValueFromStdout(); + void procExited(); + + private: + /// process instance used to adjust brightness + QProcess *proc; + + signals: + void valueUpdated(); + + protected: + /// to intercept the Enter key press and direct it to OK button + void keyPressEvent( QKeyEvent * ); + +}; + +#endif |