williamr@2: /* williamr@2: * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Updates applications and icons in Operator Tile. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __HSDATAOBSERVER_H__ williamr@2: #define __HSDATAOBSERVER_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: namespace Hs { williamr@2: /** williamr@2: * An observer interface. williamr@2: * Client must implement it to be able to get information williamr@2: * about occuring Execute actions from the Homescreen Publishing API. williamr@2: * williamr@2: * @code williamr@2: * class ObserverClass : public IHsDataObserver williamr@2: * { williamr@2: * void handleEvent( std::string aWidgetName, williamr@2: * IHsDataObserver::EEvent aEvent) williamr@2: * { williamr@2: * } williamr@2: * williamr@2: * void handleItemEvent( std::string aWidgetName, williamr@2: * std::string aWidgetItemName, williamr@2: * IHsDataObserver::EItemEvent aEvent) williamr@2: * { williamr@2: * } williamr@2: * } williamr@2: * ObserverClass* dataObserver = new ObserverClass(); williamr@2: * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); williamr@2: * @endcode williamr@2: */ williamr@2: class IHsDataObserver williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Defines the events that may take place for a homescreen widget. williamr@2: */ williamr@2: enum EEvent williamr@2: { williamr@2: EUnknown = 0, ///< Unknown event: Means that event has not been defined. williamr@2: EActivate = 1, ///< Activation event: Means that widget has been added to HS as content. williamr@2: EDeactivate = 2, ///< Deactivation event: Means that widget has been removed frm. williamr@2: ESuspend = 3, ///< Suspension event: Means that HS reading widget data is suspended. williamr@2: EResume = 4 ///< Resume event. Means that HS reading widget data is resumed. williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Defines the events that may take place for a homescreen widget item. williamr@2: */ williamr@2: enum EItemEvent williamr@2: { williamr@2: EUnknownItemEvent = 0, ///< Unknown event: Means that event has note been defined. williamr@2: ESelect = 1 ///< Selection event: Means that the widget item has been selected. williamr@2: }; williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Intended to handle an event that occured on a widget. williamr@2: * This would include EActivate, EDeactivate, ESuspend, EReusume. williamr@2: * williamr@2: * @param aWidgetName Name of the widget that event is envoked for. williamr@2: * @param aEvent Event type that has taken place. williamr@2: */ williamr@2: virtual void handleEvent( std::string aWidgetName, williamr@2: IHsDataObserver::EEvent aEvent) = 0; williamr@2: williamr@2: /** williamr@2: * Intended to handle an event that occured on a widget's item. williamr@2: * This would include ESelection. williamr@2: * williamr@2: * @param aWidgetName Name of the widget that event is envoked for. williamr@2: * @param awidgetItemName Name of the item that event is envoked for. williamr@2: * @param aAEvent Event type that has taken place williamr@2: */ williamr@2: virtual void handleItemEvent( std::string aWidgetName, williamr@2: std::string aWidgetItemName, williamr@2: IHsDataObserver::EItemEvent aEvent) = 0; williamr@2: }; williamr@2: } williamr@2: williamr@2: #endif /*__HSDATAOBSERVER_H__*/