emailuis/uicomponents/inc/fstextinputfield.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 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:  Declaration of CFsTextInputField class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_TEXTINPUTFIELD_H
       
    20 #define C_TEXTINPUTFIELD_H
       
    21 
       
    22 #include <eikrted.h>
       
    23 
       
    24 class MFsTextInputFieldObserver;
       
    25 class CHuiControl;
       
    26 class CHuiLayout;
       
    27 class CFsTextInputVisual;
       
    28 class CCoeControl;
       
    29 
       
    30 /**
       
    31  * CFsTextInputField class is responsible for providing to the user
       
    32  * interface for the typying text. The entered text is passed to the
       
    33  * text input field observer which informs the FAL controller about
       
    34  * changes in the text. The new itemset in the list is set. The itemset
       
    35  * is based on the typed text.
       
    36  */
       
    37 
       
    38 NONSHARABLE_CLASS( CFsTextInputField ) : public CEikRichTextEditor
       
    39     {
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Input text mode:
       
    44      * EAtomicInput - atomic mode
       
    45      * ENotAtomicInput - normal mode
       
    46      */
       
    47     enum TFsTextInputMode
       
    48         {
       
    49         ENotAtomicInput=1,
       
    50         EAtomicInput
       
    51         };
       
    52 
       
    53     /**
       
    54      * Two-phased constructor
       
    55      *
       
    56      * @param aObserver Observer which will receive events
       
    57      * @return Resturns pointer to the instanse of the CFsTextInputField
       
    58      */
       
    59     static CFsTextInputField* NewL( MFsTextInputFieldObserver& aObserver );
       
    60 
       
    61     /**
       
    62      * Two-phased constructor
       
    63      *
       
    64      * @param aObserver Observer which will receive events
       
    65      * @return Resturns pointer to the instanse of the CFsTextInputField
       
    66      */ 
       
    67     static CFsTextInputField* NewLC( MFsTextInputFieldObserver& aObserver );
       
    68     
       
    69     /**
       
    70      * Destructor
       
    71      */
       
    72     virtual ~CFsTextInputField();
       
    73     
       
    74     /**
       
    75      * Set Text input mode
       
    76      *
       
    77      * @param aMode Input mode {ENotAtomicInput, EAtomicInput}
       
    78      */
       
    79     void SetTextInputMode( const TFsTextInputMode aMode );
       
    80     
       
    81     /**
       
    82      * Returns Text input mode
       
    83      *
       
    84      * @return TFsTextInputMode Input mode {ENotAtomicInput, EAtomicInput}
       
    85      */
       
    86      TFsTextInputMode TextInputMode() const;
       
    87 
       
    88     /**
       
    89      * Set Text input mode
       
    90      *
       
    91      * @param aMode Input mode {ENotAtomicInput, EAtomicInput}
       
    92      */
       
    93      TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, 
       
    94          TEventCode aType );
       
    95 
       
    96 private:
       
    97 
       
    98     /**
       
    99      * Constructor
       
   100      *
       
   101      * @param aObserver Observer which will receive events
       
   102      * @param aOwner Control which will own text input field
       
   103      */
       
   104     CFsTextInputField( MFsTextInputFieldObserver& aObserver );
       
   105     
       
   106     /**
       
   107      * Two phase constructor
       
   108      *
       
   109      * @param aParentLayout Parent layout to which append 
       
   110      *                      the text input field
       
   111      */
       
   112     void ConstructL();    
       
   113     
       
   114 protected:
       
   115 
       
   116     /**
       
   117      * From CEikRichTextEditor
       
   118      * Invoked when changes in text field are made.
       
   119      */
       
   120     void EditObserver ( TInt aStartEdit, TInt aEditLength );
       
   121 
       
   122 private: //data
       
   123 
       
   124     /**
       
   125      * Text input field observer. 
       
   126      * The observer is informed about changes in the text.
       
   127      * Not owned.
       
   128      */
       
   129     MFsTextInputFieldObserver& iObserver;
       
   130     
       
   131     /**
       
   132      * Current input mode of the text input field.
       
   133      */
       
   134     TFsTextInputMode iFsTextInputMode;
       
   135     
       
   136     };
       
   137 
       
   138 
       
   139 #endif  // C_TEXTINPUTFIELD_H