Hs::HsWidget Class Reference
Class defining a Homescreen Widget. 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 );
Constructor & Destructor Documentation
HsWidget(std::string &, std::string &, std::string &, std::string &, std::string &)
Member Functions Documentation
checkIfWidgetItemExist(std::string &)
bool
|
checkIfWidgetItemExist
|
(
|
std::string
&
|
aItemName
|
)
|
|
getWidgetItem(std::string &)
removeItem(std::string)
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" );
-
Exceptions
-
setItem(std::string, std::string)
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--;
}
-
Exceptions
-
setItem(std::string, int)
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. 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--;
}
-
Exceptions
-
Parameters
std::string
aItemName
|
|
int aValue
|
Integer value of the widget item.
|
Member Data Documentation
std::string
mIconLocation
std::vector< HsWidgetItem * > mItems
std::string
mTemplateName
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.