# class GenericInterface

###

Module | solid
Namespace | Solid
Class | GenericInterface
Inherits | Solid::DeviceInterface

Generic interface to deal with a device. It exposes a set of properties and is organized a a key/value set.

Warning: Using this class could expose some backend specific details and lead to non portable code. Use it at your own risk, or during transitional phases when the provided device interfaces don't provide the necessary methods.

### enums

- PropertyChange { PropertyModified, PropertyAdded, PropertyRemoved }

enum details

### methods

- GenericInterface (backendObject)

  returns ctor
  Not implemented
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  backendObject | QObject |

  Creates a new GenericInterface object. You generally won't need this. It's created when necessary using Device.as().

  backendObject - the device interface object provided by the backend

  See also Solid.Device.as()

- GenericInterface (a0)

  returns ctor
  Not implemented
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QObject |

- allProperties ( )

  returns QMap<QString,QVariant>

  Retrieves a key/value map of all the known properties for the device.

  Warning: Using this method could expose some backend specific details and lead to non portable code. Use it at your own risk, or during transitional phases when the provided device interfaces don't provide the necessary methods.

  Returns all the properties of the device

- conditionRaised (condition, reason)

  returns Nothing
  SIGNAL ("conditionRaised (const QString&, const QString&)")

  Argument | Type | Default
  --- | --- | ---
  condition | QString |
  reason | QString |

  This signal is emitted when an event occurred in the device. For example when a button is pressed.

  condition - the condition name

  reason - a message explaining why the condition has been raised

- deviceInterfaceType ( )

  returns Solid::DeviceInterface.Type
  static

  Get the Solid.DeviceInterface.Type of the GenericInterface device interface.

  Returns the Processor device interface type

  See also Solid.Ifaces.Enums.DeviceInterface.Type

- property (key)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Retrieves a property of the device.

  Warning: Using this method could expose some backend specific details and lead to non portable code. Use it at your own risk, or during transitional phases when the provided device interfaces don't provide the necessary methods.

  key - the property key Returns the actual value of the property, or QVariant() if the property is unknown

- propertyChanged (changes)

  returns Nothing
  Not implemented SIGNAL ("propertyChanged (const QMap<QString,int>&)")

  Argument | Type | Default
  --- | --- | ---
  changes | QMap<QString,int> |

  This signal is emitted when a property is changed in the device.

  changes - the map describing the property changes that occurred in the device, keys are property name and values describe the kind of change done on the device property (added/removed/modified), it's one of the type Solid.Device.PropertyChange

- propertyExists (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Tests if a property exist in the device.

  Warning: Using this method could expose some backend specific details and lead to non portable code. Use it at your own risk, or during transitional phases when the provided device interfaces don't provide the necessary methods.

  key - the property key Returns true if the property is available in the device, false otherwise

### enums - detail

- PropertyChange { PropertyModified, PropertyAdded, PropertyRemoved }

  This enum type defines the type of change that can occur to a GenericInterface property.

  - PropertyModified : A property value has changed in the device - PropertyAdded : A new property has been added to the device - PropertyRemoved : A property has been removed from the device

  | PropertyModified | - | - |
  | PropertyAdded | - | - |
  | PropertyRemoved | - | - |