Solid
Solid::Button Class Reference
This device interface is available on button devices. More...
#include <button.h>

Public Types | |
enum | ButtonType { LidButton, PowerButton, SleepButton, UnknownButtonType, TabletButton } |
Signals | |
void | pressed (Solid::Button::ButtonType type, const QString &udi) |
Public Member Functions | |
bool | hasState () const |
bool | stateValue () const |
ButtonType | type () const |
virtual | ~Button () |
Static Public Member Functions | |
static Type | deviceInterfaceType () |
Properties | |
bool | hasState |
bool | stateValue |
ButtonType | type |
Detailed Description
This device interface is available on button devices.
A button is a device, like power button or lid switch, that can be pressed by user. Some buttons can have two states (Enabled/Disabled, On/Off ...), other buttons haven't state.
Definition at line 41 of file button.h.
Member Enumeration Documentation
This enum type defines the type of button.
- LidButton : The switch on a laptop that senses whether the lid is open or closed.
- PowerButton : The main power button on the computer.
- SleepButton : The sleep button on a computer capable of putting the computer into a suspend state.
- TabletButton : The tablet switch on a laptop that senses if the monitor is rotated or not.
- UnknownButtonType : The type of the button is unknow.
Constructor & Destructor Documentation
Solid::Button::~Button | ( | ) | [virtual] |
Destroys a Button object.
Definition at line 34 of file button.cpp.
Member Function Documentation
static Type Solid::Button::deviceInterfaceType | ( | ) | [inline, static] |
Get the Solid::DeviceInterface::Type of the Button device interface.
- Returns:
- the Button device interface type
- See also:
- Solid::DeviceInterface::Type
bool Solid::Button::hasState | ( | ) | const |
Indicates if the button mantains state (Can toggled on/off).
- Returns:
- true if the button maintains state, false otherwise.
- See also:
- stateValue()
void Solid::Button::pressed | ( | Solid::Button::ButtonType | type, | |
const QString & | udi | |||
) | [signal] |
This signal is emitted when the button is pressed.
- Parameters:
-
type the type of button device, it's one of the type Solid::Button::ButtonType
- See also:
- Solid::Button::ButtonType
- Parameters:
-
udi the UDI of the button
bool Solid::Button::stateValue | ( | ) | const |
Retrieves the state of the button.
A button can have two states (Enabled/Disabled, On/Off ...). Available only if hasState is true.
- Returns:
- true if the button is enabled, false otherwise.
- See also:
- hasState()
ButtonType Solid::Button::type | ( | ) | const |
Retrieves the type of button device.
- Returns:
- the type of button device.
- See also:
- Solid::Button::ButtonType
Property Documentation
Solid::Button::ButtonType Solid::Button::type [read] |
The documentation for this class was generated from the following files: