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