smf/smfservermodule/smfserver/datastoremgr/smfUserProfile.cpp
changeset 7 be09cf1f39dd
equal deleted inserted replaced
6:c39a6cfd1fb9 7:be09cf1f39dd
       
     1 /*!	\file
       
     2         \brief File containing implementation for SMFUserProfile class.
       
     3 
       
     4         Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     5         All rights reserved.
       
     6         This component and the accompanying materials are made available
       
     7         under the terms of the "{License}"
       
     8         which accompanies  this distribution, and is available
       
     9         at the URL "{LicenseUrl}".
       
    10 
       
    11         \author Jaspinder Singh, Sasken Communication Technologies Ltd - Initial contribution
       
    12 
       
    13         \version 0.1
       
    14 
       
    15 */
       
    16 
       
    17 #include "smfUserProfile.h"
       
    18 
       
    19 //! \fn SMFUserProfile(const QString&, const QString& , QObject*)
       
    20 /*!
       
    21     \brief  Constructor for the class SMFUserProfile
       
    22     \param  name Reference to the name of the user/person whom this profile identifies.
       
    23     \param  contact_id Reference to the contact ID of the user/person whom this profile identifies.
       
    24     \param  parent Pointer to a parent object.
       
    25 */
       
    26 SMFUserProfile::SMFUserProfile(const QString &name, const QString &contact_id, QObject *parent):QObject(parent){
       
    27     setName(name);
       
    28     setContactID(contact_id);
       
    29     setUserID(-1);  // Set as negative to indicate that this is not yet stored in the database.
       
    30 }
       
    31 
       
    32 
       
    33 //! \fn ~SMFUserProfile()
       
    34 /*!
       
    35     \brief Destructor for the class SMFUserProfile
       
    36 */
       
    37 SMFUserProfile::~SMFUserProfile(){
       
    38     // EMpty
       
    39 }
       
    40 
       
    41 
       
    42 //! \fn int userID() const
       
    43 /*!
       
    44     \brief  Gets the user ID of this profile.
       
    45     \return Integer User ID of this profile. -1 if not assigned a user id yet.
       
    46 */
       
    47 int SMFUserProfile::userID() const{
       
    48     return m_user_id;
       
    49 }
       
    50 
       
    51 
       
    52 //! \fn const QString& name() const
       
    53 /*!
       
    54     \brief Gets the name of user/person whom this profile identifies.
       
    55     \return A const reference to the name of the user/person whom this profile identifies.
       
    56     \sa setName()
       
    57 */
       
    58 const QString& SMFUserProfile::name() const {
       
    59     return m_name;
       
    60 }
       
    61 
       
    62 
       
    63 //! \fn const QString& contactID() const
       
    64 /*!
       
    65     \brief Gets the contact ID of the user/person whom this profile identifies.
       
    66     \return A const reference to the contact ID of the user/person whom this profile identifies.
       
    67     \sa setContactID()
       
    68 */
       
    69 const QString& SMFUserProfile::contactID() const{
       
    70     return m_contact_id;
       
    71 }
       
    72 
       
    73 
       
    74 //! \fn void setName(const QString&)
       
    75 /*!
       
    76     \brief Sets the name of user/person whom this profile identifies.
       
    77     \param name A const reference to the name of the social networking site
       
    78     \sa name()
       
    79 */
       
    80 void SMFUserProfile::setName(const QString& name){
       
    81     m_name = name;
       
    82 }
       
    83 
       
    84 
       
    85 //! \fn void setContactID(const QString&)
       
    86 /*!
       
    87     \brief  Sets the contact ID of the user/person whom this profile identifies.
       
    88     \param  contact_id A const reference to the contact ID of the user/person whom this profile identifies.
       
    89     \sa contactID()
       
    90 */
       
    91 void SMFUserProfile::setContactID(const QString& contact_id){
       
    92     m_contact_id = contact_id;
       
    93 }
       
    94 
       
    95 
       
    96 //! \fn void setUserID(int)
       
    97 /*!
       
    98     \brief  Sets the user ID of this profile.
       
    99     \param  id An integer user ID of this profile.
       
   100     \sa userID()
       
   101 */
       
   102 void SMFUserProfile::setUserID(int id){
       
   103     m_user_id = id;
       
   104 }