textinput/peninputhwrboxcn/inc/peninputhwrbxlayout.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:  boxbase hwr layout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CAKNFEPHWRBXLAYOUT_H
       
    20 #define C_CAKNFEPHWRBXLAYOUT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <peninputlayout.h>
       
    24 #include <peninputlayoutplugininterface.h>
       
    25 
       
    26 class CAknFepHwrBxDataStore;
       
    27 class CAknFepHwrBxWnd;
       
    28 class CAknFepHwrBxStateBase;
       
    29 class MLayoutOwner;
       
    30 class MPenInputModeSwitchInterface;
       
    31 
       
    32 /**
       
    33  *  peninputhwrboxcn layout interface implemtation
       
    34  *
       
    35  *  @lib peninputhwrboxcn.lib
       
    36  *  @since S60 v3.2
       
    37  */
       
    38 class CAknFepHwrBxLayoutImp : public CFepUiLayoutInterface
       
    39     {
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Symbian constructor.
       
    44      *
       
    45      * @since S60 v3.2
       
    46      * @param aInitParams Init data for layout
       
    47      * @return Pointer to created CAknFepHwrBxLayoutImp object
       
    48      */
       
    49     static CAknFepHwrBxLayoutImp* NewL(TAny* aInitParams);
       
    50     
       
    51     /**
       
    52      * destructor.
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @return None
       
    56      */
       
    57     virtual ~CAknFepHwrBxLayoutImp();
       
    58 
       
    59 //from CFepUiLayoutInterface
       
    60 
       
    61     /**
       
    62      * From CFepUiLayoutInterface.
       
    63      * Handle layout command event
       
    64      *
       
    65      * @since S60 v3.2
       
    66      * @param aLayoutOwner The layout owner
       
    67      * @param aData The data for creating layout
       
    68      * @return Pointer to created CFepUiLayout object
       
    69      */
       
    70     MPenUiLayoutBase* CreateFepUiLayoutL(MLayoutOwner* aLayoutOwner,const TAny* aData);
       
    71 
       
    72 private:
       
    73 
       
    74     /**
       
    75      * C++ default constructor
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @return None
       
    79      */          
       
    80     CAknFepHwrBxLayoutImp();
       
    81 
       
    82     /**
       
    83      * Symbian second-phase constructor
       
    84      *
       
    85      * @since S60 v3.2
       
    86      * @return None
       
    87      */          
       
    88     void ConstructL();
       
    89 
       
    90 private:// data
       
    91     
       
    92     };  
       
    93 
       
    94 /**
       
    95  *  peninputhwrboxcn layout
       
    96  *
       
    97  *  @lib peninputhwrboxcn.lib
       
    98  *  @since S60 v3.2
       
    99  */
       
   100 class CAknFepHwrBxLayout : public CFepUiLayout
       
   101     {
       
   102 public:
       
   103 
       
   104     /**
       
   105      * Symbian constructor.
       
   106      *
       
   107      * @since S60 v3.2
       
   108      * @param aLafEnv The LAF enviroment
       
   109      * @param aInitData Init data for layout
       
   110      * @return Pointer to created CAknFepHwrBxLayout object
       
   111      */
       
   112     static CAknFepHwrBxLayout* NewL(MLayoutOwner* aLayoutOwner, const TAny* aInitData);
       
   113 
       
   114     /**
       
   115      * destructor.
       
   116      *
       
   117      * @since S60 v3.2
       
   118      * @return None
       
   119      */
       
   120     virtual ~CAknFepHwrBxLayout();
       
   121        
       
   122     /**
       
   123      * Get the data store
       
   124      *
       
   125      * @since S60 v3.2
       
   126      * @return The data store
       
   127      */          
       
   128     inline CAknFepHwrBxDataStore* DataStore() const;
       
   129     
       
   130     /**
       
   131      * Get the Ui window
       
   132      *
       
   133      * @since S60 v3.2
       
   134      * @return The window
       
   135      */          
       
   136     inline CAknFepHwrBxWnd* Window() const;
       
   137     
       
   138     /**
       
   139      * Set the current state 
       
   140      *
       
   141      * @since S60 v3.2
       
   142      * @param aState New state
       
   143      * @return None
       
   144      */          
       
   145     void SetCurrentStateL(CAknFepHwrBxStateBase* aState);
       
   146     
       
   147     /**
       
   148      * Send command to open option menu 
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @return None
       
   152      */          
       
   153     void OpenOptionMenu();
       
   154     
       
   155     /**
       
   156      * Send command to open language switch menu 
       
   157      *
       
   158      * @since S60 v3.2
       
   159      * @return None
       
   160      */          
       
   161     void OpenLangSwitchMenu();
       
   162 
       
   163     /**
       
   164      * Translate if char code is enter or back or space
       
   165      *
       
   166      * @since S60 v3.2
       
   167      * @param aCharCode The char code
       
   168      * @return the char code after translation
       
   169      */
       
   170     void TranslateCharCode(TDes& aCharCode);
       
   171     
       
   172     /**
       
   173      * Submit the candidate.
       
   174      *
       
   175      * @since S60 v3.2
       
   176      * @param aCharCode The char code
       
   177      * @return None
       
   178      */
       
   179     void SubmitL(const TDesC& aCharCode);
       
   180 
       
   181     /**
       
   182      * Submit the candidate.
       
   183      *
       
   184      * @since S60 v3.2
       
   185      * @param aOldCharCode The old char code
       
   186      * @param aNewCharCode The new char code
       
   187      * @return None
       
   188      */
       
   189     void ReplaceL(const TDesC& aOldCharCode, const TDesC& aNewCharCode);
       
   190 
       
   191     /**
       
   192      * Delete the candidate.
       
   193      *
       
   194      * @since S60 v3.2
       
   195      * @param aChar The delete key code
       
   196      * @return None
       
   197      */
       
   198     void Delete(TInt aChar = EKeyBackspace);
       
   199 
       
   200     /**
       
   201      * Set Layout position
       
   202      *
       
   203      * @since S60 v3.2
       
   204      * @return None
       
   205      */
       
   206     void SetLayoutPositionL();
       
   207 
       
   208 //from CFepUiLayout
       
   209 
       
   210     /**
       
   211      * From CFepUiLayout.
       
   212      * Handle layout command event
       
   213      *
       
   214      * @since S60 v3.2
       
   215      * @param aCmd Command Id.
       
   216      * @param aData Data for command.
       
   217      * @return Errors when return value small than 0.        
       
   218      */
       
   219     TInt HandleCommand(TInt aCmd, TUint8* aData);
       
   220 
       
   221     /**
       
   222      * From CFepUiLayout.
       
   223      * Inform layout the size changing event
       
   224      *
       
   225      * @since S60 v3.2
       
   226      * @param pData The event data.
       
   227      * @return KErrNone if successfully size changing.        
       
   228      */
       
   229     TInt SizeChanged(const TAny* pData);
       
   230 
       
   231     /**
       
   232      * From CFepUiLayout.
       
   233      * Handle the event from control
       
   234      *
       
   235      * @since S60 v3.2
       
   236      * @param aEventType The event type
       
   237      * @param aCtrl  The sender
       
   238      * @param aEventData The event data.
       
   239      * @return None                
       
   240      */
       
   241     void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData);
       
   242 
       
   243     /**
       
   244      * From CFepUiLayout.
       
   245      * Test whether the position is valid. 
       
   246      * This is used to test the target position when draging controls to some place
       
   247      *
       
   248      * @since S60 v3.2
       
   249      * @param aRect The rect to be checked.
       
   250      * @param aDragbar The dragbar being dragged
       
   251      * @param aVInfo The valid information in vertial dirtection. ETrue is vertical
       
   252      *        moving is valid.It's only used when aRect is not valid but moving in 
       
   253      *        vertical direction is valid.
       
   254      * @param aHInfo The valid information in horizontal dirtection. ETrue is 
       
   255      *        horizontal moving is valid.It's only used when aRect is not 
       
   256      *        valid but moving in vertical direction is valid.
       
   257      * @param aFlag ETrue if whole layout is moving, otherwise, only components moving
       
   258      * @return ETue if aRect is a valid position. Otherwise, EFalse. 
       
   259      */                                             
       
   260     TBool IsValidDestination(const TRect& aRect,
       
   261                             CDragBar* aDragBar,
       
   262                             TBool& aVInfo,TBool& aHInfo,
       
   263                             TBool aFlag);
       
   264     
       
   265     /**
       
   266      * From CFepUiLayout.
       
   267      * Handle editor text coming
       
   268      * Called by animation dll when app editor text is coming.
       
   269      * If a ui layout has a editor area, it must implements this function to get the text
       
   270      *
       
   271      * @since S60 v3.2
       
   272      * @param aTotalTextLen The total editor text len
       
   273      * @param aTextStartPos The position of the selection in whole editor text
       
   274      * @param aCursolSel The cursor selection in the editor
       
   275      * @param aText The text sent by fep.
       
   276      * @return KErrNone is operation succeeded.
       
   277      */
       
   278     TInt OnAppEditorTextComing( const TFepInputContextFieldData& aData);
       
   279 
       
   280     /**
       
   281      * From CFepUiLayout.
       
   282      * Handle raw event key
       
   283      *
       
   284      * @since S60 v3.2
       
   285      * @param aData the key raw event data
       
   286      * @return ETrue if the key was handled, otherwise EFalse
       
   287      */
       
   288     TBool HandleRawKeyEventL(const TRawEvent& aKeyEvent);
       
   289 
       
   290     /**
       
   291      * From CFepUiLayout.
       
   292      * Handle pointer down/up event while this event is outside of the layout
       
   293      * Do nothing in default implementation
       
   294      *
       
   295      * @since S60 v3.2
       
   296      * @param aEvent The raw event
       
   297      * @return EFalse if the event needs forward on. Otherwise ETrue.
       
   298      */                
       
   299     TBool OnPointerEventOutsideLayout(const TRawEvent& aEvent);
       
   300 
       
   301     /**
       
   302      * From CFepUiLayout 
       
   303      * Get the layout type, vkb or hwr. It's now similar to LayoutType which defines in 
       
   304      * another interface.
       
   305      * 
       
   306      * @since S60 v3.2
       
   307      * @return The layout type
       
   308      */
       
   309     TInt PenInputType();
       
   310     
       
   311     void SetPositionFromOutside(const TPoint& aNewPos);
       
   312     
       
   313 private:
       
   314 
       
   315     /**
       
   316      * C++ default constructor
       
   317      *
       
   318      * @since S60 v3.2
       
   319      * @param aLafEnv The LAF enviroment
       
   320      * @return None
       
   321      */          
       
   322     CAknFepHwrBxLayout(MLayoutOwner* aLayoutOwner);
       
   323 
       
   324     /**
       
   325      * Symbian second-phase constructor
       
   326      *
       
   327      * @since S60 v3.2
       
   328      * @param aInitData Init data of layout
       
   329      * @return None
       
   330      */          
       
   331     void ConstructL(const TAny* aInitData);
       
   332     
       
   333     /**
       
   334      * Read layout rect from LAF and set layout self position
       
   335      *
       
   336      * @since S60 v3.2
       
   337      * @param aLandscapeStyle Current screen is landscape or not
       
   338      * @return None
       
   339      */          
       
   340     void ResetLayoutRectL();
       
   341 
       
   342     /**
       
   343      * Go to standby state
       
   344      *
       
   345      * @since S60 v5.0
       
   346      * @return None
       
   347      */          
       
   348     void GoToStandbyStateL( TInt aOpenFlag );
       
   349 private://data
       
   350 
       
   351     /**
       
   352      * The data store (Own)
       
   353      */
       
   354     CAknFepHwrBxDataStore* iDataStore;
       
   355     
       
   356     /**
       
   357      * The window (Own)
       
   358      */
       
   359     CAknFepHwrBxWnd* iBxWindow;
       
   360     
       
   361     /**
       
   362      * The current state (Own)
       
   363      */
       
   364     CAknFepHwrBxStateBase* iCurrentState;
       
   365     
       
   366     /**
       
   367      * Is LandscapeStyle
       
   368      */
       
   369     //TBool iLandscapeStyle;
       
   370     
       
   371     /**
       
   372      * The hwr resource id
       
   373      */    
       
   374     TInt iResId;
       
   375     
       
   376     MPenInputModeSwitchInterface* iInputModeSwitch;
       
   377 
       
   378     };
       
   379 
       
   380 #include "peninputhwrbxlayout.inl"
       
   381 
       
   382 #endif // C_CAKNFEPHWRBXLAYOUT_H
       
   383 
       
   384 // End Of File