• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Solid

battery.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2006-2007 Kevin Ottens <ervin@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License version 2 as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
00017 
00018 */
00019 
00020 #ifndef SOLID_BATTERY_H
00021 #define SOLID_BATTERY_H
00022 
00023 #include <solid/solid_export.h>
00024 
00025 #include <solid/deviceinterface.h>
00026 
00027 namespace Solid
00028 {
00029     class BatteryPrivate;
00030     class Device;
00031 
00035     class SOLID_EXPORT Battery : public DeviceInterface
00036     {
00037         Q_OBJECT
00038         Q_ENUMS(BatteryType ChargeState)
00039         Q_PROPERTY(bool plugged READ isPlugged)
00040         Q_PROPERTY(BatteryType type READ type)
00041         Q_PROPERTY(int chargePercent READ chargePercent)
00042         Q_PROPERTY(bool rechargeable READ isRechargeable)
00043         Q_PROPERTY(ChargeState chargeState READ chargeState)
00044         Q_DECLARE_PRIVATE(Battery)
00045         friend class Device;
00046 
00047     public:
00060         enum BatteryType { UnknownBattery, PdaBattery, UpsBattery,
00061                            PrimaryBattery, MouseBattery, KeyboardBattery,
00062                            KeyboardMouseBattery, CameraBattery };
00063 
00072         enum ChargeState { NoCharge, Charging, Discharging };
00073 
00074 
00075     private:
00084         explicit Battery(QObject *backendObject);
00085 
00086     public:
00090         virtual ~Battery();
00091 
00092 
00099         static Type deviceInterfaceType() { return DeviceInterface::Battery; }
00100 
00106         bool isPlugged() const;
00107 
00114         BatteryType type() const;
00115 
00116 
00117 
00124         int chargePercent() const;
00125 
00126 
00127 
00133         bool isRechargeable() const;
00134 
00142         ChargeState chargeState() const;
00143 
00144     Q_SIGNALS:
00152         void chargePercentChanged(int value, const QString &udi);
00153 
00163         void chargeStateChanged(int newState, const QString &udi);
00164 
00172         void plugStateChanged(bool newState, const QString &udi);
00173     };
00174 }
00175 
00176 #endif

Solid

Skip menu "Solid"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal