uiaccelerator_plat/alf_visual_api/inc/alf/alfeventhandler.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     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 handler API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19  
       
    20 #ifndef ALFEVENTHANDLER_H
       
    21 #define ALFEVENTHANDLER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class TAlfEvent;
       
    26 
       
    27 /**
       
    28  * MAlfEventHandler is an interface that can be derived by any object that want's to handle
       
    29  * Alfred UI Toolkit events scheduled by AlfCommandScheduler.
       
    30  * 
       
    31  * If an object wishes to process events from the toolkit, it should implement this interface. 
       
    32  * 
       
    33  * @note   The destructor will NOT cancel any pending commands enqueued to this object,
       
    34  *         so you must call eg. <code>CAlfEnv::CancelCommands(this);</code> to cancel
       
    35  *         still pending commands to prevent calling destroyed object.
       
    36  */
       
    37 class MAlfEventHandler
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Called when an input event is being offered to this object.
       
    43      * 
       
    44      * The implementation must ensure that the function returns EFalse if 
       
    45      * it does not do anything in response to the event, otherwise, other objects
       
    46      * may be prevented from receiving the event. If it is able to process the 
       
    47      * event it should return ETrue.
       
    48      *
       
    49      * @param aEvent  Event to be handled.
       
    50      *
       
    51      * @return  <code>ETrue</code>, if the event was handled.
       
    52      *          Otherwise <code>EFalse</code>.
       
    53      */
       
    54     virtual TBool OfferEventL(const TAlfEvent& aEvent) = 0;
       
    55 
       
    56     };  
       
    57 
       
    58 #endif  // ALFEVENTHANDLER_H