From 2bda8f7717adf28da4af0d34fb82f63d2868c31d Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmilo/kmilo_kvaio/kvaio.h | 113 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 kmilo/kmilo_kvaio/kvaio.h (limited to 'kmilo/kmilo_kvaio/kvaio.h') diff --git a/kmilo/kmilo_kvaio/kvaio.h b/kmilo/kmilo_kvaio/kvaio.h new file mode 100644 index 0000000..c16f27e --- /dev/null +++ b/kmilo/kmilo_kvaio/kvaio.h @@ -0,0 +1,113 @@ +/* -*- C++ -*- + + This file declares the KVaio class. + + $ Author: Mirko Boehm $ + $ Copyright: (C) 1996-2003, Mirko Boehm $ + $ Contact: mirko@kde.org + http://www.kde.org + http://www.hackerbuero.org $ + $ License: LGPL with the following explicit clarification: + This code may be linked against any version of the Qt toolkit + from Troll Tech, Norway. $ + + $Id$ + + * Portions of this code are + * (C) 2001-2002 Stelian Pop and + * (C) 2001-2002 Alcove . + * Thanks to Stelian for the implementation of the sonypi driver. +*/ + +#ifndef _KVAIO_H +#define _KVAIO_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include +#include +#include +#include "kvaiodriverinterface.h" +#include "monitor.h" +#include "kmilo_kvaio.h" + +extern "C" { +#include +//#include +} + +class KVaio; +class KMiloKVaio; + +/** + * @short KVaio class + * This class provides an interface between the Vaio driver and the + * respective application (either the kmilod module or a single + * application). + * This class provides the application of the events created by the + * KVaioDriverInterface class. + * @author Mirko Boehm + * @version 0.2 + */ +class KVaio : public QObject +{ + Q_OBJECT +public: +// KVaio(QObject *parent = 0, const char *name =0); + KVaio(KMiloKVaio *parent = 0, const char *name =0); + + virtual ~KVaio(); + const KVaioDriverInterface *driver(); + void loadConfiguration(KConfig *); + const int progress() { return m_progress; } + +protected: + KVaioDriverInterface *mDriver; + Display *mDisp; + DCOPClient mClient; + bool isKScreensaverAvailable(); + bool isKMiloDAvailable(); + bool showTextMsg(const QString& msg); + bool showProgressMsg(const QString& msg, int progress); + bool showBatteryStatus ( bool force = false); +protected slots: + void slotVaioEvent(int); + void slotTimeout(); +public slots: + void blankScreen(); + void suspendToDisk(); + void BrightnessUp(int step); + void BrightnessDown(int step); + void VolumeUp(int step); + void VolumeDown(int step); + void mute(); +private: + bool retrieveMute(); + bool retrieveVolume(); + void displayVolume(); + + KMiloKVaio *myparent; + + DCOPRef *kmixClient, *kmixWindow; + + int m_progress; + int m_volume, m_oldVolume, m_brightness; + bool m_mute; + + int m_maxVolume, m_minVolume; + int m_maxBright, m_minBright; + + int m_VolumeStep; + int m_BrightnessStep; + + bool mReportUnknownEvents; + bool mReportPowerStatus; + bool mShowPowerStatusOnBackButton; + QTimer *mTimer; +}; + +#endif // _KVAIO_H -- cgit v1.2.1