textinput/peninputarc/inc/pensrvcliinc/peninputuilayoutbase.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2006-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:  interface for pen input ui layout base
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef M_PENUILAYOUTBASE_H
       
    21 #define M_PENUILAYOUTBASE_H
       
    22 
       
    23 #include <peninputcmdparam.h>
       
    24 
       
    25 //event type
       
    26 enum TEventType
       
    27     {
       
    28     EPointerEvent,          //Pointer event
       
    29     EPointerBufferEvent,    //Pointer buffer event. This is used only for window based.
       
    30     ERawEvent,              //Raw event from window server
       
    31     //Event indicates the pointer up event happens to another control 
       
    32     //Which does not has the pointer down event. 
       
    33     EEventCancelPointerDown,    //Pointer is up in other control, cancel the down event
       
    34     ERawEventBuffer,    //raw event buffer. A collection of event buffered by server.
       
    35                         //The event is starts by a point down event, then followed 
       
    36                         // by serveral move events. It will ends either by a move event
       
    37                         // or a point up event.
       
    38                         // The count of event number is set in the buffer header.
       
    39                         // The buffer structure is:
       
    40                         /*
       
    41                            {
       
    42                            TInt nEventCount;
       
    43                            TRawEvent event[1];
       
    44                            }
       
    45                         */
       
    46     };
       
    47 
       
    48 
       
    49 /**
       
    50  * Class MPenUiLayoutBase.
       
    51  *
       
    52  * Interface for fep layout base
       
    53  *
       
    54  * @since S60 V4.0
       
    55  */
       
    56 class MPenUiLayoutBase
       
    57     {
       
    58 public:
       
    59     /**
       
    60      * InitL. 
       
    61      * Do layout initialization. It's called by layout owner
       
    62      *
       
    63      * @since S60 v4.0
       
    64      * @retutn The layout rect including the shadow.
       
    65      */
       
    66     virtual TRect Init() = 0;
       
    67 
       
    68     /**
       
    69      * HandleEventL. Handle UI event.
       
    70      * There are only 3 kinds of UI event right now: raw event, 
       
    71      * pointer and pointer buffer event. 
       
    72      *
       
    73      * @since S60 v4.0
       
    74      * @param aType The event type. See TEventType
       
    75      * @param aEventData The event data.
       
    76      * @return ETrue if layout has processed the event, otherwise EFalse
       
    77      */
       
    78     virtual TBool HandleEventL(TEventType aType, 
       
    79                                                 const TAny* aEventData) = 0;
       
    80 
       
    81     /**
       
    82      * HandleCommand. Handle layout command event.
       
    83      *
       
    84      * @since S60 v4.0
       
    85      * @param aCmd Command Id.
       
    86      * @param aData Data for command.
       
    87      * @return precessing result. Errors when return value small than 0.		
       
    88      */
       
    89     virtual TInt HandleCommand(TInt aCmd, TUint8* aData) = 0;
       
    90                                                     
       
    91     /**
       
    92      * Draw layout.
       
    93      *
       
    94      * @since S60 v4.0    
       
    95      */                                                          
       
    96     virtual void Draw() = 0;
       
    97     
       
    98     /**
       
    99      * SizeChanged. Inform layout the size changing event.
       
   100      *
       
   101      * @since S60 v4.0
       
   102      * @param aType The event type
       
   103      * @return KErrNone if successfully size changing. 
       
   104      */
       
   105     virtual TInt OnResourceChange(TInt aEventType) = 0;     
       
   106 
       
   107     /**
       
   108      * Handle editor text coming
       
   109      * Called by animation dll when app editor text is coming.
       
   110     
       
   111     /**
       
   112      * Destroy layout
       
   113      *
       
   114      * @since S60 v4.0     
       
   115      */    
       
   116     virtual void Destroy() = 0;
       
   117     
       
   118     /**
       
   119      * OnActivate. Called by owner when the layout is going to be shown.
       
   120      *
       
   121      * @since S60 v4.0
       
   122      */        
       
   123     virtual void OnActivate() = 0;
       
   124     
       
   125     /**
       
   126      * OnDeActivate. Called by owner when the layout is going to be hidden
       
   127      *
       
   128      * @since S60 v4.0
       
   129      */        
       
   130     virtual void OnDeActivate() = 0;    
       
   131 
       
   132     /**
       
   133      * SemiTransparencyRequired. Tell whether this layout requires semi-transparency.
       
   134      * This is to save memory used in mask bitmap. If semi-transparency not deeded,
       
   135      * We use black-white bitmap.
       
   136      *
       
   137      * @since S60 v4.0
       
   138      * @return ETrue if layout require transparency, otherwise EFalse.
       
   139      */        
       
   140     virtual TBool SemiTransparencyRequired() = 0;     
       
   141     
       
   142     /**
       
   143      * Get current input UI type
       
   144      *
       
   145      * @since S60 v4.0
       
   146      * @return Current input UI type
       
   147      */
       
   148     virtual TInt PenInputType() = 0;
       
   149     
       
   150     /**
       
   151      * HandleAppInfoChange. Inform UI that application infomation changed.
       
   152      *
       
   153      * @since S60 v5.0
       
   154      * @param aInfo The information.
       
   155      * @param aType The information type
       
   156      */
       
   157     virtual void HandleAppInfoChange(const TDesC& aInfo, TPeninputAppInfo aType) = 0;    
       
   158     
       
   159     /**
       
   160      * SetPositionFromOutside. Inform UI that the position is change from outside of UI.
       
   161      *
       
   162      * @since S60 v5.0
       
   163      * @param aInfo The information.
       
   164      * @param aType The information type
       
   165      */
       
   166     virtual void SetPositionFromOutside(const TPoint& aNewPos) = 0;    
       
   167     };
       
   168 
       
   169 #endif //M_PENUILAYOUTBASE_H
       
   170