Solid
button.h
Go to the documentation of this file.
00001 /* 00002 Copyright 2006 Davide Bettio <davbet@aliceposta.it> 00003 Copyright 2007 Kevin Ottens <ervin@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) version 3, or any 00009 later version accepted by the membership of KDE e.V. (or its 00010 successor approved by the membership of KDE e.V.), which shall 00011 act as a proxy defined in Section 6 of version 3 of the license. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 #ifndef SOLID_BUTTON_H 00023 #define SOLID_BUTTON_H 00024 00025 #include <solid/solid_export.h> 00026 00027 #include <solid/deviceinterface.h> 00028 00029 namespace Solid 00030 { 00031 class ButtonPrivate; 00032 class Device; 00033 00042 class SOLID_EXPORT Button : public DeviceInterface 00043 { 00044 Q_OBJECT 00045 Q_ENUMS(ButtonType) 00046 Q_PROPERTY(ButtonType type READ type) 00047 Q_PROPERTY(bool hasState READ hasState) 00048 Q_PROPERTY(bool stateValue READ stateValue) 00049 Q_DECLARE_PRIVATE(Button) 00050 friend class Device; 00051 00052 public: 00062 enum ButtonType{ LidButton, PowerButton, SleepButton, UnknownButtonType, TabletButton }; 00063 00064 00065 private: 00074 explicit Button(QObject *backendObject); 00075 00076 public: 00080 virtual ~Button(); 00081 00088 static Type deviceInterfaceType() { return DeviceInterface::Button; } 00089 00096 ButtonType type() const; 00097 00104 bool hasState() const; 00105 00114 bool stateValue() const; 00115 00116 Q_SIGNALS: 00125 void pressed(Solid::Button::ButtonType type, const QString &udi); 00126 }; 00127 } 00128 00129 #endif
KDE 4.6 API Reference