textinput/peninputcommonlayout/inc/peninputdatamgr.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     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:  Implementation of the common layout data manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPENINPUTDATAMGR_H
       
    20 #define C_CPENINPUTDATAMGR_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <w32std.h>
       
    25 #include <peninputpluginutils.h>
       
    26 #include <coemain.h>
       
    27 
       
    28 // User includes
       
    29 #include "peninputdataprovider.h"
       
    30 
       
    31 // Forward decalaration
       
    32 class MPeninputLayoutContext;
       
    33 class CRepository;
       
    34 
       
    35 /**
       
    36  *  Data manager implementation
       
    37  *
       
    38  *  @lib peninputcommonlayout.lib
       
    39  *  @since S60 v3.2
       
    40  */
       
    41 class CPeninputDataMgr : public CBase,
       
    42                          public MPeninputDataProvider
       
    43     {
       
    44 
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Create one CPeninputDataMgr object
       
    49      *
       
    50      * @since S60 v3.2
       
    51      * @param aContext The layout context
       
    52      * @return The pointer to CPeninputDataMgr object
       
    53      */
       
    54     IMPORT_C static CPeninputDataMgr* NewL( 
       
    55         MPeninputLayoutContext* aContext );
       
    56 
       
    57     /**
       
    58      * Create one CPeninputDataMgr object
       
    59      *
       
    60      * @since S60 v3.2
       
    61      * @param aContext The layout context
       
    62      * @return The pointer to CPeninputDataMgr object
       
    63      */
       
    64     IMPORT_C static CPeninputDataMgr* NewLC( 
       
    65         MPeninputLayoutContext* aContext );
       
    66 
       
    67     /**
       
    68      * Destructor
       
    69      *
       
    70      * @since S60 v3.2
       
    71      * @return None
       
    72      */
       
    73     IMPORT_C virtual ~CPeninputDataMgr();
       
    74 
       
    75     /**
       
    76      * Other initialization
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @return None
       
    80      */
       
    81     IMPORT_C virtual void InitMore();
       
    82 
       
    83     /**
       
    84      * Call back function, which is called when some key changed
       
    85      *
       
    86      * @since S60 v3.2
       
    87      * @param aChangedKey The key whose value is changed
       
    88      * @return None
       
    89      */
       
    90     IMPORT_C virtual void HandleGSRepositoryChange( TInt aChangedKey );
       
    91 
       
    92     /**
       
    93      * Notify engine that some data changed
       
    94      *
       
    95      * @since S60 v3.2
       
    96      * @param aType The type of the data to be notified
       
    97      * @param aData The pointer to the notified data
       
    98      * @return None
       
    99      */
       
   100     IMPORT_C virtual void NotifyEngine( TPeninputDataType aType, 
       
   101                                         TAny* aData );
       
   102                                         
       
   103     IMPORT_C TBool IsShiftPermitted();
       
   104     IMPORT_C TBool IsCapsLockPermitted();
       
   105 
       
   106 // From base class MPeninputDataProvider
       
   107 
       
   108     /**
       
   109      * From MPeninputDataProvider
       
   110      * Request data according to the data type
       
   111      *
       
   112      * @since S60 v3.2
       
   113      * @param aDataType The data type need to get
       
   114      * @return The pointer to TAny type required data
       
   115      */
       
   116     IMPORT_C TAny* RequestData( TPeninputDataType aDataType );
       
   117 
       
   118     /**
       
   119      * From MPeninputDataProvider
       
   120      * Set data according to the data type
       
   121      *
       
   122      * @since S60 v3.2
       
   123      * @param aDataType The data type need to set
       
   124      * @param aData The pointer to the new setting data
       
   125      * @return None
       
   126      */
       
   127     IMPORT_C void SetData( TPeninputDataType aDataType, TAny* aData );
       
   128 
       
   129     /**
       
   130      * From MPeninputDataProvider
       
   131      * Reset data contained in data manager
       
   132      *
       
   133      * @since S60 v3.2
       
   134      * @return None
       
   135      */
       
   136     IMPORT_C virtual void Reset();
       
   137 
       
   138     /**
       
   139      * From MPeninputDataProvider
       
   140      * Save data into AknFepRepository
       
   141      *
       
   142      * @since S60 v3.2
       
   143      * @param aKey The key name
       
   144      * @param aValue The key value
       
   145      * @return None
       
   146      */
       
   147     IMPORT_C virtual void SaveKey( TInt aKey, TInt aValue );
       
   148 
       
   149 protected:
       
   150 
       
   151     /**
       
   152      * Constructor
       
   153      *
       
   154      * @since S60 v3.2
       
   155      * @param aContext The layout context
       
   156      * @return None.
       
   157      */
       
   158     IMPORT_C CPeninputDataMgr( MPeninputLayoutContext* aContext );
       
   159 
       
   160     /**
       
   161      * 2nd constructor function
       
   162      *
       
   163      * @since S60 v3.2
       
   164      * @return None.
       
   165      */
       
   166     IMPORT_C void ConstructL();
       
   167 
       
   168     /**
       
   169      * Handle notification from CenRep monitor
       
   170      *
       
   171      * @since S60 v3.2
       
   172      * @param aPtr The pointer to callback data
       
   173      * @return The result value.
       
   174      */
       
   175     IMPORT_C static TInt HandleGSRepositoryCallBack( TAny* aPtr );
       
   176 
       
   177 private:
       
   178 
       
   179      /**
       
   180      * Set Screen Mode
       
   181      *
       
   182      * @since S60 v3.2
       
   183      * @param aScreenMode The reference of the screen mode data
       
   184      * @return None
       
   185      */
       
   186     void SetScreenMode( const TPixelsTwipsAndRotation& aScreenMode );
       
   187 
       
   188 protected: // Data
       
   189 
       
   190     /**
       
   191      * The case
       
   192      */
       
   193     TInt iCase;
       
   194 
       
   195     /**
       
   196      * The peninput language
       
   197      */
       
   198     TInt iInputLanguage;
       
   199 
       
   200     /**
       
   201      * The permitted range
       
   202      */
       
   203     TInt iPermittedRange;
       
   204 
       
   205     /**
       
   206      * The permitted case
       
   207      */
       
   208     TInt iPermittedCase;
       
   209     
       
   210     /**
       
   211      * The current range
       
   212      */
       
   213     TInt iCurrentRange;
       
   214 
       
   215     /**
       
   216      * The client layout
       
   217      */
       
   218     TInt iClientLayout;
       
   219 
       
   220     /**
       
   221      * The vkb layout
       
   222      */
       
   223     TInt iVkbLayoutId;
       
   224 
       
   225     /**
       
   226      * The editor numeric key map
       
   227      */
       
   228     TInt iEditorNumericKeymap;
       
   229 
       
   230     /**
       
   231      * The editor numeric key map
       
   232      */
       
   233     TBool iEnableSwitchBtn;
       
   234     
       
   235     /**
       
   236      * The flag of shift down
       
   237      */
       
   238     TBool iShiftDown;
       
   239 
       
   240     /**
       
   241      * The flag of capslock down
       
   242      */
       
   243     TBool iCapslockDown;
       
   244 
       
   245     /**
       
   246      * The current accent
       
   247      */
       
   248     TInt iCurrentAccent;
       
   249 
       
   250     /**
       
   251      * The window position
       
   252      */
       
   253     TInt iWindowPosition;
       
   254 
       
   255     /**
       
   256      * The screen mode
       
   257      */
       
   258     TPixelsTwipsAndRotation iScreenMode;
       
   259 
       
   260     /**
       
   261      * The screen size
       
   262      */
       
   263     TSize iScreenSize;
       
   264 
       
   265     /**
       
   266      * The unit width
       
   267      */
       
   268     TInt iUnitWidth;
       
   269 
       
   270     /**
       
   271      * The unit height
       
   272      */
       
   273     TInt iUnitHeight;
       
   274 
       
   275     /**
       
   276      * The setting id for window postion
       
   277      */
       
   278     TInt iPositionSettingId;
       
   279 
       
   280     /**
       
   281      * The rectangle of data query dialog
       
   282      */
       
   283     TRect iDataQueryDlgRect;
       
   284     
       
   285     /**
       
   286      * The layout context
       
   287      * Not own
       
   288      */
       
   289     MPeninputLayoutContext* iContext;
       
   290 
       
   291     /**
       
   292      * The global setttings repository
       
   293      * Own
       
   294      */
       
   295     CRepository* iGSRepository;
       
   296 
       
   297     /**
       
   298      * The aknfep repository
       
   299      * Own
       
   300      */
       
   301     CRepository* iAknFepRepository;
       
   302 
       
   303     /**
       
   304      * The repository watcher, 
       
   305      * which will monitor change of the language and guide line
       
   306      * Own
       
   307      */
       
   308     CAknFepRepositoryWatcher* iGSRepositoryWatcher;
       
   309 
       
   310     /**
       
   311      * The user defined resource for number
       
   312      * Own
       
   313      */    
       
   314     HBufC* iUserDefinedResource;    
       
   315     
       
   316     /**
       
   317      * The reserve data
       
   318      * not Own
       
   319      */
       
   320     TAny* iReserve_1;
       
   321     
       
   322     /**
       
   323      * The position of the top guide line
       
   324      */
       
   325     TInt iGuideLineTop;
       
   326     
       
   327     /**
       
   328      * The position of the bottom guide line
       
   329      */
       
   330     TInt iGuideLineBottom;
       
   331 
       
   332     /**
       
   333      * Layout size changing flag
       
   334      */
       
   335     TBool iLayoutSizeChanging;
       
   336     
       
   337     /**
       
   338      * Indicate whether unit width has been set
       
   339      */
       
   340     TBool iUnitWidthSet;
       
   341 
       
   342     /**
       
   343      * Indicate whether unit height has been set
       
   344      */
       
   345     TBool iUnitHeightSet;
       
   346 
       
   347     /**
       
   348      * Indicate whether DeadKey has been latched
       
   349      */
       
   350     TBool iLatched;
       
   351     
       
   352      /**
       
   353      * Indicate whether unitsize has been changed
       
   354      */
       
   355     TBool iUnitSizeSet;
       
   356     
       
   357     TBool iAllowCaseChange;
       
   358     };
       
   359 
       
   360 #endif // C_CPENINPUTDATAMGR_H