00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CPbkContactEditorDlg_H__
00023 #define __CPbkContactEditorDlg_H__
00024
00025
00026 #include <AknForm.h>
00027 #include <cntdef.h>
00028 #include <babitflags.h>
00029
00030
00031
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 class CAknNavigationControlContainer;
00042
00043
00044
00045
00052 class CPbkContactEditorDlg :
00053 public CAknForm
00054 {
00055 public:
00072 IMPORT_C static CPbkContactEditorDlg* NewL
00073 (CPbkContactEngine& aEngine,
00074 CPbkContactItem& aContactItem,
00075 TBool aIsNewContact,
00076 TInt aFocusIndex=-1,
00077 TBool aEdited=EFalse);
00078
00082 ~CPbkContactEditorDlg();
00083
00084 public:
00089 IMPORT_C void ResetWhenDestroyed(CPbkContactEditorDlg** aSelfPtr);
00090
00103 IMPORT_C TContactItemId ExecuteLD();
00104
00109 IMPORT_C void HideExitCommand();
00110
00119 IMPORT_C void SetHelpContext(TCoeHelpContext aContext);
00120
00126 IMPORT_C void SetExitCallback(MPbkEditorOkToExitCallback* aCallback);
00127
00135 IMPORT_C void SetExitCommandId(TInt aCommandId);
00136
00137 private:
00138 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00139 void GetHelpContext(TCoeHelpContext& aContext) const;
00140
00141 private:
00142 void CmdSaveL();
00143 void CmdDoneL();
00144 void CmdEditItemLabelL();
00145 void CmdAddItemL();
00146 void CmdDeleteItemL();
00147 void CmdFetchThumbnailL();
00148 void CmdRemoveThumbnailL();
00149
00150 private:
00151 void PreLayoutDynInitL();
00152 void PostLayoutDynInitL();
00153 void SetInitialCurrentLine();
00154 void ProcessCommandL(TInt aCommandId);
00155 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
00156 TBool OkToExitL(TInt aKeycode);
00157 void HandleControlStateChangeL(TInt aControlId);
00158
00159 protected:
00160 CPbkContactEditorDlg
00161 (CPbkContactEngine& aEngine,
00162 CPbkContactItem& aContactItem,
00163 TInt aFocusIndex);
00164 void BaseConstructL(TBool aIsNewContact, TBool aEdited);
00165
00166 protected:
00167 void StoreTitlePaneTextL();
00168 void ConstructContextMenuL();
00169 void ConstructNaviPaneL();
00170 TBool IsNewContact() const;
00171 void UpdateTitlePaneL();
00172 void CloseAllPopups();
00173 TBool ContactAlreadyExistsL();
00174 TBool DuplicateNameMatchL(CContactIdArray* aIdArray);
00175 TBool CheckForDuplicateEntryL();
00176 void ReloadThumbnailL();
00177
00178 void WriteContactToDbL();
00179
00181 enum TStateFlag
00182 {
00183 EHideExit,
00184 EEscKeyReceived,
00185 EUnderDestruction
00186 };
00187
00188 protected:
00190 CPbkContactItem& iContactItem;
00192 CPbkContactEditorFieldArray* iFieldManager;
00193
00194 private:
00196 CPbkContactEngine& iEngine;
00198 TInt iFocusIndex;
00200 mutable TBitFlags iStateFlags;
00202 TContactItemId* iSavedContactPtr;
00204 CAknTitlePane* iTitlePane;
00206 HBufC* iStoredTitlePaneText;
00208 CPbkContextPaneIcon* iContextPaneIcon;
00210 CPbkThumbnailPopup* iThumbnailHandler;
00212 CEikMenuBar* iContextMenuBar;
00214 CPbkThumbnailCmd* iThumbnailCmd;
00216 MPbkContactEditorStrategy* iEditorStrategy;
00221 CPbkContactEditorDlg** iSelfPtr;
00222 class CExtension;
00224 CExtension* iExtension;
00226 TCoeHelpContext iHelpContext;
00228 MPbkEditorOkToExitCallback* iExitCallback;
00230 TInt iExitCommandId;
00232 CAknNavigationControlContainer* iNaviContainer;
00233
00234 private:
00235 friend class CExtension;
00236 };
00237
00238
00239 #endif
00240
00241