Link against: hswidgetpublisher.lib
#include <hswidget.h>
A widget is identified by its templateName, widgetName, uniqueIdentifier.
@code class ObserverClass : public IHsDataObserver { void handleEvent( std::string aWidgetName, IHsDataObserver::EEvent aEvent) { } void handleItemEvent( std::string aWidgetName, std::string aWidgetItemName, IHsDataObserver::EItemEvent aEvent) { } } ObserverClass* dataObserver = new ObserverClass(); HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); HsWidget& widget = hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); hsPublisher->publishHsWidget( widget );
Public Member Functions | |
IMPORT_C void | setItem (std::string aItemName, std::string aValue) |
Adds a new widget item to the widget if it wasn't created previously or set a new value to the existing one. | |
IMPORT_C void | setItem (std::string aItemName, int aValue) |
Adds a new widget item to the widget if it wasn't created previously or set a new value to the existing one. | |
IMPORT_C void | removeItem (std::string aItemName) |
Method removes widget's item. | |
HsWidget (std::string &aTemplateName, std::string &aWidgetName, std::string &aIdentifier) | |
virtual | ~HsWidget () |
HsWidgetItem * | getWidgetItem (std::string &aItemName) |
const std::string & | getWidgetName () |
const std::string & | getTemplateName () |
const std::string & | getIdentifier () |
int | itemsCount () |
HsWidgetItem * | getWidgetItem (int aIndex) |
bool | checkIfWidgetItemExist (std::string &aItemName) |
|
|
|
|
|
|
|
|
|
|
Method removes widget's item. An attempt to remove not existing item causes exception with KErrNotFound reason; HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); HsWidget& widget = hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); widget.setItem( "myItem", "value" ); widget.removeItem( "myItem" ); hsPublisher->removeHsWidget( "templateName", "widgetName", "uniqueIdentifier" );
|
|
Adds a new widget item to the widget if it wasn't created previously or set a new value to the existing one. Widget item is identified by the name with the value provided. The value is a int. HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); HsWidget& widget = hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); // assuming count and values[] are defined while ( count ) { widget->setItem("image", values[count] ); count--; }
|
|
Adds a new widget item to the widget if it wasn't created previously or set a new value to the existing one. Widget item is identified by the name with the value provided. The value is a string. HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); HsWidget& widget = hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); // assuming count and values[] are defined while ( count ) { widget->setItem("image", values[count] ); count--; }
|