uiservicetab/vimpststorage/inc/cvimpststoragecontact.h
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Contact data container implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVIMPSTSTORAGECONTACT_H
       
    21 #define CVIMPSTSTORAGECONTACT_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <badesca.h>
       
    28 #include "mvimpststoragecontact.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class Cvimpststorage_test; //Unit testClass
       
    32 class MVIMPSTStorageVPbkContactStore;
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  Contact data implementation
       
    37  * @lib vimpststorage.dll
       
    38  * @since 5.0
       
    39  */
       
    40 NONSHARABLE_CLASS (CVIMPSTStorageContact) : public CBase,
       
    41    											public MVIMPSTStorageContact
       
    42    {
       
    43    public:  // Constructors and destructor
       
    44 
       
    45         /**
       
    46          * Two-phased constructor.
       
    47          * @param aObserver contact data container observer
       
    48          * @param aContactLink pointer to contact link
       
    49          * @param aStoreContact pointer to the stored contact
       
    50          * @param aContactManager reference to  virtual pbk manager
       
    51          * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted
       
    52          * @return CVIMPSTStorageContact* a new instance of this class
       
    53          */
       
    54         static CVIMPSTStorageContact* NewL(const TDesC& aUserId,
       
    55         								  const TDesC& aDisplayName,
       
    56         								  const MVPbkContactLink& aContactLink,
       
    57         								  const TDesC8& aAvatarContent
       
    58         								  );
       
    59         								  
       
    60         /**
       
    61          * Two-phased constructor.
       
    62          * @param aObserver contact data container observer
       
    63          * @param aContactLink pointer to contact link
       
    64          * @param aStoreContact pointer to the stored contact
       
    65          * @param aContactManager reference to  virtual pbk manager
       
    66          * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted
       
    67          * @return CVIMPSTStorageContact* a new instance of this class
       
    68          */
       
    69         static CVIMPSTStorageContact* NewL(const TDesC& aUserId,
       
    70         								  const TDesC& aDisplayName );
       
    71 		
       
    72 		 /**
       
    73          * Two-phased constructor.
       
    74          * @param aObserver contact data container observer
       
    75          * @param aContactLink pointer to contact link
       
    76          * @param aStoreContact pointer to the stored contact
       
    77          * @param aContactManager reference to  virtual pbk manager
       
    78          * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted
       
    79          * @return CVIMPSTStorageContact* a new instance of this class
       
    80          */
       
    81         static CVIMPSTStorageContact* NewLC(const TDesC& aUserId,
       
    82         								  const TDesC& aDisplayName,
       
    83         								  const MVPbkContactLink& aContactLink,
       
    84         								  const TDesC8& aAvatarContent
       
    85         								  );
       
    86 
       
    87         /**
       
    88          * C++ Destructor.
       
    89          */
       
    90         ~CVIMPSTStorageContact();
       
    91                
       
    92         
       
    93     public: // Functions from base classes MVIMPSTStorageContact
       
    94 
       
    95 		/**
       
    96          * @see MVIMPSTStorageContact
       
    97          */
       
    98         void SetUserIdL( const TDesC& aUserId );
       
    99         
       
   100         
       
   101         void SetAvatarContentL( const TDesC8& aAvatarContent ,
       
   102                 MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler);
       
   103         
       
   104         /**
       
   105          * Set User ID
       
   106          * @param aUserId, user id to be set.
       
   107          */                
       
   108         void SetNameL( const TDesC& aName ) ;
       
   109         
       
   110         /**
       
   111          * @see MVIMPSTStorageContact
       
   112          */
       
   113 	    MVPbkContactLink* ContactLink() const;
       
   114 
       
   115 	    
       
   116         /**
       
   117          * @see MVIMPSTStorageContact
       
   118          */
       
   119         const TDesC8& AvatarContent() const;
       
   120         
       
   121      
       
   122         /**
       
   123          * @see MVIMPSTStorageContact
       
   124          */
       
   125         const TDesC& UserId() const;
       
   126         
       
   127         /**
       
   128          * @see MVIMPSTStorageContact
       
   129          */
       
   130         const TDesC& Name() const;
       
   131 
       
   132        
       
   133         /**
       
   134          * @see MVIMPSTStorageContact
       
   135          */
       
   136         TVIMPSTEnums::TOnlineStatus OnlineStatus() const;
       
   137 
       
   138         
       
   139         /**
       
   140          * @see MVIMPSTStorageContact
       
   141          */
       
   142         void SetOnlineStatus( 
       
   143                 TVIMPSTEnums::TOnlineStatus aOnlineStatus );
       
   144           
       
   145         /**
       
   146          * @see MVIMPSTStorageContact
       
   147          */
       
   148         const TDesC& StatusText() const;
       
   149         
       
   150         /**
       
   151          * @see MVIMPSTStorageContact
       
   152          */
       
   153         void SetStatusTextL( const TDesC& aStatusText );  
       
   154         
       
   155         
       
   156         void SetAvatarIndex(TInt aIndex )  ;
       
   157 		
       
   158 		
       
   159 		TInt AvatarIndex() const;      
       
   160         
       
   161    private:
       
   162 
       
   163         /**
       
   164          * C++ default constructor.
       
   165          * @param aObserver contact data container observer         
       
   166          * @param aContactManager reference to  virtual pbk manager
       
   167          * @param aStoreContact pointer to the stored contact         
       
   168          * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted
       
   169          */
       
   170         CVIMPSTStorageContact();
       
   171 
       
   172         /**
       
   173          * By default Symbian 2nd phase constructor is private.
       
   174          */
       
   175         void ConstructL(const TDesC& aUserId,
       
   176 						  const TDesC& aDisplayName,
       
   177 						  const MVPbkContactLink& aContactLink,
       
   178 						  const TDesC8& aAvatarContent);
       
   179         
       
   180    		 /**
       
   181          * By default Symbian 2nd phase constructor is private.
       
   182          */
       
   183         void ConstructL(const TDesC& aUserId,
       
   184 					    const TDesC& aDisplayName );
       
   185     private:    // Data
       
   186 
       
   187         // user ID 
       
   188         HBufC* iUserId;     // owns
       
   189         
       
   190          // user ID 
       
   191         HBufC* iDisplayName; 
       
   192 
       
   193         // presence status (online, offline, etc)
       
   194         TVIMPSTEnums::TOnlineStatus iPresenceStatus;
       
   195         
       
   196         /// Status text. Owns.
       
   197         HBufC* iStatusText;
       
   198         
       
   199 	    // Own, virtual phonebook contact link
       
   200 	    MVPbkContactLink*       iContactLink;    
       
   201 	  
       
   202 	    // avatar content Owns        
       
   203 	    HBufC8* iAvatarContent;
       
   204 	    
       
   205 	    TInt iAvatarIndex;
       
   206 	    
       
   207 	    //for test cases
       
   208 	    friend class Cvimpststorage_test;
       
   209         
       
   210     };
       
   211 
       
   212 #endif      // CVIMPSTSTORAGECONTACT_H
       
   213 
       
   214 // End of File