phonebookui/Phonebook2/UIControls/inc/CPbk2ContactEditorRingtoneField.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2008 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 ringtone field.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTEDITORRINGTONEFIELD_H
       
    20 #define CPBK2CONTACTEDITORRINGTONEFIELD_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CPbk2ContactEditorFieldBase.h"
       
    24 #include "CPbk2ContactEditorReadonlyField.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CEikEdwin;
       
    28 class CEikCaptionedControl;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * Phonebook 2 contact editor ringtone field.
       
    34  */
       
    35 NONSHARABLE_CLASS(CPbk2ContactEditorRingtoneField) :
       
    36         public CPbk2ContactEditorFieldBase
       
    37     {
       
    38     public:
       
    39         enum TTextState
       
    40             {
       
    41             ENoData,  //DefaultTone
       
    42             EFilename
       
    43             };
       
    44     
       
    45     public:  // Constructors and destructor
       
    46         
       
    47         /**
       
    48          * Creates a new instance of this class.
       
    49          *
       
    50          * @param aContactField         Contact field.
       
    51          * @param aUiBuilder            UI builder for adding the
       
    52          *                              field into dialog.
       
    53          * @param aIconInfoContainer    Icon container for
       
    54          *                              setting the field icon.
       
    55          * @param aCustomPosition       Position where this custom controls should be placed.
       
    56          * @return  A new instance of this class.
       
    57          */
       
    58         static CPbk2ContactEditorRingtoneField* NewLC(
       
    59                 CPbk2PresentationContactField& aContactField,
       
    60                 MPbk2ContactEditorUiBuilder& aUiBuilder,
       
    61                 CPbk2IconInfoContainer& aIconInfoContainer,
       
    62                 TInt aCustomPosition);
       
    63         
       
    64         /**
       
    65          * Destructor.
       
    66          */
       
    67         virtual ~CPbk2ContactEditorRingtoneField();
       
    68 
       
    69         /**
       
    70          * Returns control id of this custom line.
       
    71          *
       
    72          * @return  Control id.
       
    73          */
       
    74         TInt ControlId() const; 
       
    75 
       
    76     public:
       
    77         void SetTextL();
       
    78         TInt TextState();        
       
    79         
       
    80     private: // From MPbk2ContactEditorField        
       
    81         CEikEdwin* Control() const;
       
    82         void SaveFieldL();
       
    83         void ActivateL();
       
    84         void AcceptL(
       
    85                 MPbk2ContactEditorFieldVisitor& aVisitor );
       
    86         TBool ConsumesKeyEvent
       
    87         	( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    88         TAny* ContactEditorFieldExtension(
       
    89                 TUid aExtensionUid );
       
    90                 HBufC* ControlTextL() const;      
       
    91         TBool HandleCustomFieldCommandL(TInt aCommand );
       
    92         
       
    93     private: // Implementation
       
    94         CPbk2ContactEditorRingtoneField(
       
    95                 CPbk2PresentationContactField& aContactField,
       
    96                 MPbk2ContactEditorUiBuilder& aUiBuilder,
       
    97                 CPbk2IconInfoContainer& aIconInfoContainer );
       
    98         void ConstructL(TInt aCustomPosition);
       
    99         void FormatTextL(TPtrC aDataPtr, TBool aIsDefault);       
       
   100         
       
   101     private: // Data
       
   102         /// Ref: Editor control
       
   103         CPbk2ContactEditorReadonlyField* iControl;
       
   104         /// Ref: Fields captioned control
       
   105         CEikCaptionedControl* iCaptionedCtrl;
       
   106         /// Own: Text content when editor was opened
       
   107         HBufC* iInitialText;
       
   108         TInt iTextState;
       
   109     };
       
   110 
       
   111 #endif // CPBK2CONTACTEDITORRINGTONEFIELD_H
       
   112             
       
   113 // End of File