Solid
button.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SOLID_BUTTON_H
00022 #define SOLID_BUTTON_H
00023
00024 #include <solid/solid_export.h>
00025
00026 #include <solid/deviceinterface.h>
00027
00028 namespace Solid
00029 {
00030 class ButtonPrivate;
00031 class Device;
00032
00041 class SOLID_EXPORT Button : public DeviceInterface
00042 {
00043 Q_OBJECT
00044 Q_ENUMS(ButtonType)
00045 Q_PROPERTY(ButtonType type READ type)
00046 Q_PROPERTY(bool hasState READ hasState)
00047 Q_PROPERTY(bool stateValue READ stateValue)
00048 Q_DECLARE_PRIVATE(Button)
00049 friend class Device;
00050
00051 public:
00060 enum ButtonType{ LidButton, PowerButton, SleepButton, UnknownButtonType };
00061
00062
00063 private:
00072 explicit Button(QObject *backendObject);
00073
00074 public:
00078 virtual ~Button();
00079
00086 static Type deviceInterfaceType() { return DeviceInterface::Button; }
00087
00094 ButtonType type() const;
00095
00102 bool hasState() const;
00103
00112 bool stateValue() const;
00113
00114 Q_SIGNALS:
00123 void pressed(Solid::Button::ButtonType type, const QString &udi);
00124 };
00125 }
00126
00127 #endif