Public Member Functions | Friends | Related Functions

HDeviceInfo Class Reference
[Common]

This class is used to contain information of a UPnP device found in a UPnP device description document. More...

#include <HDeviceInfo>

List of all members.

Public Member Functions

 HDeviceInfo ()
 HDeviceInfo (const HResourceType &deviceType, const QString &friendlyName, const QString &manufacturer, const QString &modelName, const HUdn &udn, HValidityCheckLevel checkLevel=StrictChecks, QString *err=0)
 HDeviceInfo (const HResourceType &deviceType, const QString &friendlyName, const QString &manufacturer, const QUrl &manufacturerUrl, const QString &modelDescription, const QString &modelName, const QString &modelNumber, const QUrl &modelUrl, const QString &serialNumber, const HUdn &udn, const QString &upc, const QList< QPair< QUrl, QImage > > &icons, const QUrl &presentationUrl, HValidityCheckLevel checkLevel=StrictChecks, QString *err=0)
 ~HDeviceInfo ()
 HDeviceInfo (const HDeviceInfo &other)
HDeviceInfooperator= (const HDeviceInfo &other)
bool isValid (HValidityCheckLevel level) const
void setManufacturerUrl (const QUrl &arg)
void setModelDescription (const QString &arg)
void setModelNumber (const QString &arg)
void setModelUrl (const QUrl &arg)
void setSerialNumber (const QString &arg)
void setUpc (const QString &arg)
void setIcons (const QList< QPair< QUrl, QImage > > &arg)
void setPresentationUrl (const QUrl &arg)
const HResourceTypedeviceType () const
QString friendlyName () const
QString manufacturer () const
QUrl manufacturerUrl () const
QString modelDescription () const
QString modelName () const
QString modelNumber () const
QUrl modelUrl () const
QString serialNumber () const
const HUdnudn () const
QString upc () const
QList< QPair< QUrl, QImage > > icons () const
QUrl presentationUrl () const

Friends

H_UPNP_CORE_EXPORT bool operator== (const HDeviceInfo &obj1, const HDeviceInfo &obj2)

Related Functions

(Note that these are not member functions.)



H_UPNP_CORE_EXPORT bool operator!= (const HDeviceInfo &, const HDeviceInfo &)

Detailed Description

A device description specifies a UPnP device. A device description specifies the services of a device, the embedded devices of a device and other information, such as the manufacturer, model name, serial number and the Unique Device Name that uniquely identifies a device. Instances of this class contain the previously mentioned "other" information found in device description documents.

Remarks:
this class is not thread-safe.
See also:
HDevice, HServiceInfo, HActionInfo and HStateVariableInfo.

Constructor & Destructor Documentation

HDeviceInfo (  ) 

Creates a new, empty instance.

See also:
isValid()
HDeviceInfo ( const HResourceType deviceType,
const QString &  friendlyName,
const QString &  manufacturer,
const QString &  modelName,
const HUdn udn,
HValidityCheckLevel  checkLevel = StrictChecks,
QString *  err = 0 
)

Constructs a new instance from the specified parameters that the UDA specification mandates for a UPnP device.

The parameters the constructor expects are arguments defined in the device description file and they are all mandatory for a valid UPnP device.

Parameters:
deviceType specifies the device type.
friendlyName specifies a short description for the end-user. This cannot be empty and should be less than 64 characters.
manufacturer specifies the name of the manufacturer. This cannot be empty and should be less than 64 characters.
modelName specifies the model name. This cannot be empty and should be less than 32 characters.
udn specifies the unique device name. This is a universally unique identifier for the device, regardless if the device is root or embedded. The specified UDN has to be valid.
checkLevel specifies the level of strictness used in validating the specified arguments. This parameter is optional.
err specifies a pointer to a QString that contains an error description in case the construction failed. This parameter is optional.
Remarks:
in case any of the provided arguments does not meet the specified requirements, the created object is invalid.
See also:
isValid()
HDeviceInfo ( const HResourceType deviceType,
const QString &  friendlyName,
const QString &  manufacturer,
const QUrl &  manufacturerUrl,
const QString &  modelDescription,
const QString &  modelName,
const QString &  modelNumber,
const QUrl &  modelUrl,
const QString &  serialNumber,
const HUdn udn,
const QString &  upc,
const QList< QPair< QUrl, QImage > > &  icons,
const QUrl &  presentationUrl,
HValidityCheckLevel  checkLevel = StrictChecks,
QString *  err = 0 
)

Constructs a new instance from the specified parameters.

These are all the arguments found in the device description file.

