You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
klcddimmer/src/brightnesschooserimpl.h

83 lines
2.7 KiB

/***************************************************************************
* 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