mmuifw_plat/alf_widgetmodel_api/inc/alf/ialfappeventlistener.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007,2008 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:  Provides system state information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IALFAPPEVENTLISTENER_H
       
    20 #define IALFAPPEVENTLISTENER_H
       
    21 
       
    22 class TAlfEvent;
       
    23 
       
    24 namespace osncore
       
    25     {
       
    26     class UString;
       
    27     }
       
    28 
       
    29 using namespace osncore;
       
    30 
       
    31 namespace Alf
       
    32 {
       
    33 /**
       
    34  *  @class IAlfAppEvent
       
    35  *
       
    36  *  @discussion Provides function to handle application events.  
       
    37  *
       
    38  */
       
    39 class IAlfAppEventListener
       
    40     {
       
    41 public: 
       
    42    /**
       
    43     * @function handleApplicationEvent
       
    44     *
       
    45     * Function will be called when application event triggers.
       
    46     * Application has to register itself to listen events by
       
    47     * using duiengine's subscribeAppEvent function
       
    48     *
       
    49     * example:
       
    50     * <appevents>
       
    51     *   <eventhandler id="pressed" owner="gridwidget1">
       
    52     *     <eventinput id="pressedinput" name="customevent">
       
    53     *       <property name="eventid" value="1333" />
       
    54     *       <!-- value 1333 is selection changed in grid widget -->
       
    55     *     </eventinput>
       
    56     *     <eventoutput name="appevent"> 
       
    57     *       <property value="itemclicked"/>
       
    58     *     </eventoutput>
       
    59     *   </eventhandler>
       
    60     * </appevents>
       
    61     *
       
    62     * Register your application to listen application events via IDuiEngineConstruction:
       
    63     * duiEngineConstructionInterface->subscribeAppEvents(*this);
       
    64     *
       
    65     * aCmd is the value you have set on property's value attribute, in this case
       
    66     * "itemclicked"
       
    67     *
       
    68     * @param aCmd command which is specified to eventoutput
       
    69     * @param aEvent contains event specific data
       
    70     * @return void
       
    71     */ 
       
    72     virtual void handleApplicationEvent(const UString& aCmd, const TAlfEvent& aEvent) = 0;
       
    73     };
       
    74 }
       
    75         
       
    76 
       
    77 #endif 
       
    78             
       
    79 // End of File