Parameters:
deviceType specifies the device type.
friendlyName specifies a short description for the end-user. This cannot be empty and should be less than 64 characters.
manufacturer specifies the name of the manufacturer. This cannot be empty and should be less than 64 characters.
manufacturerUrl specifies the web site for the manufacturer.
modelDescription specifies the long description for the end user. This can be empty and should be less than 128 characters.
modelName specifies the model name. This cannot be empty and should be less than 32 characters.
modelNumber specifies the model number of the device. There is no format specified. This should be less than 32 characters.
modelUrl specifies the web site for the device model.
serialNumber specifies the serial number of the device. No format specified. This should be less than 64 characters.
udn specifies the unique device name. This is a universally unique identifier for the device, regardless if the device is root or embedded. The specified UDN has to be valid.
upc specifies the Universal Product Code, which is 12-digit, all-numeric code that identifies the consumer package. Managed by the Uniform Code Council.
icons specifies the icons of the device, if any.
presentationUrl specifies the URL for HTML-based user interface for controlling and/or viewing device status.
checkLevel specifies the level of strictness used in validating the specified arguments. This parameter is optional.
err specifies a pointer to a QString that contains an error description in case the construction failed. This is optional.
Remarks:
in case any of the provided arguments does not meet the specified requirements, the created object is invalid.
See also:
isValid()
~HDeviceInfo (  ) 

Destroys the instance.

HDeviceInfo ( const HDeviceInfo other  ) 

Copies the contents of the other to this.

Parameters:
other specifies the object to be copied.

Member Function Documentation

HDeviceInfo & operator= ( const HDeviceInfo other  ) 

Assigns the contents of the other to this.

Parameters:
other specifies the object to be copied.
bool isValid ( HValidityCheckLevel  level  )  const

Indicates if the object is valid.

A valid object contains the mandatory data of a device description.

Parameters:
level specifies the level of strictness used in validating the object. This parameter is optional and the default level is strict.
Returns:
true in case the object is valid.
void setManufacturerUrl ( const QUrl &  arg  ) 

Sets the URL for the web site of the manufacturer.

Parameters:
arg specifies the URL for the web site of the manufacturer.
See also:
manufacturerUrl()
void setModelDescription ( const QString &  arg  ) 

Sets the model description.

A model description is used to display a long description for end user. Should be < 128 characters.

Parameters:
arg specifies the model description.
See also:
modelDescription()
void setModelNumber ( const QString &  arg  ) 

Sets the model number.

There is no format specified for the model number, other than it should be < 32 characters.

Parameters:
arg specifies the model number.
See also:
modelNumber()
void setModelUrl ( const QUrl &  arg  ) 

Sets the URL for the web site of the model.

Parameters:
arg specifies the model URL.
See also:
modelUrl()
void setSerialNumber ( const QString &  arg  ) 

Sets the serial number of the device.

There is no format specified for the serial number, other than it should be < 64 characters.

Parameters:
arg specifies the serial number.
See also:
serialNumber()
void setUpc ( const QString &  arg  ) 

Sets the Universal Product Code.

UPC is a 12-digit, all-numeric code that identifies the consumer package. Managed by the Uniform Code Council.

Parameters:
arg specifies the UPC.
See also:
upc()
void setIcons ( const QList< QPair< QUrl, QImage > > &  arg  ) 

Sets the icons of the device.

Parameters:
arg specifies the icons of the device.
See also:
icons()
void setPresentationUrl ( const QUrl &  arg  ) 

Sets the presentation URL.

Presentation URL specifies the URL for HTML-based user interface for controlling and/or viewing device status.

Parameters:
arg specifies the presentation URL.
See also:
presentationUrl()
const HResourceType & deviceType (  )  const

Returns the type of the device found in the device description file.

Returns:
the type of the device found in the device description file.
QString friendlyName (  )  const

Returns short description for end user.

Returns:
short description for end user.
QString manufacturer (  )  const

Returns manufacturer's name.

Returns:
manufacturer's name.
QUrl manufacturerUrl (  )  const

Returns the manufacturer's web site.

Returns:
the manufacturer's web site.
See also:
setManufacturerUrl()
QString modelDescription (  )  const

Returns long description for end user.

Returns:
long description for end user.
See also:
setModelDescription()
QString modelName (  )  const

Returns the model name.

Returns:
the model name.
QString modelNumber (  )  const

Returns the model number.

Returns:
the model number.
See also:
setModelNumber()
QUrl modelUrl (  )  const

Returns the web site for the device model.

Returns:
the web site for the device model.
See also:
setModelUrl()
QString serialNumber (  )  const

Returns the serial number.

Returns:
the serial number.
See also:
setSerialNumber()
const HUdn & udn (  )  const

Returns the Unique Device Name.

Returns:
Universally-unique identifier for the device, whether root or embedded.
Remarks:
the UDN is same over time for a specific device instance.
QString upc (  )  const

Returns the Universal Product Code.

Returns:
the Universal Product Code.
See also:
setUpc()
QList< QPair< QUrl, QImage > > icons (  )  const

Returns the icons of the device, if any.

Returns:
the icons of the device.
See also:
setIcons()
QUrl presentationUrl (  )  const

Returns the location of the device's presentation page.

Returns:
the location of the device's presentation page.
See also:
setPresentationUrl()

Friends And Related Function Documentation

H_UPNP_CORE_EXPORT bool operator== ( const HDeviceInfo obj1,
const HDeviceInfo obj2 
) [friend]

Compares the two objects for equality.

Returns:
true in case the objects are logically equivalent.
H_UPNP_CORE_EXPORT bool operator!= ( const HDeviceInfo ,
const HDeviceInfo  
) [related]

Compares the two objects for inequality.

Returns:
true in case the objects are not logically equivalent.