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:
00061 enum ButtonType{ LidButton, PowerButton, SleepButton, UnknownButtonType, TabletButton };
00062
00063
00064 private:
00073 explicit Button(QObject *backendObject);
00074
00075 public:
00079 virtual ~Button();
00080
00087 static Type deviceInterfaceType() { return DeviceInterface::Button; }
00088
00095 ButtonType type() const;
00096
00103 bool hasState() const;
00104
00113 bool stateValue() const;
00114
00115 Q_SIGNALS:
00124 void pressed(Solid::Button::ButtonType type, const QString &udi);
00125 };
00126 }
00127
00128 #endif