Herqq
Public Member Functions | Protected Member Functions

HControlPointConfiguration Class Reference

Class for specifying initialization information to HControlPoint instances. More...

#include <HControlPointConfiguration>

Inheritance diagram for HControlPointConfiguration:
HClonable

List of all members.

Public Member Functions

 HControlPointConfiguration ()
virtual ~HControlPointConfiguration ()
virtual
HControlPointConfiguration
clone () const
bool subscribeToEvents () const
qint32 desiredSubscriptionTimeout () const
bool autoDiscovery () const
QList< QHostAddress > networkAddressesToUse () const
void setSubscribeToEvents (bool subscribeAutomatically)
void setDesiredSubscriptionTimeout (qint32 timeout)
void setAutoDiscovery (bool arg)
bool setNetworkAddressesToUse (const QList< QHostAddress > &addresses)

Protected Member Functions

virtual void doClone (HClonable *target) const
virtual
HControlPointConfiguration
newInstance () const

Detailed Description

Class for specifying initialization information to HControlPoint instances.

This class is used to pass initialization information for HControlPoint instances. The use of this is optional and an HControlPoint instance is perfectly functional with the default configuration.

However, you can configure an HControlPoint in following ways:

See also:
HControlPoint
Remarks:
This class is not thread-safe.

Constructor & Destructor Documentation

Creates a new instance.

Creates a new instance with default values.

Destroys the instance.


Member Function Documentation

void doClone ( HClonable target) const [protected, virtual]

Clones the contents of this to the target object.

Every derived class that introduces member variables that should be copied as part of a cloning operation should override this method. The implementation should be something along these lines:

 void MyClonable::doClone(HClonable* target) const
 {
    MyClonable* myClonable = dynamic_cast<MyClonable*>(target);
    if (!myClonable)
    {
        return;
    }

    BaseClassOfMyClonable::doClone(target);

    // copy the variables introduced in *this* MyClonable
    // instance to "myClonable".
 }
Parameters:
targetspecifies the target object to which the contents of this instance are cloned.

Reimplemented from HClonable.

HControlPointConfiguration * newInstance ( ) const [protected, virtual]

Creates a new instance.

This method is used as part of object cloning. Because of that, it is important that every concrete (non-abstract) descendant class overrides this method regardless of the type location in the inheritance tree:

 MyClonable* MyClonable::newInstance() const
 {
     return new MyClonable();
 }
Remarks:
  • the object has to be heap-allocated and
  • the ownership of the object is passed to the caller.

Implements HClonable.

HControlPointConfiguration * clone ( ) const [virtual]

Returns a deep copy of the instance.

Returns:
a deep copy of the instance.
Remarks:
  • the ownership of the returned object is transferred to the caller.

Reimplemented from HClonable.

bool subscribeToEvents ( ) const

Indicates whether to automatically subscribe to all events on all services of a device when a new device is added into the control of an HControlPoint.

Returns:
true in case the HControlPoint instance should subscribe to all events of all services of a newly added device.
See also:
setSubscribeToEvents()
qint32 desiredSubscriptionTimeout ( ) const

Returns the subscription timeout a control point requests when it subscribes to an evented service.

The default value is 30 minutes.

Returns:
The subscription timeout in seconds a control point requests when it subscribes to an evented service.
See also:
setDesiredSubscriptionTimeout()
bool autoDiscovery ( ) const

Indicates whether the control point should perform discovery upon initialization.

Returns:
true in case the the control point should perform discovery upon initialization. This is the default value.
Remarks:
if the discovery is not performed the control point will be unaware of UPnP devices that are already active in the network until they re-advertise themselves.
See also:
setAutoDiscovery()
QList< QHostAddress > networkAddressesToUse ( ) const

Returns the network addresses a control point should use in its operations.

Returns:
The network addresses a control point should use in its operations.
See also:
setNetworkAddressesToUse()
void setSubscribeToEvents ( bool  subscribeAutomatically)

Defines whether a control point should automatically subscribe to all events on all services of a device when a new device is added into the control of an HControlPoint.

Parameters:
subscribeAutomaticallywhen true an HControlPoint instance should by default subscribe to all events of all services of a newly added device.
See also:
subscribeToEvents()
void setDesiredSubscriptionTimeout ( qint32  timeout)

Sets the subscription timeout a control point requests when it subscribes to an evented service.

Values less than or equal to zero are rejected and instead the default value is used. The default value is 30 minutes.

Parameters:
timeoutspecifies the requested timeout in seconds.
See also:
desiredSubscriptionTimeout()
void setAutoDiscovery ( bool  arg)

Defines whether the control point should perform discovery upon initialization.

Parameters:
argwhen true an HControlPoint instance will perform discovery when it is initialized. This is the default.
Remarks:
if the discovery is not performed the control point will be unaware of UPnP devices that are already active in the network until they re-advertise themselves.
See also:
autoDiscovery()
bool setNetworkAddressesToUse ( const QList< QHostAddress > &  addresses)

Defines the network addresses the control point should use in its operations.

Parameters:
addressesspecifies the network addresses the control point should use in its operations.
Returns:
true in case the provided addresses are valid and can be used.
See also:
networkAddressesToUse()