homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp
branchRCL_3
changeset 27 2c7f27287390
parent 23 ace62b58f4b2
--- a/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp	Mon Jun 21 16:00:38 2010 +0300
+++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp	Thu Jul 15 18:59:18 2010 +0300
@@ -83,6 +83,7 @@
 	std::string& aWidgetName, std::string& aIdentifier,
 	std::string& aDescription, std::string& aIconLocation)
 	{
+    aTemplateName = TemplateName( aTemplateName );
 	if( CheckIfWidgetExist( aTemplateName, aWidgetName, aIdentifier, EFalse ) )
 		{
 		throw HsException( KErrAlreadyExists );
@@ -543,6 +544,7 @@
 	std::string& aWidgetName,
 	std::string& aIdentifier )
 	{
+    aTemplateName = TemplateName( aTemplateName );
 	HsWidget* ret( 0 );
 	int count = mWidgets.size();
 	for (int index = 0; index < count; index++)
@@ -637,6 +639,7 @@
 	std::string& aWidgetName,
 	std::string& aIdentifier )
 	{
+    aTemplateName = TemplateName( aTemplateName );
 	HsWidget* ret( 0 );
 	int count = mWidgets.size();
 	for (int index = 0; index < count; index++)
@@ -816,8 +819,7 @@
 	CLiwDefaultMap* aDataMap )
     {
     __ASSERT_ALWAYS( aDataMap, User::Invariant() );
-
-    HBufC* templateType = StdStringToUnicodeLC( aWidget.getTemplateName() );
+    HBufC* templateType = StdStringToUnicodeLC( TemplateName (aWidget.getTemplateName()) );
     HBufC* widgetName = StdStringToUnicodeLC( aWidget.getWidgetName() );
 	    
 	aDataMap->InsertL( KTemplateType, TLiwVariant( *templateType ) );
@@ -1086,3 +1088,19 @@
             aSrcString.c_str() );
     return Utf8ToUnicodeLC( srcDescriptor );
     }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+std::string HsWidgetPublisherImpl::TemplateName(const std::string &aSrcTemplate)
+    {
+    // In 9.2 HS wideimage template is reserved for wrt and cwrt widget.
+    // to support backward(5.0) compatability posterwideimage template 
+    // will be usedfor wideimage template
+    if (aSrcTemplate == std::string("wideimage") )
+        {
+        return std::string("posterwideimage");
+        }
+    return aSrcTemplate;
+    }