phonebookui/Phonebook2/inc/MPbk2ContactEditorUIField.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 contact editor dialog UI field.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPBK2CONTACTEDITORUIFIELD_H_
       
    19 #define MPBK2CONTACTEDITORUIFIELD_H_
       
    20 
       
    21 // INCLUDES
       
    22 #include <w32std.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CEikEdwin;
       
    27 class MPbk2ContactEditorUiBuilder;
       
    28 class CPbk2IconInfoContainer;
       
    29 class MPbk2UIField;
       
    30 class TPbk2IconId;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * Phonebook 2 contact editor UI base field.
       
    36  */
       
    37 class MPbk2ContactEditorUIField
       
    38     {
       
    39     public:
       
    40         /**
       
    41          * Destructor.
       
    42          */
       
    43     	virtual ~MPbk2ContactEditorUIField(){};
       
    44 
       
    45     
       
    46         /**
       
    47          * Return the dialog control id associated to this field.
       
    48          *
       
    49          * @return  Dialog control id.
       
    50          */
       
    51     	virtual TInt ControlId() = 0;
       
    52 
       
    53         /**
       
    54          * Returns the editor control.
       
    55          *
       
    56          * @return  Editor control.
       
    57          */
       
    58     	virtual CEikEdwin* Control() = 0;
       
    59         
       
    60         /**
       
    61          * Returns the UI field.
       
    62          *
       
    63          * @return  UI field.
       
    64          */
       
    65     	virtual MPbk2UIField* UIField() const = 0;
       
    66 
       
    67         /**
       
    68          * Handles custom field command.
       
    69          *
       
    70          * @param aCommand Custom command id.
       
    71          * @return  ETrue if command was executed.
       
    72          */
       
    73     	virtual TBool HandleCustomFieldCommandL(TInt aCommand) = 0;
       
    74 
       
    75         /**
       
    76          * Returns the contact item fields label.
       
    77          *
       
    78          * @return Field label.
       
    79          */
       
    80         virtual const TDesC& FieldLabel() const = 0;
       
    81 
       
    82         /**
       
    83          * Sets given label as the contact item field's label
       
    84          * Takes ownership of the label.
       
    85          *
       
    86          * @param aLabel    The label to set.
       
    87          */
       
    88         virtual void SetFieldLabelL(
       
    89                 const TDesC& aLabel ) = 0;
       
    90 
       
    91 		/**
       
    92 		 * Returns the text in the fields control.
       
    93          *
       
    94          * @return The text in the control.
       
    95 		 */
       
    96 		virtual const TDesC& ControlText() const = 0;
       
    97 		
       
    98 		/**
       
    99          * Sets given control text as the contact item control text
       
   100          * Takes ownership of the label.
       
   101          *
       
   102          * @param aText    The text to set.
       
   103          */
       
   104 		virtual void SetControlTextL(
       
   105                 const TDesC& aText ) = 0;
       
   106 
       
   107         /**
       
   108          * Sets the editor focus to this field
       
   109          */
       
   110 		virtual void SetFocus() = 0;
       
   111         
       
   112         /**
       
   113          * Activates the control.
       
   114          */
       
   115 		virtual void ActivateL() = 0;
       
   116         
       
   117         /**
       
   118          * Returns ETrue of the editor consumers this key.
       
   119          *
       
   120          * @param aKeyEvent     The key event.
       
   121          * @param aType         Key even type.
       
   122          * @return  ETrue if editor consumes the event.
       
   123          */
       
   124 		virtual TBool ConsumesKeyEvent(
       
   125                 const TKeyEvent& aKeyEvent, 
       
   126                 TEventCode aType ) = 0;
       
   127 		
       
   128 		/**
       
   129          * Loads icon to field.
       
   130          *
       
   131          * @param aIconId     	Icon ID to load.
       
   132          */
       
   133 		virtual void LoadBitmapToFieldL( const TPbk2IconId& aIconId ) = 0;
       
   134     };
       
   135 
       
   136 
       
   137 #endif /*MPBK2CONTACTEDITORUIFIELDBASE_H_*/
       
   138 
       
   139 // End of File