qtmobility/src/messaging/qmessageaddress.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 8 71781823f776
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    50     \preliminary
    50     \preliminary
    51     \brief The QMessageAddress class provides an interface for a message address.
    51     \brief The QMessageAddress class provides an interface for a message address.
    52 
    52 
    53     \ingroup messaging
    53     \ingroup messaging
    54    
    54    
    55     A message address consists of a recipient string and a type.
    55     A message address consists of an addressee string and a type.
    56 */    
    56 */    
    57 
    57 
    58 /*!
    58 /*!
    59     \enum QMessageAddress::Type
    59     \enum QMessageAddress::Type
    60 
    60 
    61     This enum type is used to describe the type of a message address.
    61     This enum type is used to describe the type of a message address.
    62     
    62     
    63     \value System   A system address.
    63     \value System             A system address.
    64     \value Phone    A telephony address.
    64     \value Phone              A telephony address.
    65     \value Email    An Email, Internet Message Format address.
    65     \value Email              An Email, Internet Message Format address.
    66     \value Xmpp     An XMPP, Extensible Messaging and Presence Protocol address.
    66     \value InstantMessage     An Instant Messaging address.
    67     
    67     
    68     \sa type(), setType()
    68     \sa type(), setType()
    69 */
    69 */
    70 
    70 
    71 /*!
    71 /*!
    76 {
    76 {
    77     d_ptr->type = QMessageAddress::System;
    77     d_ptr->type = QMessageAddress::System;
    78 }
    78 }
    79 
    79 
    80 /*!
    80 /*!
    81     Constructs a message address with the type \a type and the recipient address \a recipient.
    81     Constructs a message address with the given \a type and \a addressee.
    82 */
    82 */
    83 QMessageAddress::QMessageAddress(Type type, const QString &recipient)
    83 QMessageAddress::QMessageAddress(Type type, const QString &addressee)
    84     : d_ptr(new QMessageAddressPrivate(this))
    84     : d_ptr(new QMessageAddressPrivate(this))
    85 {
    85 {
    86     d_ptr->type = type;
    86     d_ptr->type = type;
    87     d_ptr->recipient = recipient;
    87     d_ptr->addressee = addressee;
    88 }
    88 }
    89 
    89 
    90 /*!
    90 /*!
    91     Constructs a copy of \a other.
    91     Constructs a copy of \a other.
    92 */
    92 */
    98 
    98 
    99 /*! \internal */
    99 /*! \internal */
   100 QMessageAddress& QMessageAddress::operator=(const QMessageAddress& other)
   100 QMessageAddress& QMessageAddress::operator=(const QMessageAddress& other)
   101 {
   101 {
   102     if (&other != this) {
   102     if (&other != this) {
   103         d_ptr->recipient = other.d_ptr->recipient;
   103         d_ptr->addressee = other.d_ptr->addressee;
   104         d_ptr->type = other.d_ptr->type;
   104         d_ptr->type = other.d_ptr->type;
   105     }
   105     }
   106 
   106 
   107     return *this;
   107     return *this;
   108 }
   108 }
   117 }
   117 }
   118 
   118 
   119 /*! \internal */
   119 /*! \internal */
   120 bool QMessageAddress::operator==(const QMessageAddress& other) const
   120 bool QMessageAddress::operator==(const QMessageAddress& other) const
   121 {
   121 {
   122     return ((d_ptr->type == other.d_ptr->type) && (d_ptr->recipient == other.d_ptr->recipient));
   122     return ((d_ptr->type == other.d_ptr->type) && (d_ptr->addressee == other.d_ptr->addressee));
   123 }
   123 }
   124 
   124 
   125 /*! \internal */
   125 /*! \internal */
   126 bool QMessageAddress::operator!=(const QMessageAddress& other) const
   126 bool QMessageAddress::operator!=(const QMessageAddress& other) const
   127 {
   127 {
   128     return !operator==(other);
   128     return !operator==(other);
   129 }
   129 }
   130 
   130 
   131 /*!
   131 /*!
   132     Returns the recipient.
   132     Returns the addressee.
   133 
   133 
   134     \sa setRecipient()
   134     \sa setAddressee()
   135 */
   135 */
   136 QString QMessageAddress::recipient() const
   136 QString QMessageAddress::addressee() const
   137 {
   137 {
   138     return d_ptr->recipient;
   138     return d_ptr->addressee;
   139 }
   139 }
   140 
   140 
   141 /*!
   141 /*!
   142     Sets the recipient to \a recipient.
   142     Sets the addressee to \a addressee.
   143 
   143 
   144     \sa recipient()
   144     \sa addressee()
   145 */
   145 */
   146 void QMessageAddress::setRecipient(const QString &recipient)
   146 void QMessageAddress::setAddressee(const QString &addressee)
   147 {
   147 {
   148     d_ptr->recipient = recipient;
   148     d_ptr->addressee = addressee;
   149 }
   149 }
   150 
   150 
   151 /*!
   151 /*!
   152     Returns the type of the message address.
   152     Returns the type of the message address.
   153 
   153