textinput/peninputhwrfscn/inc/peninputhwrfscnlayout.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Implementation for chinese peninput full screen hwr
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __PENINPUTHWRFSCNLAYOUT_H__
       
    20 #define __PENINPUTHWRFSCNLAYOUT_H__
       
    21 
       
    22 //FEP INCLUDES
       
    23 #include "peninputfullscrlayoutbase.h"
       
    24 
       
    25 const TInt KControlButtonSize = 30;
       
    26 
       
    27 //FORWARD CLASS
       
    28 class CPeninputHwrfscnStateManager;
       
    29 class CPeninputHwrfscnDataStore;
       
    30 class CPeninputHwrfscnCandidatePanel;
       
    31 class CPeninputHwrfscnControlBar;
       
    32 class CPeninputHwrfscnWritingBox;
       
    33 
       
    34 /**
       
    35 *  Class CPeninputHwrfscnLayout.
       
    36 *  Chinese full screen handwriting ui layout class.
       
    37 *
       
    38 *  
       
    39 *  @since Series 60 5.0
       
    40 */
       
    41 
       
    42 class CPeninputHwrfscnLayout : public CPenInputFullScreenLayoutBase
       
    43 {
       
    44 public:
       
    45     /**
       
    46     * The factory function
       
    47     *
       
    48     * @since Series 60 5.0
       
    49     * @param aLayoutOwner The MLayoutOwner
       
    50     * @param aInitData Init data for layout
       
    51     * @return Pointer to created CPeninputHwrfscnLayout object
       
    52     */
       
    53     static CPeninputHwrfscnLayout* NewL( MLayoutOwner* aLayoutOwner,
       
    54         const TAny* aInitData );
       
    55 
       
    56 public://from CFepUiLayout
       
    57     /**
       
    58     * From CFepUiLayout.
       
    59     * Handle layout command event
       
    60     *
       
    61     * @since Series 60 5.0
       
    62     * @param aCmd Command Id.
       
    63     * @param aData Data for command.
       
    64     * @return Errors when return value small than 0.    
       
    65     */
       
    66     TInt HandleCommand( TInt aCmd,TUint8* aData );
       
    67     
       
    68     /**
       
    69     * From CFepUiLayout.
       
    70     * Inform layout the size changing event
       
    71     *
       
    72     * @since Series 60 5.0
       
    73     * @param pData The event data.
       
    74     * @return KErrNone if successfully size changing. 
       
    75     */
       
    76     TInt SizeChanged( const TAny* pData );
       
    77     
       
    78     /**
       
    79     * From CFepUiLayout.
       
    80     * Handle editor text coming
       
    81     * Called by animation dll when app editor text is coming.
       
    82     * If a ui layout has a editor area, it must implements this function to get the text
       
    83     *
       
    84     * @since Series 60 5.0
       
    85     * @param aData The fep input context field data
       
    86     * @return KErrNone is operation succeeded.    
       
    87     */
       
    88     TInt OnAppEditorTextComing( const TFepInputContextFieldData& aData );
       
    89     
       
    90     /**
       
    91     * Return the peninput ui type
       
    92     *
       
    93     * @since Series 60 5.0
       
    94     * @return The ui type @see TPenInputUiType
       
    95     */
       
    96     TInt PenInputType();
       
    97 
       
    98 public://from MEventObserver;    
       
    99     /**
       
   100     * From MEventObserver, handle control event.
       
   101     *
       
   102     *
       
   103     * @since Series 60 5.0
       
   104     * @param aEventType The event type
       
   105     * @param aCtrl The control who sends the event
       
   106     * @param aEventData The event data
       
   107     */
       
   108     void HandleControlEvent( TInt aEventType, 
       
   109         CFepUiBaseCtrl* aCtrl, const TDesC& aEventData );
       
   110     
       
   111     /**
       
   112     * Get the data stroe
       
   113     * 
       
   114     * @since Series 60 5.0
       
   115     * @return The CPeninputHwrfscnDataStore reference
       
   116     */
       
   117     CPeninputHwrfscnDataStore& DataStore();
       
   118     
       
   119     /**
       
   120     * Get the candidate panel reference
       
   121     * 
       
   122     * @since Series 60 5.0
       
   123     * @return The CPeninputHwrfscnCandidatePanel reference
       
   124     */
       
   125     CPeninputHwrfscnCandidatePanel& CandidatePanel();
       
   126 
       
   127     /**
       
   128     * Replace the char before the cursor in forground app with a new char.
       
   129     *
       
   130     * @since Series 60 5.0
       
   131     * @param aOldCharCode The old char need to be replaced
       
   132     * @param aNewCharCode The new char for replacing the old char
       
   133     */
       
   134     void Replace( const TDesC& aOldCharCode, 
       
   135         const TDesC& aNewCharCode );
       
   136     
       
   137     /**
       
   138     * Submit the buffer to layoutowner.
       
   139     *
       
   140     * @param aCharCode The buffer needed to be submitted.
       
   141     * @since Series 60 5.0
       
   142     */
       
   143     void SubmitStringToFep( const TDesC& aCharCode );
       
   144 
       
   145     void ClearScreen();
       
   146     
       
   147     CPeninputHwrfscnWritingBox& HwrfscnWritingBox();
       
   148 
       
   149 protected:
       
   150     /**
       
   151      * From CFepUiLayout        
       
   152      * OnResourceChange. Inform layout the system resource changed.
       
   153      *
       
   154      * @since S60 v4.0
       
   155      * @param aType the event type
       
   156      * @return KErrNone if successfully size changing. 
       
   157      */
       
   158     TInt OnResourceChange(TInt aType);
       
   159 private:
       
   160     /**
       
   161     * The panel type
       
   162     *
       
   163     * @since Series 60 5.0
       
   164     */
       
   165     enum TPeninputHwrfscnPanel
       
   166         {
       
   167         ENone = 0x0000,            
       
   168         EHwrWndBox = 0x0010,
       
   169         ECtrlBar = 0x0020,
       
   170         ECandidatePanel = 0x0040
       
   171         };
       
   172         
       
   173 private:
       
   174    /**
       
   175     * The constructor
       
   176     *
       
   177     * @since Series 60 5.0
       
   178     * @param aLayoutOwner The MLayoutOwner pointer.
       
   179     */
       
   180     CPeninputHwrfscnLayout( MLayoutOwner* aLayoutOwner );
       
   181     
       
   182     /**
       
   183     * The destructor
       
   184     *
       
   185     * @since Series 60 5.0
       
   186     */
       
   187     ~CPeninputHwrfscnLayout();
       
   188     
       
   189     /**
       
   190     * 2nd phase constructor
       
   191     *
       
   192     * @since Series 60 5.0
       
   193     * @param aInitData The init data passed by layout engine.
       
   194     */
       
   195     void  ConstructL( const TAny* aInitData );
       
   196     
       
   197     /**
       
   198     * Handle raw key event. Call back function. Called when raw key event happens
       
   199     * Do nothing in default implementation
       
   200     *
       
   201     * @since S60 v5.0
       
   202     * @param aKeyEvent Key event
       
   203     * @return EFalse if the key has not been processed. Otherwise ETrue. 
       
   204     *      If key is not processed, it will be passed to CONE's control stack.
       
   205     */                
       
   206     TBool HandleRawKeyEventL( const TRawEvent& aKeyEvent );
       
   207     
       
   208     /**
       
   209 	* From CPenInputFullScreenLayoutBase
       
   210 	* 
       
   211 	*/
       
   212 	void PreHandleEvent( TEventType aType, 
       
   213 	    const TRawEvent &aEvent );
       
   214 	
       
   215 	/**
       
   216     * Do someting before sending the events to background
       
   217     *
       
   218     * @since S60 v5.0
       
   219     */
       
   220     void BeforeSendingEventsToBackground();
       
   221     
       
   222     /**
       
   223      * From MFepLayoutBase        
       
   224      * OnDeActivate. Called by owner when the layout is going to be hidden
       
   225      *
       
   226      * @since Series 60 5.0
       
   227      */        
       
   228     void OnDeActivate();
       
   229     
       
   230     /**
       
   231     * Create the control bar
       
   232     *
       
   233     * @since Series 60 5.0
       
   234     */
       
   235     void CreateControlBarL();
       
   236     
       
   237     /**
       
   238     * Create the candidate panel
       
   239     *
       
   240     * @since Series 60 5.0
       
   241     */
       
   242     void  CreateCandidatePanelL();
       
   243     
       
   244     /**
       
   245     * Create the hwr box window
       
   246     *
       
   247     * @since Series 60 5.0
       
   248     */
       
   249     void  CreateHwrWindowL();
       
   250     
       
   251     /**
       
   252     * Create the state manager
       
   253     *
       
   254     * @since Series 60 5.0
       
   255     */
       
   256     void CreateStateManagerL();
       
   257     
       
   258     /**
       
   259     * Handle control bar events
       
   260     *
       
   261     * @since Series 60 5.0
       
   262     * @param aEventType The event type
       
   263     * @param aCtrl The control who sends the event
       
   264     * @param aEventData The event data     
       
   265     */
       
   266     void HandleControlBarEventL( TInt aEventType, 
       
   267         CFepUiBaseCtrl* aCtrl,
       
   268         const TDesC& aEventData );
       
   269     
       
   270     /**
       
   271     * Handle function list events
       
   272     *
       
   273     * @since Series 60 5.0
       
   274     * @param aEventType The event type
       
   275     * @param aCtrl The control who sends the event
       
   276     * @param aEventData The event data    
       
   277     */    
       
   278     void HandleFunctionListEventL( TInt aEventType, 
       
   279         CFepUiBaseCtrl* aCtrl, 
       
   280         const TDesC& aEventData );
       
   281     
       
   282     /**
       
   283     * Handle the Hwr Box events and candiate list events.
       
   284     *
       
   285     * @since Series 60 5.0
       
   286     * @param aEventType The event type
       
   287     * @param aEventData The event data
       
   288     */
       
   289     void HandleHwrWndEventL( TInt aEventType, const TDesC& aEventData );
       
   290     
       
   291     /**
       
   292     * Handle the candidate list events.
       
   293     *
       
   294     * @since Series 60 5.0
       
   295     * @param aEventType The event type
       
   296     * @param aEventData The event data    
       
   297     */
       
   298     void HandleCandidateWndEventL( TInt aEventType, 
       
   299         const TDesC& aEventData );
       
   300     
       
   301     /**
       
   302     * Notify the candidate and control bar the outside window events.
       
   303     *
       
   304     * @since Series 60 5.0
       
   305     * @param aPanel Which panel need to be hidden
       
   306     */
       
   307     void NotifyOutsideEventL( TInt aPanel );
       
   308     
       
   309     /**
       
   310     * Notify the layout owner the primary has changed.
       
   311     *
       
   312     * @since Series 60 5.0
       
   313     * @param aPrimaryRange The range which will be changed to
       
   314     */
       
   315     void NotifyPrimaryRangeChanged( TInt aPrimaryRange );
       
   316     
       
   317 private:    
       
   318     /**
       
   319     * The data store
       
   320     * Own
       
   321     */
       
   322     CPeninputHwrfscnDataStore* iDataStore;
       
   323     
       
   324     /**
       
   325     * The state manager
       
   326     * Own
       
   327     */
       
   328     CPeninputHwrfscnStateManager* iStateMgr;
       
   329     
       
   330     /**
       
   331     * The candidate panel
       
   332     * Own
       
   333     */
       
   334     CPeninputHwrfscnCandidatePanel* iCandidatePanel;
       
   335     
       
   336     /**
       
   337     * The control bar panel
       
   338     * Own
       
   339     */
       
   340     CPeninputHwrfscnControlBar* iControlBar;
       
   341     
       
   342     /**
       
   343     * The full screen hwr box
       
   344     * Own
       
   345     */
       
   346     CPeninputHwrfscnWritingBox* iFsHwrBox;
       
   347     
       
   348     /**
       
   349     * The resource Id
       
   350     * 
       
   351     */
       
   352     TInt iResId; 
       
   353 };  
       
   354 #endif //__PENINPUTHWRFSCNLAYOUT_H__
       
   355     
       
   356     
       
   357     
       
   358     
       
   359     
       
   360      
       
   361     
       
   362     
       
   363     
       
   364     
       
   365     
       
   366     
       
   367     
       
   368     
       
   369     
       
   370     
       
   371     
       
   372     
       
   373     
       
   374     
       
   375     
       
   376     
       
   377     
       
   378     
       
   379     
       
   380     
       
   381     
       
   382     
       
   383     
       
   384     
       
   385     
       
   386     
       
   387     
       
   388     
       
   389     
       
   390     
       
   391     
       
   392     
       
   393     
       
   394     
       
   395     
       
   396     
       
   397     
       
   398     
       
   399     
       
   400     
       
   401     
       
   402     
       
   403     
       
   404     
       
   405