fep/aknfep/inc/AknFepUiManagerBase.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2003 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:           
       
    15 *       Provides the CAknFepUIManagerBase definition.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #ifndef __AKN_FEP_UI_MANAGER_BASE_H__
       
    31 #define __AKN_FEP_UI_MANAGER_BASE_H__
       
    32 
       
    33 // INCLUDES
       
    34 #include <uikon.hrh>                        //TAknEditorNumericKeymap
       
    35 
       
    36 #include "AknFepManagerUIInterface.h"
       
    37 #include "AknFepManagerInterface.h"
       
    38 #include "AknFepUIManagerStateInterface.h"
       
    39 
       
    40 // CONSTANTS
       
    41 
       
    42 // MACROS
       
    43 
       
    44 // DATA TYPES
       
    45 
       
    46 // FUNCTION PROTOTYPES
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 
       
    50 // CLASS DECLARATION
       
    51 class CPtiEngine;
       
    52 class TAknFepInputStateBase;
       
    53 
       
    54 /**
       
    55  *  CAknFepUIManagerBase class.
       
    56  *
       
    57  *  @lib AknFep.lib
       
    58  *  @since 2.6
       
    59  *
       
    60  */
       
    61 class CAknFepUIManagerBase : 
       
    62             public CBase,
       
    63             public MAknFepManagerInterface,
       
    64             public MAknFepUIManagerStateInterface
       
    65     {
       
    66 private:
       
    67     /**
       
    68      * private constants
       
    69      */
       
    70     enum
       
    71         {
       
    72         EBaseLanguageNumericKeymapIndex = 0x00FF,
       
    73         EMaskShiftOffset                = 8 
       
    74         };
       
    75 
       
    76 public: // Constructors and destructor
       
    77     /**
       
    78      * 
       
    79      * 
       
    80      * @since 2.6
       
    81      */
       
    82     static CAknFepUIManagerBase* NewL(MAknFepManagerUIInterface* aFepMan, 
       
    83                                       CAknFepCaseManager* aCaseMan, TLanguage aLanguage);
       
    84 
       
    85     /**
       
    86      * 
       
    87      * 
       
    88      * @since 2.6
       
    89      */
       
    90     virtual ~CAknFepUIManagerBase();
       
    91 
       
    92 public: // Functions from base classes
       
    93     /**
       
    94      * From MAknFepManagerInterface
       
    95      * 
       
    96      * @since 2.6
       
    97      */
       
    98 #ifdef RD_INTELLIGENT_TEXT_INPUT     
       
    99     void SetMode(TInt aMode, TBool aPredictive, TBool aQwertyInputMode, 
       
   100                  TInt aKeyboardType = EPtiKeyboardNone);
       
   101 #else
       
   102     void SetMode(TInt aMode, TBool aPredictive, TBool aQwertyInputMode);
       
   103 #endif    
       
   104 
       
   105     /**
       
   106      * From MAknFepManagerInterface
       
   107      * 
       
   108      * @since 2.6
       
   109      */
       
   110     void SetCase(TCase aCase);
       
   111 
       
   112     /**
       
   113      * From MAknFepManagerInterface
       
   114      * 
       
   115      * @since 2.6
       
   116      */
       
   117     void SetNumberModeKeyMappingL(TAknEditorNumericKeymap aAknEditorNumericKeymap);
       
   118 
       
   119     /**
       
   120      * From MAknFepManagerInterface
       
   121      * 
       
   122      * @since 2.6
       
   123      */
       
   124     const TDesC& NumberModeKeyMapping() const;
       
   125 
       
   126     /**
       
   127      * From MAknFepManagerInterface
       
   128      * 
       
   129      * @since 2.6
       
   130      */
       
   131     TBool HandleKeyL(TInt aKey, TKeyPressLength aLength, TEventCode aEventCode = EEventKey );
       
   132 
       
   133     /**
       
   134      * From MAknFepManagerInterface
       
   135      * this is in base class only
       
   136      * @since 2.6
       
   137      */
       
   138     void HandleCommandL(TInt aCommandId);
       
   139     void HandleCommandL(TInt aCommandId, TInt aParam);
       
   140 
       
   141     /**
       
   142      * From MAknFepManagerInterface
       
   143      * this should be implemented in each ui manager
       
   144      * 
       
   145      * @since 2.6
       
   146      */
       
   147     void CloseUI();
       
   148 
       
   149     /**
       
   150      * From MAknFepManagerInterface
       
   151      * this is in base class only
       
   152      *
       
   153      * @since 2.6
       
   154      */
       
   155     void ExpireMultitapTimer();
       
   156 
       
   157     /**
       
   158      * From MAknFepManagerInterface
       
   159      * this is in base class only
       
   160      * 
       
   161      * @since 2.6
       
   162      */
       
   163     TBool IsValidNumericLongKeyPress(TInt aKey) const;
       
   164 
       
   165     /**
       
   166      * From MAknFepManagerInterface
       
   167      * this api use in chinese and western
       
   168      * 
       
   169      * @since 2.6
       
   170      */
       
   171     void AddTextToUserDictionaryL(const TDesC& aText);
       
   172 
       
   173     /**
       
   174      * From MAknFepManagerInterface
       
   175      * this should be implemented in each ui manager
       
   176      * 
       
   177      * @since 2.6
       
   178      */
       
   179     void GetFormatOfFepInlineText(TCharFormat& aFormat, TInt& aNumberOfCharactersWithSameFormat, 
       
   180                                   TInt aPositionOfCharacter) const;
       
   181 
       
   182     /**
       
   183      * From MAknFepManagerInterface
       
   184      * 
       
   185      * @since 2.6
       
   186      */
       
   187     virtual TInt SupportLanguage(TInt aMode) const;
       
   188 
       
   189     /**
       
   190      * From MAknFepManagerInterface
       
   191      * 
       
   192      * @since 2.6
       
   193      */
       
   194     virtual void SetInputLanguageL(TLanguage aLanguage);
       
   195 
       
   196     /**
       
   197      * From MAknFepManagerInterface
       
   198      * 
       
   199      * @since 2.6
       
   200      */
       
   201     TBool IsValidShiftKeyPress() const;
       
   202 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   203     TBool IsValidFnKeyPress() const;
       
   204 
       
   205     virtual TBool IsValidLongChrKeyPress() const;
       
   206 
       
   207 #endif
       
   208 
       
   209     /**
       
   210      * From MAknFepManagerInterface
       
   211      * this api use in chinese ui only
       
   212      * 
       
   213      * @since 2.6
       
   214      */
       
   215     void SetEditorContext(TInt aContext);
       
   216 
       
   217     /**
       
   218      * 
       
   219      * 
       
   220      * @since 2.6
       
   221      */
       
   222     void ActivateUI();
       
   223 
       
   224     /**
       
   225      * From MAknFepUIManagerStateInterface
       
   226      * this is in base class only
       
   227      *
       
   228      * @since 2.6
       
   229      */
       
   230     TUIState State() const;
       
   231 
       
   232     /**
       
   233      * From MAknFepUIManagerStateInterface
       
   234      * this should be implemented in each ui manager
       
   235      *
       
   236      * @since 2.6
       
   237      */
       
   238     TUIState ChangeState(TUIState aState);
       
   239 
       
   240     /**
       
   241      * From MAknFepUIManagerStateInterface
       
   242      * this is in base class only
       
   243      *
       
   244      * @since 2.6
       
   245      */
       
   246     MAknFepManagerUIInterface* FepMan() const;
       
   247 
       
   248     /**
       
   249      * From MAknFepUIManagerStateInterface
       
   250      * using instead of PtiEngine()
       
   251      *
       
   252      * @since 2.6
       
   253      */
       
   254     CPtiEngine* PtiEngine() const;
       
   255     
       
   256     // the follow function for phrase creation
       
   257     MZhuyinKeyHandler* ZhuyinKeyHandler();
       
   258     CAknFepZhuyinAnalyser* ZhuyinAnalyser();
       
   259     
       
   260     /**
       
   261      * From MAknFepUIManagerStateInterface
       
   262      * this api use in chinese input states only
       
   263      *
       
   264      * @since 2.6
       
   265      */
       
   266     TBool IsValidChineseInputKey(TInt aKey) const;
       
   267 
       
   268     /**
       
   269      * From MAknFepUIManagerStateInterface
       
   270      * this api use in chinese Qwerty input states only
       
   271      *
       
   272      * @since 3.0
       
   273      */
       
   274     TBool IsValidChineseInputKeyQwerty(TInt aKey) const;
       
   275     
       
   276     /**
       
   277      * From MAknFepUIManagerStateInterface
       
   278      * this api use in chinese Qwerty input states only
       
   279      *
       
   280      * @since 3.0
       
   281      */
       
   282     TBool IsQwertyZhuyinToneMarkKey(TInt aKey) const;
       
   283 
       
   284     /**
       
   285      * this api use in HK Qwerty input states only
       
   286      *
       
   287      * @since 3.0
       
   288      */
       
   289     virtual void UpdateCangJieState();
       
   290     
       
   291     /**
       
   292      * From MAknFepUIManagerStateInterface
       
   293      * this api use in chinese input states only
       
   294      *
       
   295      * @since 3.0
       
   296      */
       
   297     TBool IsValidChineseSymbol(TInt aKey) const;
       
   298     /**
       
   299      * From MAknFepUIManagerStateInterface
       
   300      * this is in base class only
       
   301      * TLanguage is Language identity enumeration defined in e32std.h
       
   302      *
       
   303      * @since 2.6
       
   304      */
       
   305     TLanguage GetLanguage() const;
       
   306 
       
   307     /**
       
   308      * From MAknFepUIManagerStateInterface
       
   309      * 
       
   310      * @since 2.6
       
   311      */
       
   312     CAknFepCaseManager* CaseMan() const;
       
   313 
       
   314     /**
       
   315      * From MAknFepUIManagerStateInterface
       
   316      * 
       
   317      * 
       
   318      * @since 2.6
       
   319      * this api use in chinese ui only
       
   320      */
       
   321     TPtr GetLatestDeliberateSelection() const;
       
   322 
       
   323     /**
       
   324      * From MAknFepUIManagerStateInterface
       
   325      * Thai only
       
   326      *
       
   327      * @since 2.6
       
   328      */
       
   329     TInt ThaiSCTResourceId(TUint aPrewChar, TInt aKey);
       
   330 
       
   331     /**
       
   332      * From MAknFepUIManagerStateInterface
       
   333      * Japanese only
       
   334      *
       
   335      * @since 2.6
       
   336      */
       
   337     CDesCArrayFlat* CandidateArray();
       
   338 
       
   339     /**
       
   340      * From MAknFepUIManagerStateInterface
       
   341      * Japanese only
       
   342      *
       
   343      * @since 2.6
       
   344      */
       
   345     TBool IsPredictive() const;
       
   346 
       
   347     /**
       
   348      * From MAknFepUIManagerStateInterface
       
   349      * Japanese only
       
   350      * 
       
   351      * @since 2.6
       
   352      */
       
   353     void SetInlineEditUnderlineVisibility(TBool aFlag);
       
   354 
       
   355     /**
       
   356      * From MAknFepUIManagerStateInterface
       
   357      *
       
   358      * @since 3.0
       
   359      */
       
   360     TBool IsQwerty() const;
       
   361 
       
   362     /**
       
   363      * From MAknFepUIManagerStateInterface
       
   364      *
       
   365      * @since 3.2
       
   366      */
       
   367     void SetFepAwareEditorText(const TFepInputContextFieldData& /*aIcfData*/);
       
   368 
       
   369     /**
       
   370      * From MAknFepUIManagerStateInterface
       
   371      *
       
   372      * @since 3.2
       
   373      */
       
   374     TInt EditorMaxLength();
       
   375     
       
   376     /**
       
   377      * From MAknFepUIManagerStateInterface
       
   378      *
       
   379      * @since 3.2
       
   380      */
       
   381     void ResourceChanged(TInt aType);
       
   382 
       
   383     /**
       
   384      * From MAknFepUIManagerStateInterface
       
   385      *
       
   386      * @since 3.2
       
   387      */
       
   388     void SetNextFepUI(MAknFepManagerInterface* /*aNextUi*/);
       
   389 
       
   390 	/**
       
   391 	 * Set the Star key flag
       
   392 	 *
       
   393      * @param aSet TBool.
       
   394      * @return None
       
   395 	 */
       
   396 	void SetStarKeyFlag( TBool aSet );
       
   397 
       
   398 protected: // New Functions
       
   399     /**
       
   400      * 
       
   401      * 
       
   402      * @since 2.6
       
   403      */
       
   404     void ConstructL(TLanguage aLanguage);
       
   405 
       
   406     /**
       
   407      * 
       
   408      * 
       
   409      * @since 2.6
       
   410      */
       
   411     CAknFepUIManagerBase(MAknFepManagerUIInterface* aFepMan, CAknFepCaseManager* aCaseMan);
       
   412 
       
   413     /**
       
   414      * 
       
   415      * 
       
   416      * @since 2.6
       
   417      */
       
   418     virtual TAknFepInputStateBase* FepUIState();
       
   419 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__
       
   420 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   421     /**
       
   422      * Removes the character produced by the initial short key press and substitutes
       
   423      * it with the character found behind Fn. If no no Fn-mapping is available, the
       
   424      * function does nothing. Also, in non-QWERTY modes the function does nothing because
       
   425      * ITU-T input states handle long press internally.
       
   426      * @return  ETrue   if key was consumed and no further handling should be made.
       
   427      *                  This is the case when editor is filled up and no more characters can be entered.
       
   428      *          EFalse  if handling of the key event may continue. Either the mode has
       
   429      *                  been changed to Fn mode for the next character or nothing has
       
   430      *                  been done and normal key repeat should happen.
       
   431      * @since 3.2
       
   432      */
       
   433     virtual TBool HandleLongKeyL( TInt aKey );
       
   434     
       
   435     /**
       
   436     * Removes the character produced by the last handled key press. Long press number
       
   437     * entry uses this to remove the character which was entered when the key was pressed
       
   438     * down ("the initially short press character") before the key press turned out to be
       
   439     * a long press.
       
   440     * @return   ETrue   if something was really removed
       
   441     *           EFalse  if nothing was removed (the previous key press had produced no charcters)
       
   442     * @since 3.2
       
   443     */
       
   444     virtual TBool RollbackPreviousCharL();
       
   445 
       
   446 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   447 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__
       
   448 
       
   449 protected: // Data
       
   450     TInt iMode;                         // 
       
   451     TInt iNumericKeymapResourceId;
       
   452     HBufC* iNumericKeymapBuffer;
       
   453     TLanguage iLanguage;                //
       
   454 
       
   455     CPtiEngine* iPtiEngine;             //owned
       
   456 
       
   457     TAknFepInputStateBase* iStatePtr;   // gcc workaround to force compiler to use vtable lookup.
       
   458 
       
   459     MAknFepManagerUIInterface* iFepMan; //not owned
       
   460     CAknFepCaseManager* iCaseMan;       //not owned
       
   461     TBool iPredictive;                  // ETrue: prediction is ON.
       
   462 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   463     // predictive QWERTY changes (e.g. XT9) ---->
       
   464     TBool iQwertyInputMode;             // ETrue: QWERTY mode is ON
       
   465     // predictive QWERTY changes (e.g. XT9) <----
       
   466 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__
       
   467     TInt iPreviousInputSeqLen;
       
   468     TInt iPreviousEditorTextLen;
       
   469     TInt iInputSeqLenDeltaWithLastKey;
       
   470     TInt iEditorTextLenDeltaWithLastKey;
       
   471 #endif //__ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__   
       
   472 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   473     TUIState iInitialFepUIState;        //
       
   474     TInt     iCaseBeforeLongKey;
       
   475     };
       
   476 
       
   477 #endif //__AKN_FEP_UI_MANAGER_BASE_H__
       
   478 
       
   479 // End of file