Font impl
authorDongeup Ham <dongeup.ham@samsung.com>
Mon, 20 May 2013 10:52:43 +0000 (19:52 +0900)
committerDongeup Ham <dongeup.ham@samsung.com>
Mon, 20 May 2013 10:52:43 +0000 (19:52 +0900)
Change-Id: I9daa44fab55ebdee76436b451afcb79b78bd6acd
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
inc/InstallerDefs.h
src/XmlHandler/ManifestGenerator.cpp
src/XmlHandler/ManifestGenerator.h

index 41a9093..e198be3 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130516.1]"
+#define OSP_INSTALLER_VERSION "version=[20130520.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
 #define TIZEN_CATEGORY_MENUSCREEN                              "http://tizen.org/category/menuscreen"
 #define TIZEN_CATEGORY_ANTIVIRUS                               "http://tizen.org/category/antivirus"
 
+#define METADATA_FONT                                                  L"http://developer.samsung.com/tizen/metadata/font"
+
 #define DIR_APPLICATIONS_TMP                                   "/opt/usr/apps/tmp"
 
 #define INSTALLER_RDS_FILE_NAME                                        ".rds_delta"
index 4ba414a..f9b814a 100755 (executable)
@@ -720,6 +720,8 @@ ManifestGenerator::WriteApp(int index, AppData* pAppData)
        WriteAccounts(index);
        WriteNotifications(index);
 
+       WriteFont(index);
+
        return true;
 }
 
@@ -995,6 +997,48 @@ ManifestGenerator::WriteNotifications(int index)
 }
 
 bool
+ManifestGenerator::WriteFont(int index)
+{
+       AppLog("WriteFont");
+
+       bool isFontDetected = false;
+
+       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+       TryReturn(pAppDataList, false, "pAppDataList is null");
+
+       AppData* pAppData = null;
+       pAppDataList->GetAt(index, pAppData);
+       TryReturn(pAppData, false, "pAppData is null");
+
+       HashMap* pMetadataMap = pAppData->__pMetadataMap;
+       TryReturn(pMetadataMap, false, "pMetadataMap is null");
+
+       std::unique_ptr< IMapEnumerator > pEnum(pMetadataMap->GetMapEnumeratorN());
+       TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               String* pKey = static_cast< String* > (pEnum->GetKey());
+               TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+               if (pKey->Equals(METADATA_FONT, false) == true)
+               {
+                       isFontDetected = true;
+                       break;
+               }
+       }
+
+       if (isFontDetected == true)
+       {
+               __pWriter->StartElement("font");
+               __pWriter->WriteAttribute("appid", pAppData->__appId);
+               __pWriter->EndElement(); // end of "font"
+       }
+
+       return true;
+}
+
+bool
 ManifestGenerator::WriteMetadata(HashMap* pMetadataMap)
 {
        std::unique_ptr< IMapEnumerator > pEnum(pMetadataMap->GetMapEnumeratorN());
index 3bac4fd..89c5f9f 100755 (executable)
@@ -61,6 +61,8 @@ private:
        bool WriteAppControl(int index, bool subMode = false);
        bool WriteAccounts(int index);
        bool WriteNotifications(int index);
+       bool WriteFont(int index);
+
        bool WriteMetadata(Tizen::Base::Collection::HashMap* pMetadataMap);
        bool WritePrivileges(Tizen::Base::Collection::ArrayList* pPrivilegeList);