uiservicetab/vimpststorage/inc/mvimpststoragevpbkstorehandler.h
changeset 15 81eeb8c83ce5
parent 0 5e5d6b214f4f
equal deleted inserted replaced
0:5e5d6b214f4f 15:81eeb8c83ce5
     1 
       
     2 /*
       
     3 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     4 * All rights reserved.
       
     5 * This component and the accompanying materials are made available
       
     6 * under the terms of "Eclipse Public License v1.0"
       
     7 * which accompanies this distribution, and is available
       
     8 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 *
       
    10 * Initial Contributors:
       
    11 * Nokia Corporation - initial contribution.
       
    12 *
       
    13 * Contributors:
       
    14 *
       
    15 * Description:  class implementatio from vpbkstorage handler to store
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef MVIMPSTSTORAGEVPBKSTOREHANDLER_H
       
    21 #define MVIMPSTSTORAGEVPBKSTOREHANDLER_H
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <MVPbkContactStoreObserver.h>
       
    25 
       
    26 class MVPbkContactViewBase;
       
    27 class MVPbkContactLink;
       
    28 class MVPbkContactStore;
       
    29 class MVPbkStoreContact;
       
    30 
       
    31 /**
       
    32  * A class for a contact store event.
       
    33  *
       
    34  * The contact store event contains the type of the event and
       
    35  * possibly a contact link to a changed contact.
       
    36  */
       
    37 enum TVIMPSTVPbkStoreEventType
       
    38 	{
       
    39 	EVPbkUnknownEvent = -1,
       
    40 	EVPbkUnknownChanges = 0,
       
    41 	EVPbkContactAdded ,
       
    42 	EVPbkContactDeleted,
       
    43 	EVPbkContactChanged,
       
    44 	EVPbkContactRetriving,
       
    45 	EVPbkContactFetching,
       
    46 	EVPbkContactReading,
       
    47 	EVPbkUpdatingAvatar,
       
    48 	EVPbkContactSynchronizing,
       
    49 	EVPbkContactReadCompleted
       
    50 	};	
       
    51 				
       
    52  class TVIMPSTVPbkStoreEvent
       
    53 	{
       
    54 	  
       
    55    public: // Interface
       
    56    	
       
    57         /**
       
    58          * Constructor
       
    59          *
       
    60          * @param aEventType The type of the contact store event
       
    61          * @param aContactLink The identifier of the changed contact or NULL.
       
    62          *                     The link is not owned by this class.
       
    63          */
       
    64     	 TVIMPSTVPbkStoreEvent( TVIMPSTVPbkStoreEventType aEventType, 
       
    65 				                MVPbkContactLink* aContactLink = NULL,
       
    66 				                MVPbkStoreContact* aContact = NULL ,
       
    67 				                const TDesC& aUserId = KNullDesC ,
       
    68 				                const TDesC& aName = KNullDesC,
       
    69 				                const TDesC8& aAvatarContent = KNullDesC8 );
       
    70 				                
       
    71   public:               
       
    72 		/// Own: Type of the event that has happened
       
    73 		TVIMPSTVPbkStoreEventType iEventType;
       
    74 		/// Ref: Link to the contact that is accociated with the event or NULL. 
       
    75 		///      The link is valid only during HandleStoreEventL function call
       
    76 		///      and client can not take the ownership of the instance.
       
    77 		//       Client must clone the link if it needs it later.
       
    78 		MVPbkContactLink* iContactLink;
       
    79 		///Own: Spare for future extension
       
    80 		MVPbkStoreContact* iVPbkContact;
       
    81 		///Own: Spare for future extension
       
    82 		TPtrC iUserId;
       
    83 		///Own: Spare for future extension
       
    84 		TPtrC iDisplayName;	
       
    85 		// owns avatar content
       
    86 		TPtrC8 iAvatarContent;
       
    87 	};
       
    88 
       
    89 inline TVIMPSTVPbkStoreEvent::TVIMPSTVPbkStoreEvent(
       
    90 							TVIMPSTVPbkStoreEventType aEventType, 
       
    91 			                MVPbkContactLink* aContactLink,
       
    92 			                MVPbkStoreContact* aContact,
       
    93 			                const TDesC& aUserId ,
       
    94 			                const TDesC& aName ,
       
    95 			                const TDesC8& aAvatarContent ) :
       
    96 	iEventType(aEventType),
       
    97 	iContactLink(aContactLink),
       
    98 	iVPbkContact( aContact ),
       
    99 	iUserId(aUserId ),
       
   100 	iDisplayName( aName ),
       
   101 	iAvatarContent( aAvatarContent )
       
   102 	{
       
   103 	}
       
   104 /**
       
   105  *  Interface for contact data container observer
       
   106  *
       
   107  *  @lib vimpststorage.dll
       
   108  *  @since 5.0
       
   109  */
       
   110 class MVIMPSTStorageVPbkStoreHandler
       
   111     {
       
   112     public: // New functions
       
   113 		
       
   114 	    /**
       
   115          * From MVPbkContactStoreObserver
       
   116          * Callback: Store event occured
       
   117          *
       
   118          * @since S60 5.0
       
   119          * @param aContactStore, contact store
       
   120          * @param aStoreEvent, event
       
   121          */
       
   122         virtual void HandleVPbkStoreEventL(TVIMPSTVPbkStoreEvent aVPbkStoreEvent)  = 0 ; 
       
   123         
       
   124         
       
   125      		/**
       
   126 		* Virtual destructor
       
   127 		*/
       
   128 		virtual ~MVIMPSTStorageVPbkStoreHandler() {};
       
   129     };
       
   130 
       
   131 #endif      // MVIMPSTSTOREDCONTACTSOBSERVER_H
       
   132 
       
   133 // End of File