textinput/peninputcommonctrlsjp/inc/peninputhiraganakanji.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2009 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:  CPeninputHiraganaKanji
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPENINPUTHIRAGANAKANAKANJI_H
       
    20 #define C_CPENINPUTHIRAGANAKANAKANJI_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <w32std.h>
       
    25 #include <peninputcmdparam.h>
       
    26 #include <badesca.h>
       
    27 #include <peninputpluginutils.h>
       
    28 
       
    29 
       
    30 class CPtiEngine;
       
    31 class CFepUiLayout;
       
    32 class CFepInputContextFieldJp;
       
    33 class CPeninputJapaneseCandidateWnd;
       
    34 class CPeninputJapanesePredictiveWnd;
       
    35 
       
    36 class CPeninputHiraganaKanji: public CBase, public MAknFepTimerHandler
       
    37     {
       
    38 
       
    39 public:
       
    40     /**
       
    41      *  HiraganaKanji Status.
       
    42      *
       
    43      *  @lib peninputcommonctrlsjp.lib
       
    44      *  @since S60 v3.2 
       
    45      */
       
    46     enum THiraganaKanjiStatus
       
    47         {
       
    48         EStatusInitial = 0,
       
    49         EStatusTransitoryInput,
       
    50         EStatusPredictiveTransitoryInput,
       
    51         EStatusPredictiveTransitoryInputWithNoChar,
       
    52         EStatusConversion,
       
    53         EStatusCandidate,
       
    54         EStatusChangeDivision,        // Change Conversion Unit Division
       
    55         EStatusComplete,              // wait SetEditorTextL
       
    56         EStatusCompleteAll,            // wait SetEditorTextL
       
    57         EStatusCompleteAllfromUiLayout // wait SetEditorTextL
       
    58         };
       
    59     /**
       
    60      * Symbian constructor.
       
    61      *
       
    62      * @since S60 v3.2
       
    63      * @param aPtiEngine
       
    64      * @param aInputContextField
       
    65      * @param aCandidateWnd
       
    66      * @param aPredictiveWnd
       
    67      * @return Pointer to created CPeninputHiraganaKanji object
       
    68      */
       
    69     IMPORT_C static CPeninputHiraganaKanji* NewL(CPtiEngine* aPtiEngine
       
    70                                              , CFepUiLayout* aUiLayout
       
    71                                              , CFepInputContextFieldJp* aInputContextField
       
    72                                              , CPeninputJapaneseCandidateWnd* aCandidateWnd
       
    73                                              , CPeninputJapanesePredictiveWnd* aPredictiveWnd);
       
    74 
       
    75     /**
       
    76      * destructor
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @return None
       
    80      */
       
    81     IMPORT_C virtual ~CPeninputHiraganaKanji();
       
    82 
       
    83     /**
       
    84      * HandleControlEventJpL
       
    85      *
       
    86      * @since S60 v3.2
       
    87      * @param aEventType The event type
       
    88      * @param aEventData The event data.
       
    89      * @return None
       
    90      */
       
    91     IMPORT_C void HandleControlEventJpL(TInt aEventType, const TDesC& aEventData);
       
    92 
       
    93     /**
       
    94      * Handling keypress events. only judgment
       
    95      *
       
    96      * @since S60 v3.2
       
    97      * @param aData Carry information of key pressed
       
    98      * @return ETrue means event was responsed, otherwise EFalse
       
    99      */
       
   100     IMPORT_C TBool HandleKeyEvent(const TRawEvent &aData);
       
   101 
       
   102     /**
       
   103      * Handling keypress events.
       
   104      *
       
   105      * @since S60 v3.2
       
   106      * @return ETrue means event was responsed, otherwise EFalse
       
   107      */
       
   108     IMPORT_C TBool HandlePendingEventL();
       
   109 
       
   110     /**
       
   111      * Sets the text from the editor to ContextField
       
   112      *
       
   113      * @since S60 V4.0
       
   114      * typedef struct TFepInputContextFieldData_Tag
       
   115      *    {    
       
   116      *    TInt iTotalTextLen; //total text length in app editor
       
   117      *    TInt iTextStartPos; //The start position for text sending to input context field
       
   118      *     TCursorSelection iCurSel; //current cursor selection 
       
   119      *    TPtrC iText; // The text sent to input context field
       
   120      *    TBool iCursorVisibility; // Cursor visibility flag, indicates whether cursor need 
       
   121      *                           // be shown in input context field.
       
   122      *    } TFepInputContextFieldData;
       
   123      */
       
   124     IMPORT_C void SetEditorTextL(const TFepInputContextFieldData& aData);
       
   125 
       
   126     /**
       
   127      * Cancel repeat
       
   128      *
       
   129      * @since S60 v3.2
       
   130      * @return None
       
   131      */
       
   132     IMPORT_C void CancelRepeat();
       
   133 
       
   134     /**
       
   135      * start key repeat
       
   136      *
       
   137      * @since S60 v3.2
       
   138      * @return None
       
   139      */
       
   140     IMPORT_C void RepeatClearKeyStart();
       
   141 
       
   142     /**
       
   143      * from MAknFepTimerHandler
       
   144      * HandleTimerOut. Handling time out event
       
   145      *
       
   146      * @since S60 v3.2
       
   147      * @param aTimer The timer which sending the request
       
   148      * @return None
       
   149      */                
       
   150     void HandleTimerOut(const CAknFepTimer* aTimer);
       
   151 
       
   152 private:
       
   153 
       
   154     /**
       
   155      * C++ constructor
       
   156      *
       
   157      * @since S60 v3.2
       
   158      * @param aPtiEngine
       
   159      * @param aInputContextField
       
   160      * @param aCandidateWnd
       
   161      * @param aPredictiveWnd
       
   162      * @return None
       
   163      */            
       
   164     CPeninputHiraganaKanji(CPtiEngine* aPtiEngine
       
   165                                 , CFepUiLayout* aUiLayout
       
   166                                 , CFepInputContextFieldJp* aInputContextField
       
   167                                 , CPeninputJapaneseCandidateWnd* aCandidateWnd
       
   168                                 , CPeninputJapanesePredictiveWnd* aPredictiveWnd);
       
   169 
       
   170     /**
       
   171      * Second phase constructor
       
   172      *
       
   173      * @since S60 v3.2
       
   174      * @return None
       
   175      */
       
   176     void ConstructL();
       
   177 
       
   178     /**
       
   179      * Insert a Character
       
   180      *
       
   181      * @param aEventData character data
       
   182      * @return None
       
   183      */
       
   184     void HandleInsertL(const TDesC& aEventData);
       
   185 
       
   186     /**
       
   187      * Clear Characters(not used)
       
   188      *
       
   189      * @since S60 v3.2
       
   190      * @return None
       
   191      */
       
   192     void ClearTextL();
       
   193 
       
   194     /**
       
   195      * complete
       
   196      *
       
   197      * @since S60 v3.2
       
   198      * @return None
       
   199      */
       
   200     void CompleteL();
       
   201 
       
   202     /**
       
   203      * complete all
       
   204      *
       
   205      * @since S60 v3.2
       
   206      * @return None
       
   207      */
       
   208     void CompleteAllL();
       
   209 
       
   210     /**
       
   211      * do complete
       
   212      *
       
   213      * @since S60 v3.2
       
   214      * @return None
       
   215      */
       
   216     void CompleteSubL();
       
   217 
       
   218     /**
       
   219      * delete one character
       
   220      *
       
   221      * @since S60 v3.2
       
   222      * @return None
       
   223      */
       
   224     void HandleBackL();
       
   225 
       
   226     /**
       
   227      * Update InputContextFieldL
       
   228      *
       
   229      * @since S60 v3.2
       
   230      * @return None
       
   231      */
       
   232     void UpdateContextFieldL();
       
   233 
       
   234     /**
       
   235      * Update Popup
       
   236      *
       
   237      * @since S60 v3.2
       
   238      * @return None
       
   239      */
       
   240     void UpdateCandidateListL();
       
   241 
       
   242     /**
       
   243      * Cancel Transitory Input
       
   244      *
       
   245      * @since S60 v3.2
       
   246      * @return None
       
   247      */
       
   248     void CancelL();
       
   249 
       
   250 private:  //data
       
   251     /**
       
   252      * The pti engine
       
   253      * Not Own
       
   254      */
       
   255     CPtiEngine* iPtiEngine;
       
   256 
       
   257     /**
       
   258      * UiLayout
       
   259      * Not Own
       
   260      */
       
   261     CFepUiLayout* iUiLayout;
       
   262 
       
   263     /**
       
   264      * The input context field
       
   265      * Not Own
       
   266      */
       
   267     CFepInputContextFieldJp* iInputContextField;
       
   268 
       
   269     /**
       
   270      *  HiraganaKanji Status.
       
   271      */
       
   272     THiraganaKanjiStatus iStatus;
       
   273 
       
   274     /**
       
   275      * The candidate popup window
       
   276      * Not Own
       
   277      */
       
   278     CPeninputJapaneseCandidateWnd* iCandidateWnd;
       
   279 
       
   280     /**
       
   281      * The predictive popup window
       
   282      * Not Own
       
   283      */
       
   284     CPeninputJapanesePredictiveWnd* iPredictiveWnd;
       
   285 
       
   286     /**
       
   287      * The predictive/candidate array
       
   288      * Own
       
   289      */
       
   290     CDesCArrayFlat* iCandidateArray;
       
   291 
       
   292     /**
       
   293      * The next Char
       
   294      * Own
       
   295      */
       
   296     HBufC* iChar; // own
       
   297 
       
   298     /**
       
   299      * The pending event
       
   300      */    
       
   301     TInt iPendingEvent;  // 0:nothing
       
   302 
       
   303     /**
       
   304      * The pending event is repeated or not
       
   305      */    
       
   306     TInt iRepeat;  // 1:repeated
       
   307 
       
   308     /**
       
   309      * long press timer (Own)
       
   310      */
       
   311     CAknFepTimer* iLongPressTimer;
       
   312 
       
   313     /**
       
   314      * repeat timer (Own)
       
   315      */
       
   316     CAknFepTimer* iRepeatTimer;
       
   317     };
       
   318 
       
   319 #endif //C_CPENINPUTHIRAGANAKANAKANJI_H
       
   320 
       
   321 //  End Of File