uiservicetab/vimpststorage/src/cvimpststoragecontact.cpp
branchRCL_3
changeset 9 9fdee5e1da30
parent 0 5e5d6b214f4f
equal deleted inserted replaced
8:796276a1bdcc 9:9fdee5e1da30
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include "cvimpststoragecontact.h"
    21 #include "cvimpststoragecontact.h"
    22 #include "tvimpstenums.h"
    22 #include "tvimpstenums.h"
    23 #include "vimpstdebugtrace.h"
    23 #include "uiservicetabtracer.h"
    24 #include "cvimpststoragedefs.h"
    24 #include "cvimpststoragedefs.h"
    25 
    25 
    26 #include <MVPbkStoreContact.h>
    26 #include <MVPbkStoreContact.h>
    27 #include <MVPbkContactLink.h>
    27 #include <MVPbkContactLink.h>
    28 #include <e32base.h>
    28 #include <e32base.h>
    50 void CVIMPSTStorageContact::ConstructL(const TDesC& aUserId,
    50 void CVIMPSTStorageContact::ConstructL(const TDesC& aUserId,
    51     								  const TDesC& aDisplayName,
    51     								  const TDesC& aDisplayName,
    52     								  const MVPbkContactLink& aContactLink,
    52     								  const MVPbkContactLink& aContactLink,
    53     								  const TDesC8& aAvatarContent )
    53     								  const TDesC8& aAvatarContent )
    54     {
    54     {
       
    55 	TRACER_AUTO;
    55     iUserId = aUserId.AllocL();
    56     iUserId = aUserId.AllocL();
    56     iDisplayName = aDisplayName.AllocL();
    57     iDisplayName = aDisplayName.AllocL();
    57     MVPbkContactLink* link = aContactLink.CloneLC();
    58     MVPbkContactLink* link = aContactLink.CloneLC();
    58     iContactLink = link;
    59     iContactLink = link;
    59     CleanupStack::Pop(); // link
    60     CleanupStack::Pop(); // link
    66 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
    67 //
    68 //
    68 void CVIMPSTStorageContact::ConstructL(const TDesC& aUserId,
    69 void CVIMPSTStorageContact::ConstructL(const TDesC& aUserId,
    69     								  const TDesC& aDisplayName )
    70     								  const TDesC& aDisplayName )
    70     {
    71     {
       
    72 	TRACER_AUTO;
    71     iUserId = aUserId.AllocL();
    73     iUserId = aUserId.AllocL();
    72     iDisplayName = aDisplayName.AllocL();
    74     iDisplayName = aDisplayName.AllocL();
    73     }
    75     }
    74 // -----------------------------------------------------------------------------
    76 // -----------------------------------------------------------------------------
    75 // CVIMPSTStorageContact::NewL
    77 // CVIMPSTStorageContact::NewL
    79 CVIMPSTStorageContact* CVIMPSTStorageContact::NewL(const TDesC& aUserId,
    81 CVIMPSTStorageContact* CVIMPSTStorageContact::NewL(const TDesC& aUserId,
    80 		        								  const TDesC& aDisplayName,
    82 		        								  const TDesC& aDisplayName,
    81 		        								  const MVPbkContactLink& aContactLink,
    83 		        								  const MVPbkContactLink& aContactLink,
    82 		        								  const TDesC8& aAvatarContent)
    84 		        								  const TDesC8& aAvatarContent)
    83     {
    85     {
       
    86 	TRACER_AUTO;
    84     CVIMPSTStorageContact* self = CVIMPSTStorageContact::NewLC( aUserId,aDisplayName,aContactLink,aAvatarContent );
    87     CVIMPSTStorageContact* self = CVIMPSTStorageContact::NewLC( aUserId,aDisplayName,aContactLink,aAvatarContent );
    85     CleanupStack::Pop( self );
    88     CleanupStack::Pop( self );
    86 	return self;
    89 	return self;
    87     }
    90     }
    88 
    91 
    92 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
    93 //
    96 //
    94 CVIMPSTStorageContact* CVIMPSTStorageContact::NewL(const TDesC& aUserId,
    97 CVIMPSTStorageContact* CVIMPSTStorageContact::NewL(const TDesC& aUserId,
    95 		        								  const TDesC& aDisplayName )
    98 		        								  const TDesC& aDisplayName )
    96     {
    99     {
       
   100 	TRACER_AUTO;
    97     CVIMPSTStorageContact* self = new (ELeave) CVIMPSTStorageContact();
   101     CVIMPSTStorageContact* self = new (ELeave) CVIMPSTStorageContact();
    98     CleanupStack::PushL( self );
   102     CleanupStack::PushL( self );
    99     self->ConstructL( aUserId,aDisplayName );
   103     self->ConstructL( aUserId,aDisplayName );
   100     CleanupStack::Pop( self );
   104     CleanupStack::Pop( self );
   101 	return self;
   105 	return self;
   108 CVIMPSTStorageContact* CVIMPSTStorageContact::NewLC(const TDesC& aUserId,
   112 CVIMPSTStorageContact* CVIMPSTStorageContact::NewLC(const TDesC& aUserId,
   109 		        								  const TDesC& aDisplayName,
   113 		        								  const TDesC& aDisplayName,
   110 		        								  const MVPbkContactLink& aContactLink,
   114 		        								  const MVPbkContactLink& aContactLink,
   111 		        								  const TDesC8& aAvatarContent)
   115 		        								  const TDesC8& aAvatarContent)
   112     {
   116     {
       
   117 	TRACER_AUTO;
   113     CVIMPSTStorageContact* self = new( ELeave ) CVIMPSTStorageContact();
   118     CVIMPSTStorageContact* self = new( ELeave ) CVIMPSTStorageContact();
   114     CleanupStack::PushL( self );
   119     CleanupStack::PushL( self );
   115     self->ConstructL( aUserId,aDisplayName,aContactLink ,aAvatarContent);
   120     self->ConstructL( aUserId,aDisplayName,aContactLink ,aAvatarContent);
   116 	return self;
   121 	return self;
   117     }
   122     }
   138 // From MVIMPSTStorageContact
   143 // From MVIMPSTStorageContact
   139 // -----------------------------------------------------------------------------
   144 // -----------------------------------------------------------------------------
   140 //
   145 //
   141 const TDesC& CVIMPSTStorageContact::UserId() const
   146 const TDesC& CVIMPSTStorageContact::UserId() const
   142     {
   147     {
       
   148 	TRACER_AUTO;
   143     if( iUserId )
   149     if( iUserId )
   144         {
   150         {
   145         return *iUserId;
   151         return *iUserId;
   146         }
   152         }
   147     return KNullDesC;
   153     return KNullDesC;
   152 // From MVIMPSTStorageContact
   158 // From MVIMPSTStorageContact
   153 // -----------------------------------------------------------------------------
   159 // -----------------------------------------------------------------------------
   154 //
   160 //
   155 const TDesC& CVIMPSTStorageContact::Name() const
   161 const TDesC& CVIMPSTStorageContact::Name() const
   156     {
   162     {
       
   163 	TRACER_AUTO;
   157     if( iDisplayName )
   164     if( iDisplayName )
   158         {
   165         {
   159         return *iDisplayName;
   166         return *iDisplayName;
   160         }
   167         }
   161     return KNullDesC;
   168     return KNullDesC;
   188 // From MVIMPSTStorageContact
   195 // From MVIMPSTStorageContact
   189 // -----------------------------------------------------------------------------
   196 // -----------------------------------------------------------------------------
   190 //
   197 //
   191 const TDesC& CVIMPSTStorageContact::StatusText() const
   198 const TDesC& CVIMPSTStorageContact::StatusText() const
   192     {
   199     {
       
   200 	TRACER_AUTO;
   193     if( iStatusText )
   201     if( iStatusText )
   194         {
   202         {
   195         return *iStatusText;
   203         return *iStatusText;
   196         }
   204         }
   197     return KNullDesC;
   205     return KNullDesC;
   217 // From MVIMPSTStorageContact
   225 // From MVIMPSTStorageContact
   218 // -----------------------------------------------------------------------------
   226 // -----------------------------------------------------------------------------
   219 //
   227 //
   220 void CVIMPSTStorageContact::SetAvatarContentL( const TDesC8& aAvatarContent ,MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler )
   228 void CVIMPSTStorageContact::SetAvatarContentL( const TDesC8& aAvatarContent ,MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler )
   221     {
   229     {
       
   230 	TRACER_AUTO;
   222     if( iAvatarContent )
   231     if( iAvatarContent )
   223         {
   232         {
   224         if( iAvatarContent->Compare( aAvatarContent ) == 0 )
   233         if( iAvatarContent->Compare( aAvatarContent ) == 0 )
   225             {
   234             {
   226             // no need to set 
   235             // no need to set 
   257 // From MVIMPSTStorageExtendedStorageContact
   266 // From MVIMPSTStorageExtendedStorageContact
   258 // -----------------------------------------------------------------------------
   267 // -----------------------------------------------------------------------------
   259 //
   268 //
   260 void CVIMPSTStorageContact::SetNameL( const TDesC& aName )
   269 void CVIMPSTStorageContact::SetNameL( const TDesC& aName )
   261     {
   270     {
       
   271 	TRACER_AUTO;
   262     if( iDisplayName )
   272     if( iDisplayName )
   263 	    {
   273 	    {
   264 	    delete iDisplayName;
   274 	    delete iDisplayName;
   265 	    iDisplayName = NULL;	
   275 	    iDisplayName = NULL;	
   266 	    }
   276 	    }