messagingapp/msgappfw/server/src/ccsconversationcontact.cpp
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 37 518b245aa84c
child 47 5b14749788d7
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
    40 // Two phase construction
    40 // Two phase construction
    41 // ----------------------------------------------------------------------------
    41 // ----------------------------------------------------------------------------
    42 void
    42 void
    43 CCsConversationContact::ConstructL()
    43 CCsConversationContact::ConstructL()
    44     {
    44     {
    45     iFirstName = NULL;
    45     iDisplayName = NULL;
    46     iLastName = NULL;
       
    47     iNickName = NULL;
       
    48     iContactId = KErrNotFound;
    46     iContactId = KErrNotFound;
    49     iPhoneNumberList = new (ELeave) RPointerArray<HBufC> ();
    47     iPhoneNumberList = new (ELeave) RPointerArray<HBufC> ();
    50     }
    48     }
    51 
    49 
    52 // ----------------------------------------------------------------------------
    50 // ----------------------------------------------------------------------------
    67 // CCsConversationContact::~CCsConversationContact
    65 // CCsConversationContact::~CCsConversationContact
    68 // Destructor
    66 // Destructor
    69 // ----------------------------------------------------------------------------
    67 // ----------------------------------------------------------------------------
    70 CCsConversationContact::~CCsConversationContact()
    68 CCsConversationContact::~CCsConversationContact()
    71     {
    69     {
    72     if(iFirstName)
    70     if(iDisplayName)
    73         {
    71         {
    74         delete iFirstName;
    72         delete iDisplayName;
    75         iFirstName = NULL;
    73         iDisplayName = NULL;
    76         }
       
    77 
       
    78     if(iLastName)
       
    79         {
       
    80         delete iLastName;
       
    81         iLastName = NULL;
       
    82         }
       
    83     
       
    84     if(iNickName)
       
    85         {
       
    86         delete iNickName;
       
    87         iNickName = NULL;
       
    88         }
    74         }
    89 
    75 
    90     if (iPhoneNumberList)
    76     if (iPhoneNumberList)
    91         {
    77         {
    92         iPhoneNumberList->ResetAndDestroy();
    78         iPhoneNumberList->ResetAndDestroy();
    95         iPhoneNumberList = NULL;
    81         iPhoneNumberList = NULL;
    96         }
    82         }
    97     }
    83     }
    98 
    84 
    99 // ----------------------------------------------------------------------------
    85 // ----------------------------------------------------------------------------
   100 // CCsConversationContact::GetFirstName
    86 // CCsConversationContact::GetDisplayName
   101 // get the first name of the conversation
    87 // get the display name of the conversation
   102 // ----------------------------------------------------------------------------
    88 // ----------------------------------------------------------------------------
   103 HBufC*
    89 HBufC*
   104 CCsConversationContact::GetFirstName() const
    90 CCsConversationContact::GetDisplayName() const
   105     {
    91     {
   106     return iFirstName;
    92     return iDisplayName;
   107     }
    93     }
   108 
    94 
   109 // ----------------------------------------------------------------------------
    95 // ----------------------------------------------------------------------------
   110 // CCsConversationContact::GetLastName
    96 // CCsConversationContact::SetDisplayNameL
   111 // get the last name of the conversation
    97 // Sets the display name of the conversation
   112 // ----------------------------------------------------------------------------
    98 // ----------------------------------------------------------------------------
   113 HBufC*
    99 void
   114 CCsConversationContact::GetLastName() const
   100 CCsConversationContact::SetDisplayNameL(
   115     {
   101         const TDesC& aDisplayName)
   116     return iLastName;
   102     {
   117     }
   103     if( &aDisplayName )
   118 
   104         {
   119 // ----------------------------------------------------------------------------
   105         TRAPD(error, iDisplayName = aDisplayName.AllocL());
   120 // CCsConversationContact::GetNickName
       
   121 // get the nick name of the conversation
       
   122 // ----------------------------------------------------------------------------
       
   123 HBufC*
       
   124 CCsConversationContact::GetNickName() const
       
   125     {
       
   126     return iNickName;
       
   127     }
       
   128 
       
   129 // ----------------------------------------------------------------------------
       
   130 // CCsConversationContact::SetFirstNameL
       
   131 // Sets the first name of the conversation
       
   132 // ----------------------------------------------------------------------------
       
   133 void
       
   134 CCsConversationContact::SetFirstNameL(
       
   135         const TDesC& aFirstName)
       
   136     {
       
   137     if( &aFirstName )
       
   138         {
       
   139         TRAPD(error, iFirstName = aFirstName.AllocL());
       
   140         if(error != KErrNone)
   106         if(error != KErrNone)
   141             {
   107             {
   142             // handle error
   108             // handle error
   143             // call panic
   109             // call panic
   144             PRINT1 ( _L("CCsConversationContact::SetFirstNameL - Error:%d"),
   110             PRINT1 ( _L("CCsConversationContact::SetFirstNameL - Error:%d"),
   145                     error );
   111                     error );
   146             }
   112             }
   147         }
   113         }
   148     }
   114     }
   149 
   115 
   150 // ----------------------------------------------------------------------------
       
   151 // CCsConversationContact::SetLastNameL
       
   152 // Sets the first name of the conversation
       
   153 // ----------------------------------------------------------------------------
       
   154 void
       
   155 CCsConversationContact::SetLastNameL(
       
   156         const TDesC& aLastName)
       
   157     {
       
   158     if( &aLastName )
       
   159         {
       
   160         TRAPD(error, iLastName = aLastName.AllocL());
       
   161         if(error != KErrNone)
       
   162             {
       
   163             // handle error
       
   164             // call panic
       
   165             PRINT1 ( _L("CCsConversationContact::SetLastNameL - Error:%d"),
       
   166                     error );
       
   167             }
       
   168         }
       
   169     }
       
   170 
       
   171 // ----------------------------------------------------------------------------
       
   172 // CCsConversationContact::SetNickNameL
       
   173 // Sets the first name of the conversation
       
   174 // ----------------------------------------------------------------------------
       
   175 void
       
   176 CCsConversationContact::SetNickNameL(
       
   177         const TDesC& aNickName)
       
   178     {
       
   179     if( &aNickName )
       
   180         {
       
   181         TRAPD(error, iNickName = aNickName.AllocL());
       
   182         if(error != KErrNone)
       
   183             {
       
   184             // handle error
       
   185             // call panic
       
   186             PRINT1 ( _L("CCsConversationContact::SetNickNameL - Error:%d"),
       
   187                     error );
       
   188             }
       
   189         }
       
   190     }
       
   191 // ----------------------------------------------------------------------------
   116 // ----------------------------------------------------------------------------
   192 // CCsConversationContact::GetContactId
   117 // CCsConversationContact::GetContactId
   193 // get the phonebook Contact Id link for the conversation
   118 // get the phonebook Contact Id link for the conversation
   194 // ----------------------------------------------------------------------------
   119 // ----------------------------------------------------------------------------
   195 TInt32
   120 TInt32