widgetmodel/alfwidgetmodel/inc/alfwidgetcontroleventfilter.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 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:  Event Filter Header.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __ALFWIDGETCONTROLEVENTFILTER_H__
       
    19 #define __ALFWIDGETCONTROLEVENTFILTER_H__
       
    20 #include <libc/string.h>
       
    21 
       
    22 
       
    23 #include <alf/alfevent.h>
       
    24 #include <alf/alfwidgetevents.h>
       
    25 #include <osn/ustring.h>
       
    26 #include <osn/osndefines.h>
       
    27 #include <alf/alfeventhandler.h>
       
    28 
       
    29 #include <alf/alfscrollevents.h>
       
    30 #include <alf/ialfwidgeteventhandler.h>
       
    31 
       
    32 using namespace osncore;
       
    33 using namespace Alf;
       
    34 namespace Alf
       
    35 {
       
    36 /**
       
    37 * AlfWidgetControlEventFilter delivers the Missed PointerUp event as a custom  
       
    38 * event .If AfWidgetControl gets a stray pointerUp event, the 
       
    39 * AlfWidgetControlEventFilter will consume the Stray pointerup event and send a 
       
    40 * EEventMissedPointerUp custom event.
       
    41 *
       
    42 */
       
    43 class AlfWidgetControlEventFilter: public IAlfWidgetEventHandler
       
    44     {
       
    45 	public:
       
    46 	
       
    47 	/**
       
    48 	 * Constructor
       
    49 	 *
       
    50 	 */
       
    51 	AlfWidgetControlEventFilter();
       
    52 	
       
    53 	/**
       
    54 	 * Destructor
       
    55 	 *
       
    56 	 */
       
    57 	~AlfWidgetControlEventFilter();
       
    58 	
       
    59 	/**
       
    60 	 * Used to identify event handlers that are capable of handling
       
    61 	 * a specified key or custom event. Pointer event handlers cannot be
       
    62 	 * identified directly, since they are dependent on the presentation.
       
    63 	 * Therefore, pointer event handlers should be associated with
       
    64 	 * a custom event ID that can be used to simulate the actual pointer event.
       
    65 	 *
       
    66 	 * @since S60 ?S60_version
       
    67 	 * @param aEvent The event.
       
    68 	 * @return <code>ETrue</code> if the event can be processed. Otherwise <code>EFalse</code>.
       
    69 	 */
       
    70 	bool accept ( CAlfWidgetControl& aControl, const TAlfEvent& aEvent ) const;
       
    71 
       
    72 	/**
       
    73      * @see IAlfWidgetEventHandler
       
    74 	 */
       
    75 	virtual AlfEventStatus offerEvent ( CAlfWidgetControl& aControl, const TAlfEvent& aEvent );
       
    76 
       
    77     /**
       
    78      * Returns the type of EventHandler. 
       
    79      * @see IAlfWidgetEventHandler::AlfEventHandlerType
       
    80      *
       
    81      * @return The type of event handler.
       
    82      */
       
    83     AlfEventHandlerType eventHandlerType();
       
    84 
       
    85     /**
       
    86      * Returns information about the phase in the event handling cycle in
       
    87      * which the event hadler will be executed.
       
    88      * @see IAlfWidgetEventHandler::AlfEventHandlerExecutionPhase
       
    89      *
       
    90      * @return Event handler execution phase.
       
    91      */
       
    92 
       
    93     AlfEventHandlerExecutionPhase eventExecutionPhase();
       
    94 	/**
       
    95 	 * Defines the widget states, where the event handler is active.
       
    96 	 * By default, if this method is not called, the event handler is expected
       
    97 	 * to be active in all states.
       
    98 	 *
       
    99 	 * @param aStates A bitmask defining the widget states, where the event
       
   100 	 * handler is active. The low 16 bits are reserved for the states
       
   101 	 * defined by the framework in <: add reference>. The high 16 bits are
       
   102 	 * available for states defined by the client code.
       
   103 	 */
       
   104    /**
       
   105      * Sets AlfWidgetEventHandlerInitData to event handler.
       
   106      *
       
   107      * @param aData A data structure which contains for example id of the event
       
   108      * handler.
       
   109      */
       
   110     virtual void setEventHandlerData( const AlfWidgetEventHandlerInitData& /*aData*/ )
       
   111     {
       
   112     	
       
   113     }
       
   114     
       
   115     /**
       
   116      * Returns AlfWidgetEventHandlerInitData.
       
   117      *
       
   118      * @return  A pointer to AlfWidgetEventHandlerInitData structure which contains
       
   119      * for example id of the event handler.
       
   120      */
       
   121     virtual AlfWidgetEventHandlerInitData* eventHandlerData()
       
   122     {
       
   123     	return NULL;
       
   124     }
       
   125     
       
   126 
       
   127 	void setActiveStates ( unsigned int aStates );
       
   128 	
       
   129 	IAlfInterfaceBase* makeInterface ( const IfId& aType );
       
   130 	// Stores Button Down State
       
   131     bool mButtonDown ;
       
   132 
       
   133 	};	
       
   134 }
       
   135 
       
   136     
       
   137 #endif // __ALFWIDGETCONTROLEVENTFILTER_H__ 
       
   138