phonebookui/Phonebook2/ccapplication/ccamycardplugin/inc/ccappmycard.h
branchRCL_3
changeset 6 e8e3147d53eb
parent 3 04ab22b956c2
child 9 0d28c1c5b6dd
--- a/phonebookui/Phonebook2/ccapplication/ccamycardplugin/inc/ccappmycard.h	Fri Mar 12 15:41:25 2010 +0200
+++ b/phonebookui/Phonebook2/ccapplication/ccamycardplugin/inc/ccappmycard.h	Mon Mar 15 12:39:26 2010 +0200
@@ -39,6 +39,7 @@
 class CPbk2ApplicationServices;
 class CCCAppMyCardPlugin;	
 class MPbk2DialogEliminator;
+class CTimerCallBack;
 
 /**
  * MyCard Observer class
@@ -51,8 +52,12 @@
      */
     enum TEvent
         {
+        /// Undefined event
         EEventNull = 0,
-        EEventContactLoaded
+        /// Contact loaded for the first time
+        EEventContactLoaded,
+        /// Contact has been changed
+        EEventContactChanged
         };
     
     /**
@@ -152,6 +157,26 @@
      */
     void RemoveObserver( MMyCardObserver* aObserver );
 
+    /**
+     * Set contact link. If link is provided it will be used instead of resolving
+     * the own contact link from contact store. This should be called before call to
+     * FetchMyCardL().
+     * 
+     * @param aLink contact link 
+     */
+    void SetLinkL( const MVPbkContactLink& aLink );
+    
+    /**
+     * Start fetching the data of own contact and observe it's changing.
+     */
+    void FetchMyCardL();
+    
+    /**
+     * Force MyCard to open editor and create new own contact once the 
+     * contact store is opened. This should be called before calling FetchMyCardL.
+     */
+    void ForceCreateMyCard();
+    
 private: // from MVPbkContactStoreObserver
      void StoreReady(MVPbkContactStore& aContactStore);
      void StoreUnavailable(MVPbkContactStore& aContactStore, 
@@ -230,6 +255,11 @@
      */
     static TInt ExitDlgL( TAny* aPtr );
     
+    /**
+     * Async callback function for opening stores.
+     */
+    static TInt OpenStoresL( TAny* aPtr );
+
     /*
      * Closes the CCA
      */
@@ -270,6 +300,14 @@
 	TInt iFocusedFieldIndex;	
 	/// Now own. Editor dialog eliminator
 	MPbk2DialogEliminator* iEditorEliminator;
+	/// Current event
+	MMyCardObserver::TEvent iEvent;
+	/// Own. Store opener callback
+	CTimerCallBack* iStoreCallBack;
+	/// Force editor flag
+	TBool iForceCreateMyCard;
+	// Flag for editor state
+	TBool iDialogIsRunning;
 	};
 
 #endif // CCAPPMYCARD_H