fep/aknfep/peninputplugins/peninputimepluginjp/inc/pluginfepmanagerbase.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-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:            Layout UI interface base class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 #ifndef C_PLUGINFEPMANAGERBASE_H
       
    29 #define C_PLUGINFEPMANAGERBASE_H
       
    30 
       
    31 //Include
       
    32 #include <e32base.h>
       
    33 #include <frmtlay.h>
       
    34 #include <eikon.hrh>
       
    35 #include <AknFepManagerInterface.h>
       
    36 #include <peninputcmd.h>
       
    37 
       
    38 //Forward declaration
       
    39 class CPenInputImePluginJp;
       
    40 class RPeninputServer;
       
    41 class CAknEdwinState;
       
    42 class CRepository;
       
    43 /**
       
    44  *  CPluginFepManagerBase is the layout UI interface base class.
       
    45  *  It is something like a "proxy" class of layout UI plugin, sending
       
    46  *  commands from FEP to layout UI plugin.
       
    47  *
       
    48  *  @lib peninputimepluginjp.lib
       
    49  *  @since S60 v3.2
       
    50  */
       
    51 class CPluginFepManagerBase: public CBase, public MAknFepManagerInterface
       
    52     {
       
    53 public:
       
    54 
       
    55     /**
       
    56      * Destructor.
       
    57      */
       
    58     ~CPluginFepManagerBase();
       
    59 
       
    60     /**
       
    61      * Initalize UI when first time starting up.
       
    62      * The first time means when the instance created.
       
    63      *
       
    64      * @since S60 v3.2
       
    65      *
       
    66      * @return None.
       
    67      */
       
    68     virtual void OnInit();
       
    69 
       
    70     /**
       
    71      * Explicitly get ICF max length from layout UI and save the
       
    72      * value to iMaxEditorLength.
       
    73      *
       
    74      * @since S60 v3.2
       
    75      *
       
    76      * @return None.
       
    77      */
       
    78     void RetrieveEditorMaxLength();
       
    79 
       
    80     /**
       
    81      * Update local copy of case mode when
       
    82      * user change case in layout UI.
       
    83      *
       
    84      * @since S60 v3.2
       
    85      *
       
    86      * @param aCaseMode The case mode to save locally.
       
    87      * @return None.
       
    88      */
       
    89     void UpdateCaseMode(TInt aCaseMode);
       
    90 
       
    91 // From MAknFepManagerInterface
       
    92 
       
    93     /**
       
    94      * Set layout UI current number mode key mapping.
       
    95      * For example, 0-9 ; 0-9,*,# and etc.
       
    96      *
       
    97      * @since S60 v3.2
       
    98      *
       
    99      * @param aAknEditorNumericKeymap Key mapping enum value.
       
   100      * @return None.
       
   101      */
       
   102     void SetNumberModeKeyMappingL(TAknEditorNumericKeymap aAknEditorNumericKeymap);
       
   103 
       
   104     /**
       
   105      * Handle key event.
       
   106      * Since most plugin layout UIs are based on animation, they receive
       
   107      * key and process key events before this function.
       
   108      *
       
   109      * @since S60 v3.2
       
   110      *
       
   111      * @param aKey Key event code.
       
   112      * @param aLength Key press length.
       
   113      * @return ETrue if processed, EFalse otherwise.
       
   114      */
       
   115     TBool HandleKeyL(TInt aKey, TKeyPressLength aLength, TEventCode aEventCode = EEventKey);
       
   116 
       
   117     /**
       
   118      * Handle command come from FEP.
       
   119      *
       
   120      * @since S60 v3.2
       
   121      *
       
   122      * @param aCommandId Command id.
       
   123      * @return None
       
   124      */
       
   125     void HandleCommandL(TInt aCommandId);
       
   126 
       
   127     /**
       
   128      * Handle command come from FEP.
       
   129      *
       
   130      * @since S60 v3.2
       
   131      *
       
   132      * @param aCommandId Command id.
       
   133      * @param aParam  Command parameter.
       
   134      * @return None.
       
   135      */
       
   136     void HandleCommandL(TInt aCommandId, TInt aParam);
       
   137 
       
   138     /**
       
   139      * Close plugin layout UI.
       
   140      *
       
   141      * @since S60 v3.2
       
   142      *
       
   143      * @return None.
       
   144      */
       
   145     void CloseUI();
       
   146 
       
   147     /**
       
   148      * Activate plugin layout UI.
       
   149      *
       
   150      * @since S60 v3.2
       
   151      *
       
   152      * @return None.
       
   153      */
       
   154     void ActivateUI();
       
   155 
       
   156     /**
       
   157      * Get max text length of layout UI ICF control.
       
   158      *
       
   159      * @since S60 v3.2
       
   160      * @return Max ICF text length.
       
   161      */
       
   162     TInt EditorMaxLength();
       
   163 
       
   164     /**
       
   165      * When screen size changes, SizeChanged is called by FEP.
       
   166      *
       
   167      * @since S60 v3.2
       
   168      * @return None.
       
   169      */
       
   170     void ResourceChanged(TInt aType);
       
   171 
       
   172     /**
       
   173      * Set underlining UI.
       
   174      * Since plugin layout UI and HKB can be used at same time,
       
   175      * HKB UI layout need to be notified after plugin layout UI
       
   176      * processes some events
       
   177      *
       
   178      * @since S60 v3.2
       
   179      * @param aNextUI The underlining UI pointer.
       
   180      * @return None.
       
   181      */
       
   182     void SetNextFepUI(MAknFepManagerInterface* aNextUi);
       
   183 
       
   184     /**
       
   185      * Get support language in sepecfied mode.
       
   186      * The method leaves here only for compatibility.
       
   187      *
       
   188      * @since S60 v3.2
       
   189      *
       
   190      * @param aMode Input mode.
       
   191      * @return Language supported.
       
   192      */
       
   193     TInt SupportLanguage(TInt aMode) const;
       
   194 
       
   195     /**
       
   196      * Set current language, which is required by editor
       
   197      *
       
   198      * @since S60 v3.2
       
   199      *
       
   200      * @param aLanguage Language to set.
       
   201      * @return None.
       
   202      */
       
   203     void SetInputLanguageL(TLanguage aLanguage);
       
   204 
       
   205     /**
       
   206      * Set editor text and cursor information to layout UI
       
   207      * ICF control.
       
   208      *
       
   209      * @since S60 v3.2
       
   210      * @param aTotalTextLen Total text length in eidtor.
       
   211      * @param aStartPos Offset of aText to the start of editor text.
       
   212      * @param aCursorSel Cursor position.
       
   213      * @param aText A part of editor text start from aStartPos.
       
   214      *
       
   215      * @return None.
       
   216      */
       
   217     void SetFepAwareEditorText(const TFepInputContextFieldData& aIcfData);
       
   218 
       
   219     /**
       
   220      * Set layout UI mode.
       
   221      * The method leaves here only for compatibility
       
   222      *
       
   223      * @since S60 v3.2
       
   224      *
       
   225      * @param aMode Mode to set.
       
   226      * @param aPredictive Whether the current mode support predictive.
       
   227      * @param aWwertyInputMode Whether the current HKB is qwerty.
       
   228      * @return None.
       
   229      */
       
   230 #ifdef RD_INTELLIGENT_TEXT_INPUT          
       
   231     void SetMode(TInt aMode, TBool aPredictive, TBool aQwertyInputMode, 
       
   232                  TInt aKeyboardType = EPtiKeyboardNone) ;
       
   233 #else
       
   234     void SetMode(TInt aMode, TBool aPredictive, TBool aQwertyInputMode);
       
   235 #endif
       
   236 
       
   237 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   238     virtual TBool IsValidFnKeyPress() const;
       
   239     virtual TBool IsValidLongChrKeyPress() const;
       
   240 #endif
       
   241 
       
   242     /**
       
   243      * Set layout UI current case.
       
   244      * The method leaves here only for compatibility. Since plugin layout
       
   245      * UI is different from HKB tranditional UI, they use something like
       
   246      * "case mode" other than case which is set by a FEP command.
       
   247      *
       
   248      * @since S60 v3.2
       
   249      *
       
   250      * @param aCase Case to set.
       
   251      * @return None.
       
   252      */
       
   253     void SetCase(TCase aCase);
       
   254 
       
   255     /**
       
   256      * The method leaves here only for compatibility.
       
   257      *
       
   258      * @since S60 v3.2
       
   259      *
       
   260      * @return None.
       
   261      */
       
   262     void ExpireMultitapTimer();
       
   263 
       
   264     /**
       
   265      * The method leaves here only for compatibility.
       
   266      *
       
   267      * @since S60 v3.2
       
   268      *
       
   269      * @param aKey The key presssed.
       
   270      * @return ETrue if long press, EFalse otherwise.
       
   271      */
       
   272     TBool IsValidNumericLongKeyPress(TInt aKey) const;
       
   273 
       
   274     /**
       
   275      * The method leaves here only for compatibility.
       
   276      *
       
   277      * @since S60 v3.2
       
   278      *
       
   279      * @param aText Text to add to user dictionary.
       
   280      * @return None.
       
   281      */
       
   282     void AddTextToUserDictionaryL(const TDesC& aText);
       
   283 
       
   284     /**
       
   285      * The method leaves here only for compatibility.
       
   286      *
       
   287      * @since S60 v3.2
       
   288      *
       
   289      * @param aFormat On return, contains the formatting to
       
   290      *        apply to the inline text (or to a portion of it).
       
   291      * @param aNumberOfCharactersWithSameFormat  On return,
       
   292               contains the number of characters in the inline
       
   293               text (starting at aPositionOfCharacter)
       
   294               which have the same formatting
       
   295      * @param aPositionOfCharacter Start position within the inline text
       
   296      * @return None.
       
   297      */
       
   298     void GetFormatOfFepInlineText(TCharFormat& aFormat,
       
   299                                   TInt& aNumberOfCharactersWithSameFormat,
       
   300                                   TInt aPositionOfCharacter) const;
       
   301 
       
   302     /**
       
   303      * The method leaves here only for compatibility.
       
   304      *
       
   305      * @since S60 v3.2
       
   306      *
       
   307      * @return ETrue if valid, EFalse otherwise.
       
   308      */
       
   309     TBool IsValidShiftKeyPress() const;
       
   310 
       
   311     /**
       
   312      * The method leaves here only for compatibility.
       
   313      *
       
   314      * @since S60 v3.2
       
   315      *
       
   316      * @return None.
       
   317      */
       
   318     void SetEditorContext(TInt aContext);
       
   319 
       
   320     /**
       
   321      * Set the Star key flag
       
   322      *
       
   323      * @param aSet TBool.
       
   324      * @return None
       
   325      */
       
   326     void SetStarKeyFlag( TBool aSet );
       
   327 
       
   328     /**
       
   329      * Check the character width.
       
   330      *
       
   331      * @since S60 v3.2
       
   332      *
       
   333      * @return ETrue is Full-width.
       
   334      */
       
   335     TBool IsCharWidth() const;
       
   336 
       
   337     /**
       
   338      * Check the Japanese predictive.
       
   339      *
       
   340      * @since S60 v3.2
       
   341      *
       
   342      * @return ETrue is predictive on.
       
   343      */
       
   344     TBool IsJapanesePredictive() const;
       
   345 
       
   346     /**
       
   347      * Check the Japanese HWR conversion.
       
   348      *
       
   349      * @since S60 v3.2
       
   350      *
       
   351      * @return ETrue is Japanese HWR conversion on.
       
   352      */
       
   353     TBool IsJapaneseHwrConversion() const;
       
   354 
       
   355 protected:
       
   356 
       
   357     /**
       
   358      * C++ default constructor.
       
   359      *
       
   360      * @since S60 v3.2
       
   361      * @param aOwner IME plugin pointer.
       
   362      * @param aPenInputServer Pen input server pointer
       
   363      */
       
   364     CPluginFepManagerBase(CPenInputImePluginJp& aOwner,
       
   365                           RPeninputServer* aPenInputServer);
       
   366 
       
   367     /**
       
   368      * By default Symbian 2nd phase constructor.
       
   369      *
       
   370      * @since S60 v3.2
       
   371      * @return None
       
   372      */
       
   373     void BaseConstructL();
       
   374 
       
   375     /**
       
   376      * Set layout permited ranges.
       
   377      *
       
   378      * @param aPermittedMode Ranges of current editor allowed.
       
   379      * @return None
       
   380      */
       
   381     virtual void SetLayoutPermitedRanges(TInt aPermittedRanges);
       
   382 
       
   383     /**
       
   384      * Set layout primary range.
       
   385      *
       
   386      * @since S60 v3.2
       
   387      * @param aEditorState Current editor state.
       
   388      * @return None
       
   389      */
       
   390     virtual void SetLayoutRange(const CAknEdwinState* aEditorState);
       
   391 
       
   392     /**
       
   393      * Send command to pen input server utility function.
       
   394      *
       
   395      * @since S60 v3.2
       
   396      * @param aCommandId The command id to sent.
       
   397      * @return None
       
   398      */
       
   399     void SendCommandToServer(TInt aCommandId);
       
   400 
       
   401     /**
       
   402      * Send command to pen input server utility function.
       
   403      *
       
   404      * @since S60 v3.2
       
   405      * @param aCommandId The command id to sent.
       
   406      * @param aParam The command param.
       
   407      * @return None
       
   408      */
       
   409     void SendCommandToServer(TInt aCommandId, TInt aParam);
       
   410 
       
   411     /**
       
   412      * Send command to pen input server utility function.
       
   413      *
       
   414      * @since S60 v3.2
       
   415      * @param aCommandId The command id to sent.
       
   416      * @param aParam The command param.
       
   417      * @return None
       
   418      */
       
   419     void SendCommandToServer(TInt aCommandId, const TDesC8& aParam);
       
   420 
       
   421     /**
       
   422      * Get layout UI last used range.
       
   423      *
       
   424      * @since S60 v3.2
       
   425      * @return Range last used.
       
   426      */
       
   427     TInt LayoutLastUsedRange();
       
   428 
       
   429     /**
       
   430      * Set layout UI position.
       
   431      * Move layout UI not to overlap with some editors.
       
   432      *
       
   433      * @since S60 v3.2
       
   434      * @param aBottomRight The bottom right position of layout UI.
       
   435      *        The value is only a suggest value, layout UI may adjust it.
       
   436      * @return None.
       
   437      */
       
   438     void SetLayoutPosition(const TRect& aParam);
       
   439 
       
   440     TLanguage GetLocalLanguage(const CAknEdwinState* aEditorState) const;
       
   441 
       
   442     /**
       
   443      * Save the current information.
       
   444      *
       
   445      * @since S60 v3.2
       
   446      * @param aParam
       
   447      */
       
   448     void SaveCurrentInfo(const TInt aParam);
       
   449 
       
   450 protected:
       
   451 
       
   452     /**
       
   453      * IME plugin reference.
       
   454      */
       
   455     CPenInputImePluginJp& iOwner;
       
   456 
       
   457     /**
       
   458      * Pen input server pointer. Not own.
       
   459      */
       
   460     RPeninputServer* iPenInputServer;
       
   461 
       
   462     /**
       
   463      * The premitted range of current editor.
       
   464      */
       
   465     TInt iPermittedRange;
       
   466 
       
   467     TInt iHkbMode;
       
   468 
       
   469     /**
       
   470      * Current language.
       
   471      */
       
   472     TLanguage    iLanguage;
       
   473 
       
   474     /**
       
   475      * The width of character, Full-width(ETrue)
       
   476      * or Half-width(EFalse)
       
   477      */
       
   478     TBool iCharWidth;
       
   479 
       
   480     /**
       
   481      * Predictive is ON(ETrue) or OFF(EFalse).
       
   482      */
       
   483     TBool iPredictive;
       
   484 
       
   485     /**
       
   486      * Conversion is ON(ETrue) or OFF(EFalse).
       
   487      */
       
   488     TBool iConversion;
       
   489 
       
   490 private:
       
   491 
       
   492     /**
       
   493      * Repository object used to get last used range.
       
   494      */
       
   495     CRepository* iRepository;
       
   496 
       
   497     /**
       
   498      * Local copy of ICF max text length.
       
   499      */
       
   500     TInt iMaxEditorLength;
       
   501 
       
   502     /**
       
   503      * Local copy of layout current case mode
       
   504      */
       
   505     TInt iLastCase;
       
   506 
       
   507     /**
       
   508      * Underlineing UI interface
       
   509      */
       
   510     MAknFepManagerInterface* iHkbUi;
       
   511 
       
   512     /**
       
   513      * subrage for ERangeNative
       
   514      */
       
   515     TInt iSubRange;
       
   516     };
       
   517 #endif // C_PLUGINFEPMANAGERBASE_H
       
   518 
       
   519 // End Of File