textinput/peninputcommonlayout/inc/peninputuistatemgr.h
changeset 27 694fa80c203c
parent 24 fc42a86c98e3
child 35 0f326f2e628e
equal deleted inserted replaced
24:fc42a86c98e3 27:694fa80c203c
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Interface of ui state manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPENINPUTUISTATEMGR_H
       
    20 #define C_CPENINPUTUISTATEMGR_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <w32std.h>
       
    25 
       
    26 // User includes
       
    27 #include "peninputuistatemgrinterface.h"
       
    28 
       
    29 // Forward declarations
       
    30 class CPeninputUiStateBase;
       
    31 class MPeninputLayoutContext;
       
    32 
       
    33 /**
       
    34  *  The ui state manager
       
    35  *  It provides get method of all ui state and current ui state
       
    36  *
       
    37  *  @lib peninputcommonlayout.lib
       
    38  *  @since S60 v3.2
       
    39  */
       
    40 class CPeninputUiStateMgr : public CBase, 
       
    41                             public MPeninputUiStateMgr
       
    42     {
       
    43 
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two-phased constructor
       
    48      *
       
    49      * @since S60 v3.2
       
    50      * @param aContext The layout context
       
    51      * @return The pointer to CPeninputUiStateMgr object
       
    52      */
       
    53     IMPORT_C static CPeninputUiStateMgr* NewL( 
       
    54         MPeninputLayoutContext* aContext );
       
    55     
       
    56     /**
       
    57      * Two-phased constructor
       
    58      *
       
    59      * @since S60 v3.2
       
    60      * @param aContext The layout context
       
    61      * @return The pointer to CPeninputUiStateMgr object
       
    62      */    
       
    63     IMPORT_C static CPeninputUiStateMgr* NewLC( 
       
    64         MPeninputLayoutContext* aContext );
       
    65 
       
    66     /**
       
    67      * Destructor
       
    68      *
       
    69      * @since S60 v3.2
       
    70      * @return None
       
    71      */
       
    72     IMPORT_C virtual ~CPeninputUiStateMgr();
       
    73     
       
    74 // from base class MPeninputUiStateMgr
       
    75 
       
    76     /**
       
    77      * From MPeninputUiStateMgr
       
    78      * Get current ui state
       
    79      *
       
    80      * @since S60 v3.2
       
    81      * @return The pointer to CPeninputUiStateBase object
       
    82      */
       
    83     IMPORT_C CPeninputUiStateBase* CurrentUiState();
       
    84     
       
    85     /**
       
    86      * From MPeninputUiStateMgr
       
    87      * Get ui state object according to the input state type
       
    88      *
       
    89      * @since S60 v3.2
       
    90      * @param aUiStateType The type of ui state
       
    91      * @return The pointer to CPeninputUiStateBase object
       
    92      */
       
    93     IMPORT_C CPeninputUiStateBase* GetUiState( TInt aUiStateType ); 
       
    94         
       
    95     /**
       
    96      * From MPeninputUiStateMgr
       
    97      * Set current ui state by state object
       
    98      *
       
    99      * @since S60 v3.2
       
   100      * @param aUiState The state to be set as current ui state
       
   101      * @return None
       
   102      */
       
   103     IMPORT_C void SetCurrentUiState( CPeninputUiStateBase* aUiState );
       
   104 
       
   105     /**
       
   106      * From MPeninputUiStateMgr
       
   107      * Set current ui state by state type
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @param aUiStateType The type of ui state
       
   111      * @return None
       
   112      */
       
   113     IMPORT_C void SetCurrentUiState( TInt aUiStateType );
       
   114     
       
   115     /**
       
   116      * From MPeninputUiStateMgr
       
   117      * Add ui state to list
       
   118      *
       
   119      * @since S60 v3.2
       
   120      * @param aUiState The ui state object to be added to list
       
   121      * @param aUiStateType The ui state type to be added to list
       
   122      * @return None
       
   123      */
       
   124     IMPORT_C void AddUiState( CPeninputUiStateBase* aUiState, 
       
   125                               TInt aUiStateType );
       
   126 
       
   127 protected: //method
       
   128 
       
   129     /**
       
   130      * Symbian second phase constructor
       
   131      *
       
   132      * @since S60 v3.2
       
   133      * @return None
       
   134      */
       
   135     virtual void Construct();
       
   136 
       
   137     /**
       
   138      * Constructor
       
   139      *
       
   140      * @since S60 v3.2
       
   141      * @param aContext The layout context
       
   142      * @return None
       
   143      */
       
   144     CPeninputUiStateMgr( MPeninputLayoutContext* aContext );
       
   145 
       
   146 private: // Data
       
   147 
       
   148     /**
       
   149      * The pointer points to current ui state 
       
   150      * Own
       
   151      */
       
   152     CPeninputUiStateBase* iCurrentState;
       
   153 
       
   154     /**
       
   155      * The pointer points to layout context 
       
   156      * Not own
       
   157      */
       
   158     MPeninputLayoutContext* iContext;
       
   159     
       
   160     /**
       
   161      * Ui state list
       
   162      */
       
   163     RPointerArray<CPeninputUiStateBase> iUiStateList;
       
   164     
       
   165     /**
       
   166      * Ui type list
       
   167      */
       
   168     RArray<TInt> iUiStateTypeList;
       
   169     
       
   170     };
       
   171 
       
   172 #endif // C_CPENINPUTUISTATEMGR_H