00001 /* 00002 * ============================================================================ 00003 * Name : CPbkContactEditorDlg from CPbkContactEditorDlg.h 00004 * Part of : PbkView.dll 00005 * 00006 * Description: 00007 * Phonebook contact editor dialog. 00008 * Version: 00009 * 00010 * Copyright (C) 2002 Nokia Corporation. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia Corporation. All rights are reserved. Copying, 00014 * including reproducing, storing, adapting or translating, any 00015 * or all of this material requires the prior written consent of 00016 * Nokia Corporation. This material also contains confidential 00017 * information which may not be disclosed to others without the 00018 * prior written consent of Nokia Corporation. 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef __CPbkContactEditorDlg_H__ 00023 #define __CPbkContactEditorDlg_H__ 00024 00025 // INCLUDES 00026 #include <AknForm.h> // CAknForm 00027 #include <cntdef.h> // TContactItemId 00028 #include <babitflags.h> // TBitFlags 00029 00030 00031 // FORWARD DECLARATIONS 00032 class CAknTitlePane; 00033 class CPbkContextPaneIcon; 00034 class CPbkThumbnailPopup; 00035 class CPbkThumbnailCmd; 00036 class CPbkContactEditorFieldArray; 00037 class CPbkContactEngine; 00038 class CPbkContactItem; 00039 class MPbkContactEditorStrategy; 00040 class MPbkEditorOkToExitCallback; 00041 #start_since SINCE_3_1_SDK 00042 class CAknNavigationControlContainer; 00043 #end_since SINCE_3_1_SDK 00044 00045 00046 // CLASS DECLARATION 00047 00054 class CPbkContactEditorDlg : 00055 public CAknForm 00056 { 00057 public: // Constructors and destructor 00074 IMPORT_C static CPbkContactEditorDlg* NewL 00075 (CPbkContactEngine& aEngine, 00076 CPbkContactItem& aContactItem, 00077 TBool aIsNewContact, 00078 TInt aFocusIndex=-1, 00079 TBool aEdited=EFalse); 00080 00084 ~CPbkContactEditorDlg(); 00085 00086 public: // Interface 00091 IMPORT_C void ResetWhenDestroyed(CPbkContactEditorDlg** aSelfPtr); 00092 00105 IMPORT_C TContactItemId ExecuteLD(); 00106 00111 IMPORT_C void HideExitCommand(); 00112 00121 IMPORT_C void SetHelpContext(TCoeHelpContext aContext); 00122 00128 IMPORT_C void SetExitCallback(MPbkEditorOkToExitCallback* aCallback); 00129 00137 IMPORT_C void SetExitCommandId(TInt aCommandId); 00138 00139 private: // from CCoeControl 00140 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); 00141 void GetHelpContext(TCoeHelpContext& aContext) const; 00142 00143 private: // Command handlers 00144 void CmdSaveL(); 00145 void CmdDoneL(); 00146 void CmdEditItemLabelL(); 00147 void CmdAddItemL(); 00148 void CmdDeleteItemL(); 00149 void CmdFetchThumbnailL(); 00150 void CmdRemoveThumbnailL(); 00151 00152 private: // From CAknForm 00153 void PreLayoutDynInitL(); 00154 void PostLayoutDynInitL(); 00155 void SetInitialCurrentLine(); 00156 void ProcessCommandL(TInt aCommandId); 00157 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); 00158 TBool OkToExitL(TInt aKeycode); 00159 void HandleControlStateChangeL(TInt aControlId); 00160 00161 protected: // Constructors 00162 CPbkContactEditorDlg 00163 (CPbkContactEngine& aEngine, 00164 CPbkContactItem& aContactItem, 00165 TInt aFocusIndex); 00166 void BaseConstructL(TBool aIsNewContact, TBool aEdited); 00167 00168 protected: // Implementation 00169 void StoreTitlePaneTextL(); 00170 void ConstructContextMenuL(); 00171 #start_since SINCE_3_1_SDK 00172 00175 void ConstructNaviPaneL(); 00176 #end_since SINCE_3_1_SDK 00177 TBool IsNewContact() const; 00178 void UpdateTitlePaneL(); 00179 void CloseAllPopups(); 00180 TBool ContactAlreadyExistsL(); 00181 TBool DuplicateNameMatchL(CContactIdArray* aIdArray); 00182 TBool CheckForDuplicateEntryL(); 00183 #start_since SINCE_3_1_SDK 00184 00187 void ReloadThumbnailL(); 00188 #end_since SINCE_3_1_SDK 00189 00190 void WriteContactToDbL(); 00191 00193 enum TStateFlag 00194 { 00195 EHideExit, // Hide exit 00196 EEscKeyReceived, 00197 EUnderDestruction // The dialog is under destruction 00198 }; 00199 00200 protected: // data 00202 CPbkContactItem& iContactItem; 00204 CPbkContactEditorFieldArray* iFieldManager; 00205 00206 private: // Data 00208 CPbkContactEngine& iEngine; 00210 TInt iFocusIndex; 00212 mutable TBitFlags iStateFlags; 00214 TContactItemId* iSavedContactPtr; 00216 CAknTitlePane* iTitlePane; 00218 HBufC* iStoredTitlePaneText; 00220 CPbkContextPaneIcon* iContextPaneIcon; 00222 CPbkThumbnailPopup* iThumbnailHandler; 00224 CEikMenuBar* iContextMenuBar; 00226 CPbkThumbnailCmd* iThumbnailCmd; 00228 MPbkContactEditorStrategy* iEditorStrategy; 00233 CPbkContactEditorDlg** iSelfPtr; 00234 class CExtension; 00236 CExtension* iExtension; 00238 TCoeHelpContext iHelpContext; 00240 MPbkEditorOkToExitCallback* iExitCallback; 00242 TInt iExitCommandId; 00244 CAknNavigationControlContainer* iNaviContainer; 00245 00246 private: // friends 00247 friend class CExtension; 00248 }; 00249 00250 // __CPbkContactEditorDlg_H__ 00251 #endif 00252 00253 // End of File