qtmobility/src/contacts/requests/qcontactrelationshipremoverequest.cpp
changeset 1 2b40d63a9c3d
child 4 90517678cc4f
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include "qcontactrelationshipremoverequest.h"
       
    43 #include "qcontactrequests_p.h"
       
    44 
       
    45 QTM_BEGIN_NAMESPACE
       
    46 
       
    47 /*!
       
    48   \class QContactRelationshipRemoveRequest
       
    49 
       
    50   \brief The QContactRelationshipRemoveRequest class allows a client
       
    51   to asynchronously request that certain relationships be removed from
       
    52   a contacts store.
       
    53 
       
    54   For a QContactRelationshipRemoveRequest, the resultsUpdated() signal will be emitted when
       
    55   the individual item errors (which may be retrieved by calling errorMap()) are updated, or if the overall
       
    56   operation error (which may be retrieved by calling error()) is updated.
       
    57 
       
    58   \ingroup contacts-requests
       
    59  */
       
    60 
       
    61 /*! Constructs a new relationship remove request */
       
    62 QContactRelationshipRemoveRequest::QContactRelationshipRemoveRequest()
       
    63     : QContactAbstractRequest(new QContactRelationshipRemoveRequestPrivate)
       
    64 {
       
    65 }
       
    66 
       
    67 /*! Cleans up the memory in use by this relationship remove request */
       
    68 QContactRelationshipRemoveRequest::~QContactRelationshipRemoveRequest()
       
    69 {
       
    70 }
       
    71 
       
    72 /*!
       
    73   \internal
       
    74    Sets the first contact criterion of the remove request to \a firstId.
       
    75    If \a firstId is the default-constructed id, or the first contact is not set,
       
    76    the request will remove relationships involving any first contact.
       
    77 
       
    78    This function is obsolete; set the list of relationships to remove by calling setRelationships() instead.
       
    79  */
       
    80 void QContactRelationshipRemoveRequest::setFirst(const QContactId& firstId)
       
    81 {
       
    82     Q_D(QContactRelationshipRemoveRequest);
       
    83     d->m_first = firstId;
       
    84 }
       
    85 
       
    86 /*!
       
    87   \internal
       
    88   Returns the first contact criterion of the remove request.
       
    89   This function is obsolete; retrieve the lists of relationships that will be removed by calling relationships() instead.
       
    90  */
       
    91 QContactId QContactRelationshipRemoveRequest::first() const
       
    92 {
       
    93     Q_D(const QContactRelationshipRemoveRequest);
       
    94     return d->m_first;
       
    95 }
       
    96 
       
    97 /*!
       
    98   \internal
       
    99    Sets the relationship type criterion of the remove request to \a relationshipType.
       
   100    If \a relationshipType is empty, or the relationship type is not set,
       
   101    the request will remove relationships of any type.
       
   102 
       
   103    This function is obsolete; set the list of relationships to remove by calling setRelationships() instead.
       
   104  */
       
   105 void QContactRelationshipRemoveRequest::setRelationshipType(const QString& relationshipType)
       
   106 {
       
   107     Q_D(QContactRelationshipRemoveRequest);
       
   108     d->m_relationshipType = relationshipType;
       
   109 }
       
   110 
       
   111 /*!
       
   112   \internal
       
   113   Returns the relationship type criterion of the fetch request.
       
   114   This function is obsolete; retrieve the lists of relationships that will be removed by calling relationships() instead.
       
   115  */
       
   116 QString QContactRelationshipRemoveRequest::relationshipType() const
       
   117 {
       
   118     Q_D(const QContactRelationshipRemoveRequest);
       
   119     return d->m_relationshipType;
       
   120 }
       
   121 
       
   122 /*!
       
   123   \internal
       
   124   Sets the second contact criterion of the remove request to \a secondId.
       
   125   If \a secondId is the default-constructed id, or the second contact is not set,
       
   126   the request will remove relationships involving any second contact.
       
   127 
       
   128    This function is obsolete; set the list of relationships to remove by calling setRelationships() instead.
       
   129  */
       
   130 void QContactRelationshipRemoveRequest::setSecond(const QContactId& secondId)
       
   131 {
       
   132     Q_D(QContactRelationshipRemoveRequest);
       
   133     d->m_second = secondId;
       
   134 }
       
   135 
       
   136 /*!
       
   137   \internal
       
   138   Returns the second contact criterion of the remove request.
       
   139   This function is obsolete; retrieve the lists of relationships that will be removed by calling relationships() instead.
       
   140  */
       
   141 QContactId QContactRelationshipRemoveRequest::second() const
       
   142 {
       
   143     Q_D(const QContactRelationshipRemoveRequest);
       
   144     return d->m_second;
       
   145 }
       
   146 
       
   147 /*! Sets the list of relationships which will be removed to \a relationships */
       
   148 void QContactRelationshipRemoveRequest::setRelationships(const QList<QContactRelationship>& relationships)
       
   149 {
       
   150     Q_D(QContactRelationshipRemoveRequest);
       
   151     d->m_relationships = relationships;
       
   152 }
       
   153 
       
   154 /*! Returns the list of relationships which will be removed */
       
   155 QList<QContactRelationship> QContactRelationshipRemoveRequest::relationships() const
       
   156 {
       
   157     Q_D(const QContactRelationshipRemoveRequest);
       
   158     return d->m_relationships;
       
   159 }
       
   160 
       
   161 /*! Returns the map of input contact list indices to errors which occurred */
       
   162 QMap<int, QContactManager::Error> QContactRelationshipRemoveRequest::errorMap() const
       
   163 {
       
   164     Q_D(const QContactRelationshipRemoveRequest);
       
   165     return d->m_errors;
       
   166 }
       
   167 
       
   168 #include "moc_qcontactrelationshipremoverequest.cpp"
       
   169 
       
   170 QTM_END_NAMESPACE