textinput/peninputvkbjp/inc/peninputvkblayout.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     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:  vkb layout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPENINPUTVKBLAYOUT_H
       
    20 #define C_CPENINPUTVKBLAYOUT_H
       
    21 
       
    22 //  System includes
       
    23 #include <peninputcommonlayout.h>
       
    24 
       
    25 /** class forward decalaration */
       
    26 class CPeninputVkbWindow;
       
    27 class CPeninputHiraganaKanji;
       
    28 
       
    29 /**
       
    30  *  peninputvkbjp layout
       
    31  *
       
    32  *  @lib peninputvkbjp.lib
       
    33  *  @since S60 v3.2
       
    34  */
       
    35 class CPeninputVkbLayout : public CPeninputCommonLayout
       
    36     {
       
    37 
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Symbian constructor.
       
    42      *
       
    43      * @since S60 v3.2
       
    44      * @param aLafEnv The LAF enviroment
       
    45      * @param aInitData Init data for layout
       
    46      * @return Pointer to created CPeninputVkbLayout object
       
    47      */
       
    48     static CPeninputVkbLayout* NewL(MLayoutOwner* aLayoutOwner, const TAny* aInitData);
       
    49 
       
    50     /**
       
    51      * destructor.
       
    52      *
       
    53      * @since S60 v3.2
       
    54      * @return None
       
    55      */
       
    56     virtual ~CPeninputVkbLayout();
       
    57 
       
    58     /**
       
    59      * From MFepLayoutBase
       
    60      * HandleEventL. Handle UI event.
       
    61      * There are only 3 kinds of UI event right now: raw event,
       
    62      * pointer and pointer buffer event.
       
    63      *
       
    64      * @since S60 v4.0
       
    65      * @param aType The event type. See TEventType
       
    66      * @param aEventData The event data.
       
    67      * @return The control which processes the event
       
    68      */
       
    69     TBool HandleEventL(TEventType aType, const TAny* aEventData);
       
    70 
       
    71 //from CFepUiLayout
       
    72 
       
    73     /**
       
    74      * From CFepUiLayout.
       
    75      * Handle layout command event
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @param aCmd Command Id.
       
    79      * @param aData Data for command.
       
    80      * @return Errors when return value small than 0.
       
    81      */
       
    82     TInt HandleCommand(TInt aCmd, TUint8* aData);
       
    83 
       
    84     /**
       
    85      * From CFepUiLayout.
       
    86      * Handle the event from control
       
    87      *
       
    88      * @since S60 v3.2
       
    89      * @param aEventType The event type
       
    90      * @param aCtrl  The sender
       
    91      * @param aEventData The event data.
       
    92      * @return None
       
    93      */
       
    94     void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData);
       
    95 
       
    96     /**
       
    97      * From CFepUiLayout.
       
    98      * Handle editor text coming
       
    99      * Called by animation dll when app editor text is coming.
       
   100      * If a ui layout has a editor area, it must implements this function to get the text
       
   101      *
       
   102      * @since S60 v3.2
       
   103      * @param aTotalTextLen The total editor text len
       
   104      * @param aTextStartPos The position of the selection in whole editor text
       
   105      * @param aCursolSel The cursor selection in the editor
       
   106      * @param aText The text sent by fep.
       
   107      * @return KErrNone is operation succeeded.
       
   108      */
       
   109     TInt OnAppEditorTextComing( const TFepInputContextFieldData& aData);
       
   110 
       
   111     /**
       
   112      * From CFepUiLayout.
       
   113      * Handle raw event key
       
   114      *
       
   115      * @since S60 v3.2
       
   116      * @param aData the key raw event data
       
   117      * @return ETrue if the key was handled, otherwise EFalse
       
   118      */
       
   119     TBool HandleRawKeyEventL(const TRawEvent& aKeyEvent);
       
   120 
       
   121     /**
       
   122      * From CFepUiLayout.
       
   123      * Handle pointer down/up event while this event is outside of the layout
       
   124      * Do nothing in default implementation
       
   125      *
       
   126      * @since S60 v4.0
       
   127      * @param aEvent The raw event
       
   128      * @return EFalse if the event needs forward on. Otherwise ETrue.
       
   129      */
       
   130     TBool OnPointerEventOutsideLayout(const TRawEvent& aEvent);
       
   131 
       
   132     /**
       
   133      * Set current range
       
   134      *
       
   135      * @since S60 v3.2
       
   136      * @return None.
       
   137      */
       
   138     void DoSetCurrentRange();
       
   139 
       
   140 private:
       
   141 
       
   142     /**
       
   143      * C++ default constructor
       
   144      *
       
   145      * @since S60 v3.2
       
   146      * @param aLafEnv The LAF enviroment
       
   147      * @return None
       
   148      */
       
   149     CPeninputVkbLayout(MLayoutOwner* aLayoutOwner);
       
   150 
       
   151     /**
       
   152      * Symbian second-phase constructor
       
   153      *
       
   154      * @since S60 v3.2
       
   155      * @param aInitData Init data of layout
       
   156      * @return None
       
   157      */
       
   158     void ConstructL(const TAny* aInitData);
       
   159 
       
   160     /**
       
   161      * CompleteAll HiraganaKanji
       
   162      *
       
   163      * @since S60 v3.2
       
   164      * @return None.
       
   165      */
       
   166     void HiraganaKanjiCompleteAll();
       
   167 
       
   168 // From base class CPeninputCommonLayout
       
   169 
       
   170     /**
       
   171      * From CPeninputCommonLayout
       
   172      * Factory method for creation of layout window. The decision which 
       
   173      * layout window(VKB or HWR) is created will be postboned in subclasses 
       
   174      * of this class
       
   175      *
       
   176      * @since S60 v3.2
       
   177      * @return None
       
   178      */
       
   179     void CreateLayoutWindowL();
       
   180 
       
   181     /**
       
   182      * From CPeninputCommonLayout
       
   183      * Factory method for creation resource config. It is enough at present 
       
   184      * to create and initialize resource config. Any necessary extension 
       
   185      * will be implemented in subclasses
       
   186      * 
       
   187      * @since S60 v3.2
       
   188      * @return None
       
   189      */
       
   190     void CreateDataMgrL( const TAny* aInitData );
       
   191 
       
   192     /**
       
   193      * From CPeninputCommonLayout
       
   194      * Get the layout type, VKB or HWR, child class must rewrite the function
       
   195      * 
       
   196      * @since S60 v3.2
       
   197      * @return The layout type
       
   198      */
       
   199      TInt LayoutType();
       
   200 
       
   201     /**
       
   202      * Translate range by fullhalf
       
   203      *
       
   204      * @since S60 v3.2
       
   205      * @param aRange The range need to set
       
   206      * @return New range
       
   207      */    
       
   208     TInt TranslateRangeHullHalf(TInt aRange) const;
       
   209 
       
   210     // async 
       
   211     static TInt KeyEventCallback(TAny* aThis);
       
   212     static TInt PointerEventCallback(TAny* aThis);
       
   213     void DoKeyEventL();
       
   214     void DoPointerEvent();
       
   215 
       
   216     /**
       
   217      * PointerEvent Capture or not.
       
   218      *
       
   219      * @since S60 V4.0
       
   220      * @param aFlag ETrue Capture on.
       
   221      */
       
   222     void SetCapturePointerEvent(TBool aFlag);
       
   223 
       
   224     /**
       
   225      * After Capture is rereased by fremawork, Capture On again
       
   226      *
       
   227      * @since S60 V4.0
       
   228      */
       
   229     void SetCapturePointerEventAgain();
       
   230 
       
   231     /**
       
   232      * HiraganaHandleControlEventJp
       
   233      *
       
   234      * @since S60 v3.2
       
   235      * @param aEventType The event type
       
   236      * @param aEventData The event data.
       
   237      * @return None
       
   238      */
       
   239     void HiraganaHandleControlEventJp(TInt aEventType, const TDesC& aEventData);
       
   240 
       
   241     /**
       
   242      * check if EStatusPredictiveTransitoryInputWithNoChar
       
   243      *
       
   244      * @since S60 v3.2
       
   245      * @return ETrue if EStatusPredictiveTransitoryInputWithNoChar, otherwise EFalse
       
   246      */
       
   247     TBool IsPredictiveWithNoChar() const;
       
   248 
       
   249 private: //data
       
   250 
       
   251     /**
       
   252      * The vkb window
       
   253      * Not Own
       
   254      */
       
   255     CPeninputVkbWindow* iVkbWindow;
       
   256 
       
   257     /**
       
   258      * The hiraganakanji
       
   259      * Own
       
   260      */
       
   261     CPeninputHiraganaKanji* iHiraganaKanji;
       
   262 
       
   263     /**
       
   264      * status:WaitforEditorTextComing
       
   265      */
       
   266     TInt iWaitforEditorTextComing;
       
   267 
       
   268     /**
       
   269      * The Original InputRange
       
   270      */
       
   271     TInt iRangeOrg;
       
   272 
       
   273     /**
       
   274      * Active object for calling @c KeyEventCallback asynchronously.
       
   275      * Own.
       
   276      */
       
   277     CAsyncCallBack* iKeyEventAsync;
       
   278 
       
   279     /**
       
   280      * Active object for calling @c PointerEventCallback asynchronously.
       
   281      * Own.
       
   282      */
       
   283     CAsyncCallBack* iPointerEventAsync;
       
   284 
       
   285     TRawEvent iKeyEvent;
       
   286     TRawEvent iPointerEventDown;
       
   287     TBool iCapturePointerEvent;
       
   288     };
       
   289 
       
   290 #endif // C_CPENINPUTVKBLAYOUT_H
       
   291 
       
   292 //End Of File