add useDecoration attribute for each size of AppWidget tag (ACR)
authorjungmin76.park <jungmin76.park@samsung.com>
Wed, 12 Jun 2013 02:04:01 +0000 (11:04 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Fri, 14 Jun 2013 01:40:41 +0000 (10:40 +0900)
Change-Id: I973b6408059f8912ed74d92b5604dade8c7370b5
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
inc/InstallerDefs.h
src/Context/InstallationContextData.cpp
src/Context/InstallationContextData.h
src/XmlHandler/ManifestGenerator.cpp
src/XmlHandler/Parser/ManifestLiveboxesParser.cpp

index d4a2403..f8c70e6 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130613.3]"
+#define OSP_INSTALLER_VERSION "version=[20130614.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 753a490..a082035 100755 (executable)
@@ -83,7 +83,27 @@ AccountData::Construct()
 
        return true;
 }
+LiveboxSizeInfo::LiveboxSizeInfo(const String& previewImage, bool useDecorationFrame)
+ :__previewImage(previewImage), __useDecorationFrame(useDecorationFrame)
+{
+
+}
+
+LiveboxSizeInfo::~LiveboxSizeInfo(void)
+{
+}
 
+String
+LiveboxSizeInfo::GetPreviewImage(void) const
+{
+       return __previewImage;
+}
+
+bool
+LiveboxSizeInfo::UseDecorationFrame(void) const
+{
+       return __useDecorationFrame;
+}
 
 LiveboxData::LiveboxData(void)
 :__updatePeriod(0)
@@ -177,11 +197,11 @@ LiveboxData::GetNameList(void) const
 }
 
 result
-LiveboxData::AddSize(String* pSize, String* pPreviewImage)
+LiveboxData::AddSize(String* pSize, LiveboxSizeInfo* pSizeInfo)
 {
        result r = E_SUCCESS;
 
-       r = __pSizeList->Add(pSize, pPreviewImage);
+       r = __pSizeList->Add(pSize, pSizeInfo);
 
        return r;
 }
index e8d82f8..02eff3e 100755 (executable)
 
 #include "InstallerDefs.h"
 
+class LiveboxSizeInfo
+       : public Tizen::Base::Object
+{
+public:
+       LiveboxSizeInfo(const Tizen::Base::String& previewImage, bool useDecorationFrame);
+       ~LiveboxSizeInfo(void);
+
+       Tizen::Base::String     GetPreviewImage(void) const;
+       bool UseDecorationFrame(void) const;
+
+private:
+       Tizen::Base::String     __previewImage;
+       bool    __useDecorationFrame;
+};
+
 class LiveboxData
        : public Tizen::Base::Object
 {
@@ -49,7 +64,7 @@ public:
        result AddName(const Tizen::Base::String& language, const Tizen::Base::String& name);
        Tizen::Base::Collection::HashMap* GetNameList(void) const;
 
-       result AddSize(Tizen::Base::String* pSize, Tizen::Base::String* pPreviewImage);
+       result AddSize(Tizen::Base::String* pSize, LiveboxSizeInfo* pSizeInfo);
        Tizen::Base::Collection::HashMap* GetSizeList(void) const;
 
        Tizen::Base::String __default;
index 1c931b0..3cd2647 100755 (executable)
@@ -358,14 +358,23 @@ ManifestGenerator::WriteLiveboxSizeValue(IMap* pList, const String& element, con
                        continue;
                }
 
-               String* pPriviewImage = static_cast< String* > (pMapEnum->GetValue());
+               LiveboxSizeInfo* pSizeInfo = static_cast< LiveboxSizeInfo* > (pMapEnum->GetValue());
 
                __pWriter->StartElement(element);
-               if (pPriviewImage && pPriviewImage->IsEmpty() == false)
+               if (pSizeInfo)
                {
-                       String previewImagePath;
-                       previewImagePath.Format(1024, L"%ls/%ls", previewDir.GetPointer(), pPriviewImage->GetPointer());
-                       __pWriter->WriteAttribute("preview", previewImagePath);
+                       String previewImage = pSizeInfo->GetPreviewImage();
+                       if (previewImage.IsEmpty() == false)
+                       {
+                               String previewImagePath;
+                               previewImagePath.Format(1024, L"%ls/%ls", previewDir.GetPointer(), previewImage.GetPointer());
+                               __pWriter->WriteAttribute("preview", previewImagePath);
+                       }
+
+                       if (pSizeInfo->UseDecorationFrame() == true)
+                       {
+                               __pWriter->WriteAttribute("need_frame", "true");
+                       }
                }
                __pWriter->WriteString(*pSize);
                __pWriter->EndElement();
index 0a4c3ff..56591da 100755 (executable)
@@ -218,8 +218,8 @@ ManifestLiveboxesParser::OnSizeValue(const char *pCharacters)
 
        AppLog("  <Size>%s</Size>", pCharacters);
 
-       std::unique_ptr< String > pPreviewImage(new (std::nothrow) String);
-       TryReturn(pPreviewImage, false, "pPreviewImage is null.");
+       String previewImage;
+       bool useDecorationFrame = false;
 
        XmlAttribute* pAttr = pHandler->GetAttribute();
        if (pAttr)
@@ -233,11 +233,11 @@ ManifestLiveboxesParser::OnSizeValue(const char *pCharacters)
 
                        if (strcasecmp(pDefaultIconType, "Xhigh") == 0)
                        {
-                               pPreviewImage->Format(1024, L"screen-density-xhigh/%s", pAttrValue);
+                               previewImage.Format(1024, L"screen-density-xhigh/%s", pAttrValue);
                        }
                        else if (strcasecmp(pDefaultIconType, "High") == 0)
                        {
-                               pPreviewImage->Format(1024, L"screen-density-high/%s", pAttrValue);
+                               previewImage.Format(1024, L"screen-density-high/%s", pAttrValue);
                        }
                        else
                        {
@@ -246,9 +246,18 @@ ManifestLiveboxesParser::OnSizeValue(const char *pCharacters)
 
                        AppLog("   - PreviewImage=%s", pAttrValue);
                }
+
+               pAttrValue = pAttr->Find("UseDecorationFrame");
+               if (pAttrValue && strcmp(pAttrValue, "True") == 0)
+               {
+                       useDecorationFrame = true;
+               }
        }
 
-       __pLiveboxData->AddSize(new (std::nothrow) String(pCharacters), pPreviewImage.release());
+       std::unique_ptr< LiveboxSizeInfo > pSizeInfo(new (std::nothrow) LiveboxSizeInfo(previewImage, useDecorationFrame) );
+       TryReturn(pSizeInfo, false, "pSizeInfo is null.");
+
+       __pLiveboxData->AddSize(new (std::nothrow) String(pCharacters), pSizeInfo.release());
 
        return true;
 }