|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : AddressBookAppUi.cpp 00004 * Part of : AddressBook 00005 * Interface : 00006 * Description : Application UI class, CAddressBookAppUi - 00007 * responsible for handling user commands 00008 * Version : 00009 * 00010 * Copyright (c) 2002-2006 Nokia Corporation. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia Corporation. 00014 * ============================================================================== 00015 */ 00016 00017 #ifndef ADDRESSBOOKAPPUI_H 00018 #define ADDRESSBOOKAPPUI_H 00019 00020 // INCLUDES 00021 #include <eikapp.h> 00022 #include <eikdoc.h> 00023 #include <e32std.h> 00024 #include <coeccntx.h> 00025 #include <aknappui.h> 00026 #include <aknwaitnotewrapper.h> 00027 #include <CPbkContactEngine.h> 00028 #include <CPbkContactItem.h> 00029 #include "MAddressBookEngineObserver.h" 00030 00031 // FORWARD DECLARATIONS 00032 class CAddressBookView; 00033 class CAddressBookContact; 00034 class CAddressBookEngine; 00035 00036 // CLASS DECLARATION 00037 00038 /** 00039 * Application UI class. 00040 * Provides support for the following features: 00041 * - EIKON control architecture 00042 */ 00043 class CAddressBookAppUi : public CAknAppUi, public MAknBackgroundProcess, 00044 public MAddressBookEngineObserver 00045 { 00046 public: // Constructors and destructor 00047 00048 /** 00049 * Destructor. 00050 */ 00051 ~CAddressBookAppUi(); 00052 00053 // Functions from base classes 00054 00055 /** 00056 * From MAddressBookEngineObserver, checks errors that can happen 00057 * @param aCode Code of Error 00058 */ 00059 virtual void ErrorL(TInt aCode); 00060 00061 /** 00062 * From MAddressBookEngineObserver, is called 00063 * by the CAddressBookEngine::SetStatus(const TInt aStatus) 00064 * to set conection's status as ready 00065 */ 00066 virtual void ConnectionReady(); 00067 00068 /** 00069 * From MAddressBookEngineObserver, updates bufer 00070 * containing the contact information and sets status as READY 00071 * @param aContactArray - contact information that was found 00072 */ 00073 virtual void SearchFinishedL(RPointerArray<CAddressBookContact>& aContactArray); 00074 00075 private: // Constructors 00076 00077 /** 00078 * By default Symbian 2nd phase constructor is private. 00079 */ 00080 void ConstructL(); 00081 00082 // New functions 00083 00084 /** 00085 * Updates field of CPbkContactItem when user select 00086 * the point of menu "Add to contacts". The change doesn't reflect to database. 00087 * @param modifiableItem - Item that need to modify 00088 * @param fieldId - Field of modifiableItem 00089 * @param newValue - Value that will be added instead an old one 00090 */ 00091 void UpdateFieldL(CPbkContactItem* aModifiableItem, 00092 TPbkFieldId aFieldId, const TDesC8& aNewValue); 00093 00094 // Functions from base classes 00095 00096 /** From MEikMenuObserver, is called by EIKON framework just before 00097 * it displays a menu pane, 00098 * sets the state of menu items dynamically according 00099 * to the state of application data. 00100 * @param aResourceId specifies dialog-resource ID. 00101 * @param aMenuPane specifies menu pane 00102 */ 00103 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); 00104 00105 /** From MAknBackgroundProcess, 00106 * is called by the active scheduler to dismiss the dialog 00107 *@param aButtonId specifies button that was pressed 00108 */ 00109 void DialogDismissedL(TInt aButtonId); 00110 00111 /** From MAknBackgroundProcess, 00112 * is called by the active scheduler to check if is process already done 00113 */ 00114 TBool IsProcessDone() const; 00115 00116 /** From MAknBackgroundProcess 00117 * is called by the active scheduler to finish the process 00118 */ 00119 void ProcessFinished(); 00120 00121 /** From MAknBackgroundProcess, 00122 * and is called by the active scheduler to do one step of processing 00123 * Purpose this function in AddressBook to run AddressBookEngine::ConnectL() 00124 * if connection is not established yet 00125 */ 00126 void StepL(); 00127 00128 /** 00129 * From CEikAppUi, takes care of command handling. 00130 * @param aCommand command to be handled 00131 */ 00132 void HandleCommandL(TInt aCommand); 00133 00134 /** 00135 * From CEikAppUi, handles key events. 00136 * @param aKeyEvent Event to handled. 00137 * @param aType Type of the key event. 00138 * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 00139 */ 00140 virtual TKeyResponse HandleKeyEventL( 00141 const TKeyEvent& aKeyEvent,TEventCode aType); 00142 00143 private: //Data 00144 CAddressBookView* iAppContainer; 00145 CAddressBookEngine* iEngine; 00146 CPbkContactEngine* iContactEngine; 00147 CAknWaitNoteWrapper* iWaitNote; 00148 TBool iReady; 00149 TBool iFirstTime; 00150 TBool iConnecting; 00151 }; 00152 00153 #endif // ADDRESSBOOKAPPUI_H 00154 00155 // End of File 00156
|
© Nokia 2006 |