epoc32/include/hsdataobserver.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Updates applications and icons in Operator Tile.
    15 *
    16 */
    17 
    18 
    19 #ifndef __HSDATAOBSERVER_H__
    20 #define __HSDATAOBSERVER_H__
    21 
    22 #include <string>
    23 
    24 namespace Hs {
    25 /**
    26  * An observer interface. 
    27  * Client must implement it to be able to get information
    28  * about occuring Execute actions from the Homescreen Publishing API.
    29  *
    30  * @code
    31  * class ObserverClass : public IHsDataObserver
    32  * {
    33  *      void handleEvent( std::string aWidgetName, 
    34  *			IHsDataObserver::EEvent aEvent)
    35  *      {
    36  *      }
    37  * 
    38  *      void handleItemEvent( std::string aWidgetName,
    39  *        	std::string aWidgetItemName,
    40  *       	IHsDataObserver::EItemEvent aEvent)
    41  *      {
    42  *      }
    43  * }
    44  * ObserverClass* dataObserver = new ObserverClass();
    45  * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver );
    46  * @endcode
    47  */
    48 class IHsDataObserver
    49     {
    50 public:
    51     
    52 	/**
    53 	 * Defines the events that may take place for a homescreen widget.
    54 	 */
    55 	enum EEvent
    56 	    {
    57 	    EUnknown    = 0, ///< Unknown event: Means that event has not been defined.
    58 	    EActivate   = 1, ///< Activation event: Means that widget has been added to HS as content.
    59 	    EDeactivate = 2, ///< Deactivation event: Means that widget has been removed frm.
    60 	    ESuspend    = 3, ///< Suspension event: Means that HS reading widget data is suspended.
    61 	    EResume     = 4  ///< Resume event. Means that HS reading widget data is resumed.
    62 	    };
    63     
    64 	/**
    65 	 * Defines the events that may take place for a homescreen widget item.
    66 	 */
    67 	enum EItemEvent
    68 	    {
    69 	    EUnknownItemEvent = 0, ///< Unknown event: Means that event has note been defined.
    70 	    ESelect           = 1  ///< Selection event: Means that the widget item has been selected.
    71 	    };
    72     
    73 public:
    74 
    75 	/**
    76 	 * Intended to handle an event that occured on a widget.
    77 	 * This would include EActivate, EDeactivate, ESuspend, EReusume.
    78 	 *
    79 	 * @param aWidgetName Name of the widget that event is envoked for.
    80 	 * @param aEvent Event type that has taken place.
    81 	 */
    82 	virtual void handleEvent( std::string aWidgetName, 
    83 			IHsDataObserver::EEvent aEvent) = 0;
    84 	
    85 	/**
    86 	 * Intended to handle an event that occured on a widget's item.
    87 	 * This would include ESelection.
    88 	 *
    89 	 * @param aWidgetName Name of the widget that event is envoked for.
    90 	 * @param awidgetItemName Name of the item that event is envoked for.
    91 	 * @param aAEvent Event type that has taken place
    92 	 */    
    93 	virtual void handleItemEvent( std::string aWidgetName,
    94 			std::string aWidgetItemName,
    95 			IHsDataObserver::EItemEvent aEvent) = 0;
    96     };
    97 }
    98 
    99 #endif /*__HSDATAOBSERVER_H__*/