qtmobility/src/contacts/requests/qcontactdetaildefinitionremoverequest.cpp
changeset 5 453da2cfceef
parent 4 90517678cc4f
child 11 06b8e2af4411
equal deleted inserted replaced
4:90517678cc4f 5:453da2cfceef
    55   operation error (which may be retrieved by calling error()) is updated.
    55   operation error (which may be retrieved by calling error()) is updated.
    56   
    56   
    57   \ingroup contacts-requests
    57   \ingroup contacts-requests
    58  */
    58  */
    59 
    59 
    60 /*! Constructs a new detail definition remove request */
    60 /*! Constructs a new detail definition remove request whose parent is the specified \a parent */
    61 QContactDetailDefinitionRemoveRequest::QContactDetailDefinitionRemoveRequest()
    61 QContactDetailDefinitionRemoveRequest::QContactDetailDefinitionRemoveRequest(QObject* parent)
    62     : QContactAbstractRequest(new QContactDetailDefinitionRemoveRequestPrivate)
    62     : QContactAbstractRequest(new QContactDetailDefinitionRemoveRequestPrivate, parent)
    63 {
    63 {
    64 }
    64 }
    65 
    65 
    66 /*!
    66 /*!
    67   Sets the type of contact for which detail definitions should be removed to \a contactType, and the names of the detail definitions to remove from the manager to \a names.
    67   Sets the name of the detail definition to remove from the manager to \a definitionName.
    68   Managers may store different definitions which are valid for different contact types, and so attempting to remove definitions with certain names may fail if no such
    68   Managers may store different definitions which are valid for different contact types, and so attempting to remove definitions with certain names may fail if no such
    69   definitions exist for contacts of the given contact type, or if \a contactType is empty.
    69   definitions exist for contacts of the given contact type, specified via setContactType().
       
    70   Equivalent to calling:
       
    71   \code
       
    72       setDefinitionNames(QStringList(definitionName));
       
    73   \endcode
       
    74 
       
    75   \sa setContactType()
    70  */
    76  */
    71 void QContactDetailDefinitionRemoveRequest::setDefinitionNames(const QString& contactType, const QStringList& names)
    77 void QContactDetailDefinitionRemoveRequest::setDefinitionName(const QString& definitionName)
    72 {
    78 {
    73     Q_D(QContactDetailDefinitionRemoveRequest);
    79     Q_D(QContactDetailDefinitionRemoveRequest);
    74     d->m_contactType = contactType;
    80     d->m_names.clear();
       
    81     d->m_names.append(definitionName);
       
    82 }
       
    83 
       
    84 /*!
       
    85   Sets the names of the detail definitions to remove from the manager to \a names.
       
    86   Managers may store different definitions which are valid for different contact types, and so attempting to remove definitions with certain names may fail if no such
       
    87   definitions exist for contacts of the given contact type, specified via setContactType().
       
    88   \sa setContactType()
       
    89  */
       
    90 void QContactDetailDefinitionRemoveRequest::setDefinitionNames(const QStringList& names)
       
    91 {
       
    92     Q_D(QContactDetailDefinitionRemoveRequest);
    75     d->m_names = names;
    93     d->m_names = names;
    76 }
    94 }
    77 
    95 
    78 /*! Returns the list of names of the detail definitions that will be removed from the manager */
    96 /*! Returns the list of names of the detail definitions that will be removed from the manager */
    79 QStringList QContactDetailDefinitionRemoveRequest::definitionNames() const
    97 QStringList QContactDetailDefinitionRemoveRequest::definitionNames() const
    80 {
    98 {
    81     Q_D(const QContactDetailDefinitionRemoveRequest);
    99     Q_D(const QContactDetailDefinitionRemoveRequest);
    82     return d->m_names;
   100     return d->m_names;
       
   101 }
       
   102 
       
   103 /*!
       
   104   Sets the type of contact for which detail definitions should be removed to \a contactType
       
   105  */
       
   106 void QContactDetailDefinitionRemoveRequest::setContactType(const QString& contactType)
       
   107 {
       
   108     Q_D(QContactDetailDefinitionRemoveRequest);
       
   109     d->m_contactType = contactType;
    83 }
   110 }
    84 
   111 
    85 /*! Returns the type of contact for which detail definitions will be removed */
   112 /*! Returns the type of contact for which detail definitions will be removed */
    86 QString QContactDetailDefinitionRemoveRequest::contactType() const
   113 QString QContactDetailDefinitionRemoveRequest::contactType() const
    87 {
   114 {