idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h
changeset 0 f72a12da539e
child 16 9674c1a575e9
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Used for handling XUIKON events
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_EVENTHANDLER_H
       
    20 #define C_EVENTHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "xnvolumecontrolobserver.h"
       
    25 #include "xnvolumecontrol.h"
       
    26 
       
    27 class CXnNodeAppIf;
       
    28 class CXnProperty;
       
    29 class MAiFwEventHandler;
       
    30 class MAiStrParser;
       
    31 class TXnUiEngineAppIf;
       
    32 class CXnDomNode;
       
    33 
       
    34 namespace AiXmlUiController
       
    35 {
       
    36     
       
    37 class CXmlUiController;
       
    38 class CContentRenderer;
       
    39 class MAiUiEventHandler;
       
    40 class MAiApplicationEventHandler;
       
    41 
       
    42 /**
       
    43  *  @ingroup group_xmluicontroller
       
    44  * 
       
    45  *  This class is used for handling XUIKON events.
       
    46  *
       
    47  *  Events described in Content Model are handled in here. This class parses
       
    48  *  the events and decides what to do with them. Events are either consumed in
       
    49  *  UI or in case of a plug-in event forwarded to XML AI Framework for further
       
    50  *  processing.
       
    51  *
       
    52  *  @lib AiXmlUiMain
       
    53  */
       
    54 class CAIXuikonEventHandler : public CBase,
       
    55                               public MXnVolumeControlObserver
       
    56     {
       
    57 public:
       
    58 
       
    59     static CAIXuikonEventHandler* NewL(CXmlUiController& aXmlUiController,
       
    60                                        CContentRenderer& aRenderer);
       
    61     ~CAIXuikonEventHandler();
       
    62 
       
    63     /**
       
    64     * Handle interaction notification from XUIKON UI engine.
       
    65     *
       
    66     * @see CXnAppUiAdapter::HandleXuikonEventL
       
    67     */
       
    68     void HandleXuikonEventL( CXnNodeAppIf& aOrigin,
       
    69                              CXnNodeAppIf& aTrigger,
       
    70                              CXnDomNode& aTriggerDefinition,
       
    71                              CXnDomNode& aEvent );
       
    72 
       
    73     /**
       
    74     * Set handler for plug-in events
       
    75     * @param aPluginEventHandler Pointer to event handler
       
    76     */
       
    77     void SetFwEventHandler( MAiFwEventHandler* aPluginEventHandler );
       
    78 
       
    79     /**
       
    80     * Set handler for UI events
       
    81     * @param aUiEventHandler Pointer to event handler
       
    82     */
       
    83     void SetUiEventHandler( MAiUiEventHandler* aUiEventHandler );
       
    84 
       
    85     /**
       
    86     * Set handler for application events
       
    87     * @param aApplicationEventHandler Pointer to event handler
       
    88     */
       
    89     void SetApplicationEventHandler( MAiApplicationEventHandler* 
       
    90                                         aApplicationEventHandler );
       
    91 
       
    92 // from MXnVolumeControlObserver
       
    93     
       
    94     /**
       
    95     * Called when volume value is changed.
       
    96     */
       
    97     void VolumeChanged( TInt aValue );
       
    98 
       
    99 private:
       
   100     CAIXuikonEventHandler(CXmlUiController& aUiController,
       
   101                           CContentRenderer& aRenderer);
       
   102                           
       
   103     void ConstructL();
       
   104     
       
   105     TBool HandleSystemEventL( const TDesC8& aEventText, CXnDomNode& aEvent );
       
   106     
       
   107     TBool HandleUiEventL( const TDesC8& aEventText, CXnNodeAppIf& aOrigin );
       
   108     
       
   109     TBool HandleApplicationEventL( const TDesC8& aEventText );
       
   110     
       
   111     void DispatchEventL( CXnDomNode& aEvent,
       
   112                          CXnNodeAppIf& aOrigin,
       
   113                          CXnDomNode& aTriggerDefinition );
       
   114                          
       
   115     void HandlePluginEventL( CXnDomNode& aEvent );
       
   116         
       
   117     void ParseParameterStringL(const TDesC8& aSourcePtr, TPtrC8& aTargetPtr);    
       
   118     
       
   119 private: // data
       
   120 
       
   121     class CNullEventHandler;
       
   122 
       
   123     /**
       
   124      * String parser utility. Own.
       
   125      */
       
   126     MAiStrParser* iStrParser;
       
   127 
       
   128     /**
       
   129      * Reference to XML ui controller.
       
   130      */
       
   131     CXmlUiController& iUiController;
       
   132     
       
   133     /**
       
   134      * Reference to content renderer.
       
   135      */
       
   136     CContentRenderer& iContentRenderer;
       
   137     
       
   138     /**
       
   139      * Null event handler.
       
   140      */
       
   141     CNullEventHandler* iNullEventHandler;
       
   142 
       
   143     /**
       
   144      * Plug-in event handler.
       
   145      * Doesn't own.
       
   146      */
       
   147      MAiFwEventHandler* iFwEventHandler;
       
   148 
       
   149     /**
       
   150      * UI event handler.
       
   151      * Doesn't own.
       
   152      */
       
   153      MAiUiEventHandler* iUiEventHandler;
       
   154 
       
   155     /**
       
   156      * Application event handler.
       
   157      * Doesn't own.
       
   158      */
       
   159      MAiApplicationEventHandler* iApplicationEventHandler;
       
   160      
       
   161     /**
       
   162      * Volume control event.
       
   163      * Owned.
       
   164      */
       
   165     HBufC* iVolumeEvent;
       
   166 
       
   167     /**
       
   168      * Volume control interface.
       
   169      * Not owned.
       
   170      */
       
   171     XnVolumeControlInterface::MXnVolumeControlInterface* iVolumeControl;
       
   172     };
       
   173 
       
   174 } // namespace AiXmlUiController
       
   175 
       
   176 #endif // C_EVENTHANDLER_H