qtmobility/src/multimedia/qmediacontrol.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    49 
    49 
    50 QT_BEGIN_NAMESPACE
    50 QT_BEGIN_NAMESPACE
    51 
    51 
    52 /*!
    52 /*!
    53     \class QMediaControl
    53     \class QMediaControl
    54     \ingroup multimedia-serv
    54     \ingroup multimedia
    55 
    55 
    56     \preliminary
    56     \preliminary
    57     \brief The QMediaControl class provides a base interface for media service controls.
    57     \brief The QMediaControl class provides a base interface for media service controls.
    58 
    58 
    59     Media controls provide an interface to individual features provided by a media service.  Most
    59     Media controls provide an interface to individual features provided by a
    60     services implement a principal control which exposes the core functionality of the service and
    60     media service.  Most services implement a principal control which exposes
    61     a number optional controls which expose any additional functionality.
    61     the core functionality of the service and a number optional controls which
       
    62     expose any additional functionality.
    62 
    63 
    63     A pointer to a control implemented by a media service can be obtained using the
    64     A pointer to a control implemented by a media service can be obtained using
    64     \l {QMediaService::control()}{control()} member of QMediaService.  If the service doesn't
    65     the \l {QMediaService::requestControl()} member of QMediaService.  If the
    65     implement a control it will instead return a null pointer.
    66     service doesn't implement a control it will instead return a null pointer.
    66 
    67 
    67     \code
    68     \code
    68     QMediaPlayerControl *control = qobject_cast<QMediaPlayerControl *>(
    69     QMediaPlayerControl *control = qobject_cast<QMediaPlayerControl *>(
    69             service->control("com.nokia.Qt.QMediaPlayerControl/1.0"));
    70             service->requestControl("com.nokia.Qt.QMediaPlayerControl/1.0"));
    70     \endcode
    71     \endcode
    71 
    72 
    72     Alternatively if the IId of the control has been declared using Q_MEDIA_DECLARE_CONTROL
    73     Alternatively if the IId of the control has been declared using
    73     the template version of QMediaService::control() can be used to request the service without
    74     Q_MEDIA_DECLARE_CONTROL the template version of
       
    75     QMediaService::requestControl() can be used to request the service without
    74     explicitly passing the IId.
    76     explicitly passing the IId.
    75 
    77 
    76     \code
    78     \code
    77     QMediaPlayerControl *control = service->control<QMediaPlayerControl *>();
    79     QMediaPlayerControl *control = service->requestControl<QMediaPlayerControl *>();
    78     \endcode
    80     \endcode
    79 
    81 
    80     Most application code will not interface directly with a media service's controls, instead the
    82     Most application code will not interface directly with a media service's
    81     QMediaObject which owns the service acts as an intermeditary between one or more controls and
    83     controls, instead the QMediaObject which owns the service acts as an
    82     the application.
    84     intermediary between one or more controls and the application.
    83 
    85 
    84     \sa QMediaService, QMediaObject
    86     \sa QMediaService, QMediaObject
    85 */
    87 */
    86 
    88 
    87 /*!
    89 /*!
    88     \macro Q_MEDIA_DECLARE_CONTROL(Class, IId)
    90     \macro Q_MEDIA_DECLARE_CONTROL(Class, IId)
    89     \relates QMediaControl
    91     \relates QMediaControl
    90 
    92 
    91     The Q_MEDIA_DECLARE_CONTROL macro declares an \a IId for a \a Class that inherits from
    93     The Q_MEDIA_DECLARE_CONTROL macro declares an \a IId for a \a Class that
    92     QMediaControl.
    94     inherits from QMediaControl.
    93 
    95 
    94     Declaring an IId for a QMediaControl allows an instance of that control to be requested from
    96     Declaring an IId for a QMediaControl allows an instance of that control to
    95     QMediaService::control() without explicitly passing the IId.
    97     be requested from QMediaService::requestControl() without explicitly
       
    98     passing the IId.
    96 
    99 
    97     \code
   100     \code
    98     QMediaPlayerControl *control = service->control<QMediaPlayerControl *>();
   101     QMediaPlayerControl *control = service->control<QMediaPlayerControl *>();
    99     \endcode
   102     \endcode
   100 
   103 
   101     \sa QMediaService::control()
   104     \sa QMediaService::requestControl()
   102 */
   105 */
   103 
   106 
   104 /*!
   107 /*!
   105     Destroys a media control.
   108     Destroys a media control.
   106 */
   109 */