phonebookui/Phonebook2/USIMExtension/inc/CPsu2ContactEditorExtension.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Phonebook 2 USIM UI contact editor extension.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPSU2CONTACTEDITOREXTENSION_H
       
    20 #define CPSU2CONTACTEDITOREXTENSION_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2ContactEditorExtension.h>
       
    25 #include <Pbk2FieldProperty.hrh>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CEikMenuPane;
       
    29 class CVPbkContactManager;
       
    30 class MPbk2ContactEditorControl;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 class CPsu2ContactEditorExtension : public CBase,
       
    34 								    public MPbk2ContactEditorExtension
       
    35     {
       
    36     public:
       
    37         /**
       
    38          * Creates a new instance of this class.
       
    39          *
       
    40          * @param aContactManager   Virtual Phonebook contact manager.
       
    41          * @param aContact          The contact being edited.
       
    42          * @param aEditorControl    Contact editor control.
       
    43          * @return  A new instance of this class.
       
    44          */
       
    45         static CPsu2ContactEditorExtension* NewL(
       
    46                 CVPbkContactManager& aContactManager,
       
    47                 MVPbkStoreContact& aContact,
       
    48                 MPbk2ContactEditorControl& aEditorControl );
       
    49 
       
    50         /**
       
    51          * Destructor.
       
    52          */
       
    53         ~CPsu2ContactEditorExtension();
       
    54 
       
    55     public: // From MPbk2ContactEditorExtension
       
    56         MPbk2ContactEditorField* CreateEditorFieldL(
       
    57                 MVPbkStoreContactField& aField,
       
    58                 const MPbk2FieldProperty& aFieldProperty,
       
    59                 MPbk2ContactEditorUiBuilder& aUiBuilder,
       
    60                 CPbk2IconInfoContainer& aIconInfoContainer );
       
    61         void DynInitMenuPaneL(
       
    62                 TInt aResourceId,
       
    63                 CEikMenuPane* aMenuPane );
       
    64         TBool ProcessCommandL(
       
    65                 TInt aCommandId );
       
    66         TBool OkToDeleteContactL(
       
    67                 MPbk2ContactEditorEventObserver::TParams& aParams );
       
    68         TBool OkToSaveContactL(
       
    69                 MPbk2ContactEditorEventObserver::TParams& aParams );
       
    70         void ModifyButtonGroupContainerL(
       
    71         		CEikButtonGroupContainer& aButtonGroupContainer );
       
    72         void DoRelease();
       
    73         void ContactEditorOperationCompleted(
       
    74                 MVPbkContactObserver::TContactOpResult aResult,
       
    75                 TParams aParams );
       
    76         void ContactEditorOperationFailed(
       
    77                 MVPbkContactObserver::TContactOp aOpCode,
       
    78                 TInt aErrorCode,
       
    79                 TParams aParams,
       
    80                 TFailParams& aFailParams );
       
    81 
       
    82     private: // Implementation
       
    83         CPsu2ContactEditorExtension(
       
    84                 CVPbkContactManager& aContactManager,
       
    85                 MVPbkStoreContact& aContact,
       
    86                 MPbk2ContactEditorControl& aEditorControl );
       
    87         void ConstructL();
       
    88         TInt ContactOrigin() const;
       
    89         void ShowInformationNote(
       
    90                 TInt aResourceId,
       
    91                 TBool aShowStoreName ) const;
       
    92         void ShowInformationNoteL(
       
    93                 TInt aResourceId,
       
    94                 TBool aShowStoreName ) const;
       
    95         void FocusControlOfType(
       
    96                 TPbk2FieldCtrlType aType );
       
    97         void AddLastNameFieldL();
       
    98         void HandleTextTooLongL(
       
    99                 TFailParams& aFailParams ) const;
       
   100         void HandleContactEditorOperationFailedL(
       
   101                 TInt aErrorCode,
       
   102                 TFailParams& aFailParams );
       
   103 
       
   104     private: // Data types
       
   105         enum TPsu2ContactOrigin
       
   106             {
       
   107             /// Contact is not a (U)SIM contact
       
   108             EPsu2NotSimContact,
       
   109             /// Contact is a ADN contact
       
   110             EPsu2AdnContact,
       
   111             /// Contact is a SDN contact
       
   112             EPsu2SdnContact,
       
   113             /// Contact is a FDN contact
       
   114             EPsu2FdnContact
       
   115             };
       
   116 
       
   117     private: // Data
       
   118         /// Ref: Virtual Phonebook contact manager
       
   119         CVPbkContactManager& iContactManager;
       
   120         /// Ref: The edited contact
       
   121         MVPbkStoreContact& iContact;
       
   122         /// Ref: Contact editor control
       
   123         MPbk2ContactEditorControl& iEditorControl;
       
   124         /// Own: Indicates the contact origin
       
   125         TInt iContactOrigin;
       
   126         /// Own: 'end-key' was pressed
       
   127         TBool iEndKeyWasPressed;
       
   128 	};
       
   129 
       
   130 #endif // CPSU2CONTACTEDITOREXTENSION_H
       
   131 
       
   132 // End of File