phonebookui/Phonebook2/UIControls/inc/CPbk2ContactEditorFieldBase.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002-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 contact editor field base class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTEDITORFIELDBASE_H
       
    20 #define CPBK2CONTACTEDITORFIELDBASE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MPbk2ContactEditorField.h"
       
    25 #include "MPbk2ContactEditorField2.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MVPbkStoreContactField;
       
    29 class MPbk2FieldProperty;
       
    30 class MPbk2ContactEditorUiBuilder;
       
    31 class CPbk2IconInfoContainer;
       
    32 class CPbk2PresentationContactField;
       
    33 class MPbk2ContactEditorFieldVisitor;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Phonebook 2 contact editor field base class.
       
    39  */
       
    40 NONSHARABLE_CLASS(CPbk2ContactEditorFieldBase) : public CBase,
       
    41                                                  public MPbk2ContactEditorField,
       
    42                                                  public MPbk2ContactEditorField2
       
    43     {
       
    44     protected:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47          * C++ constructor.
       
    48          *
       
    49          * @param aContactField         Contact field.
       
    50          * @param aUiBuilder            UI builder for adding
       
    51          *                              the field into dialog.
       
    52          * @param aIconInfoContainer    An icon container for setting
       
    53          *                              field icon.
       
    54          */
       
    55         CPbk2ContactEditorFieldBase(
       
    56                 CPbk2PresentationContactField& aContactField,
       
    57                 MPbk2ContactEditorUiBuilder& aUiBuilder,
       
    58                 CPbk2IconInfoContainer& aIconInfoContainer );
       
    59 
       
    60         /**
       
    61          * Destructor.
       
    62          */
       
    63         ~CPbk2ContactEditorFieldBase();
       
    64 
       
    65     public: // From MPbk2ContactEditorField
       
    66         TInt ControlId() const;
       
    67         CEikEdwin* Control() const = 0;
       
    68         void SaveFieldL() = 0;
       
    69         
       
    70         TBool FieldDataChanged() const;
       
    71         TPtrC FieldLabel() const;
       
    72         void SetFieldLabelL(
       
    73                 const TDesC& aLabel );
       
    74 		    HBufC* ControlTextL() const;
       
    75         void SetFocus();
       
    76         void ActivateL() = 0;
       
    77         MVPbkStoreContactField& ContactField() const;
       
    78         const MPbk2FieldProperty&  FieldProperty() const;
       
    79         void AcceptL(
       
    80                 MPbk2ContactEditorFieldVisitor& aVisitor ) = 0;
       
    81         TBool ConsumesKeyEvent(
       
    82                 const TKeyEvent& aKeyEvent, 
       
    83                 TEventCode aType );
       
    84         TAny* ContactEditorFieldExtension(TUid aExtensionUid );
       
    85    
       
    86    public: // From MPbk2ContactEditorField2
       
    87         TBool HandleCustomFieldCommandL(TInt aCommand);        
       
    88             
       
    89         
       
    90     protected:  // Data
       
    91         /// Ref: The contact field
       
    92         CPbk2PresentationContactField& iContactField;
       
    93         /// Ref: UI builder for adding the field into dialog
       
    94         MPbk2ContactEditorUiBuilder& iUiBuilder;
       
    95         /// Ref: Icon container for setting field icon
       
    96         CPbk2IconInfoContainer& iIconInfoContainer;
       
    97         ///Own: Contact data has changed
       
    98         TBool iContactDataHasChanged;
       
    99     };
       
   100 
       
   101 #endif  // CPBK2CONTACTEDITORFIELDBASE_H
       
   102             
       
   103 // End of File