From 35506044915c67085015cf6ce71bb3964cc1c04a Mon Sep 17 00:00:00 2001 From: Dongeup Ham Date: Mon, 20 May 2013 19:52:43 +0900 Subject: [PATCH] Font impl Change-Id: I9daa44fab55ebdee76436b451afcb79b78bd6acd Signed-off-by: Dongeup Ham --- inc/InstallerDefs.h | 4 +++- src/XmlHandler/ManifestGenerator.cpp | 44 ++++++++++++++++++++++++++++++++++++ src/XmlHandler/ManifestGenerator.h | 2 ++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h index 41a9093..e198be3 100755 --- a/inc/InstallerDefs.h +++ b/inc/InstallerDefs.h @@ -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" @@ -117,6 +117,8 @@ #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" diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 4ba414a..f9b814a 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -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* 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()); diff --git a/src/XmlHandler/ManifestGenerator.h b/src/XmlHandler/ManifestGenerator.h index 3bac4fd..89c5f9f 100755 --- a/src/XmlHandler/ManifestGenerator.h +++ b/src/XmlHandler/ManifestGenerator.h @@ -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); -- 2.7.4