cpbkcontacteditordlg.h

Go to the documentation of this file.
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 class CAknNavigationControlContainer;
00042 
00043 
00044 // CLASS DECLARATION
00045 
00052 class CPbkContactEditorDlg :
00053         public CAknForm
00054     {
00055     public:  // Constructors and destructor
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:  // Interface
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:  // from CCoeControl
00138         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00139         void GetHelpContext(TCoeHelpContext& aContext) const;
00140 
00141     private:  // Command handlers
00142         void CmdSaveL();
00143         void CmdDoneL();
00144         void CmdEditItemLabelL();
00145         void CmdAddItemL();
00146         void CmdDeleteItemL();
00147         void CmdFetchThumbnailL();
00148         void CmdRemoveThumbnailL();
00149 
00150     private:  // From CAknForm
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:  // Constructors
00160         CPbkContactEditorDlg
00161             (CPbkContactEngine& aEngine,
00162             CPbkContactItem& aContactItem,
00163             TInt aFocusIndex);
00164         void BaseConstructL(TBool aIsNewContact, TBool aEdited);
00165 
00166     protected:  // Implementation
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, // Hide exit
00184             EEscKeyReceived, 
00185             EUnderDestruction // The dialog is under destruction
00186             };
00187 
00188     protected: // data
00190         CPbkContactItem& iContactItem;
00192         CPbkContactEditorFieldArray* iFieldManager;
00193 
00194     private:  // Data
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: // friends
00235         friend class CExtension;
00236      };
00237 
00238 // __CPbkContactEditorDlg_H__
00239 #endif
00240 
00241 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top