diff options
author | Dongeup Ham <dongeup.ham@samsung.com> | 2012-10-29 16:07:34 +0900 |
---|---|---|
committer | Dongeup Ham <dongeup.ham@samsung.com> | 2012-10-29 16:07:34 +0900 |
commit | f50725771059bc65a5037f7bca6bf8874e011c05 (patch) | |
tree | 92d1e5f44c2d5fbf2eb1bcf58dbc4de582a267e3 /src/XmlHandler | |
parent | fcdc8bac94e30ac11fa4ba9a450b21fa2415c006 (diff) | |
download | installer-f50725771059bc65a5037f7bca6bf8874e011c05.tar.gz installer-f50725771059bc65a5037f7bca6bf8874e011c05.tar.bz2 installer-f50725771059bc65a5037f7bca6bf8874e011c05.zip |
Implementation for fonts and improve for installer utilities.
Change-Id: Iec6d88b9a7766570a2cdab9a64a12402dfdd79c4
Diffstat (limited to 'src/XmlHandler')
-rwxr-xr-x | src/XmlHandler/ManifestGenerator.cpp | 2 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestHandler.cpp | 107 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestHandler.h | 5 |
3 files changed, 108 insertions, 6 deletions
diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index c03822e..82027c3 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -493,4 +493,6 @@ ManifestGenerator::WriteAppControl(_PackageAppInfoImpl* pAppInfoImpl) const __pWriter->EndElement(); } } + + return true; } diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index 7c2c773..3561bee 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -40,6 +40,7 @@ ManifestHandler::ManifestHandler(void) :__pContext(null) ,__pPrivilegeList(null) ,__pLiveBoxList(null) +,__pContentInfoList(null) ,__pPackageInfoImpl(null) ,__pPackageAppInfoImpl(null) ,__pAppControlInfoImpl(null) @@ -50,6 +51,7 @@ ManifestHandler::ManifestHandler(void) ,__pLaunchConditionImpl(null) ,__pNotificationImpl(null) ,__pLiveboxInfo(null) +,__pContentInfo(null) ,__pDefaultIconType(null) ,__isDefaultMainmenu(false) ,__isDefaultSetting(false) @@ -147,6 +149,14 @@ ManifestHandler::OnStartElement(const char *pName) { status = OnLiveBoxElement(); } + else if (strcasecmp(pName, "Contents") == 0) + { + status = OnContentsElement(); + } + else if (strcasecmp(pName, "Content") == 0) + { + status = OnContentElement(); + } if (!status) { @@ -183,7 +193,6 @@ ManifestHandler::OnEndElement(const char *pName) __isDefaultName = false; AppLogTag(OSP_INSTALLER, "</%s>", pName); } - else if (strcasecmp(pName, "AppControl") == 0) { __pPackageAppInfoImpl->AddAppControl(__pAppControlInfoImpl); @@ -232,11 +241,6 @@ ManifestHandler::OnEndElement(const char *pName) else if (strcasecmp(pName, "Apps") == 0) { AppLogTag(OSP_INSTALLER, "</%s>", pName); - if (__isDefaultAppDetected == false) - { - fprintf(stderr, "__isDefaultAppDetected is false.\n"); - } - TryReturn(__isDefaultAppDetected, false, "[osp-installer][Error] Default App is not detected..."); } else if (strcasecmp(pName, "UiScalability") == 0) { @@ -254,12 +258,33 @@ ManifestHandler::OnEndElement(const char *pName) __pLiveBoxList = null; AppLogTag(OSP_INSTALLER, "</%s>", pName); } + else if (strcasecmp(pName, "Contents") == 0) + { + __pContext->SetContentInfoList(__pContentInfoList); + __pContentInfoList = null; + AppLogTag(OSP_INSTALLER, "</%s>", pName); + } else if (strcasecmp(pName, "LiveBox") == 0) { __pLiveBoxList->Add(*__pLiveboxInfo); __pLiveboxInfo = null; AppLogTag(OSP_INSTALLER, "</%s>", pName); } + else if (strcasecmp(pName, "Content") == 0) + { + __pContentInfoList->Add(*__pContentInfo); + __pContentInfo = null; + AppLogTag(OSP_INSTALLER, "</%s>", pName); + } + else if (strcasecmp(pName, "Manifest") == 0) + { + if (__isDefaultAppDetected == false) + { + fprintf(stderr, "__isDefaultAppDetected is false.\n"); + } + TryReturn(__isDefaultAppDetected, false, "[osp-installer][Error] Default App is not detected..."); + AppLogTag(OSP_INSTALLER, "</%s>", pName); + } if (!status) { @@ -433,6 +458,57 @@ ManifestHandler::OnLiveBoxElement(void) } bool +ManifestHandler::OnContentsElement(void) +{ + __pContentInfoList = new ArrayList; + TryReturn(__pContentInfoList, false, "[osp-installer] __pContentInfoList is null"); + + AppLogTag(OSP_INSTALLER, "<Contents>"); + + return true; +} + +bool +ManifestHandler::OnContentElement(void) +{ + TryReturn(__pContentInfo == null, false, "[osp-installer] __pContentInfo is not null"); + + XmlAttribute *pAttr = null; + char *pDefault = null; + + __pContentInfo = new ContentInfo; + TryReturn(__pContentInfo, false, "[osp-installer] __pLiveboxInfo is null"); + + pAttr = GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + char* pId = pAttr->Find("Id"); + if (pId) + { + __pContentInfo->SetContentId(pId); + } + + char* pEntryName = pAttr->Find("EntryName"); + if (pEntryName) + { + __pContentInfo->SetContentId(pEntryName); + } + + pDefault = pAttr->Find("Default"); + if (pDefault) + { + if (strcasecmp(pDefault, "True") == 0) + { + __isDefaultAppDetected = true; + } + } + + AppLogTag(OSP_INSTALLER, "<Content Id=\"%s\" EntryName=\"%s\">", pId, pEntryName); + + return true; +} + +bool ManifestHandler::OnUiScalabilityElement(void) { XmlAttribute *pAttr = null; @@ -591,6 +667,12 @@ bool ManifestHandler::OnTypeValue(const char *pCharacters) { __pPackageInfoImpl->SetAppType(pCharacters); + + if (strcasecmp(pCharacters, "Contents") == 0) + { + __pPackageInfoImpl->SetAppApiVersion("3.0"); + } + AppLogTag(OSP_INSTALLER, "<Type>%s</Type>", pCharacters); return true; @@ -660,6 +742,11 @@ ManifestHandler::OnIconValue(const char *pCharacters) TryReturn(__pLiveboxInfo, false, "[osp-installer] __pLiveboxInfo is null"); __pLiveboxInfo->SetIcon(icon); } + else if (FindElement("Content") == true) + { + TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null"); + __pContentInfo->SetIcon(icon); + } else { if (strcasecmp(pAttrValue1, "MainMenu") == 0) @@ -734,6 +821,14 @@ ManifestHandler::OnNameValue(const char *pCharacters) StringUtil::Utf8ToString(pCharacters, *pValue); __pLiveboxInfo->AddName(*(new String(pAttrValue)), *pValue); } + else if (FindElement("Content") == true) + { + TryReturn(__pContentInfo, false, "[osp-installer] __pContentInfo is null"); + + String* pValue = new String; + StringUtil::Utf8ToString(pCharacters, *pValue); + __pContentInfo->AddName(*(new String(pAttrValue)), *pValue); + } else { if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0) diff --git a/src/XmlHandler/ManifestHandler.h b/src/XmlHandler/ManifestHandler.h index 6801d0b..59ab3c2 100755 --- a/src/XmlHandler/ManifestHandler.h +++ b/src/XmlHandler/ManifestHandler.h @@ -53,10 +53,13 @@ private: virtual bool OnStartElement(const char *pName); virtual bool OnEndElement(const char *pName); virtual bool OnCharacters(const char *pCharacters); + bool OnPrivilegesElement(void); bool OnPrivilegesEndElement(void); bool OnLiveBoxesElement(void); bool OnLiveBoxElement(void); + bool OnContentsElement(void); + bool OnContentElement(void); bool OnUiScalabilityElement(void); bool OnUiThemeElement(void); bool OnIconsElement(void); @@ -91,6 +94,7 @@ private: InstallationContext* __pContext; Osp::Base::Collection::ArrayList* __pPrivilegeList; Osp::Base::Collection::ArrayList* __pLiveBoxList; + Osp::Base::Collection::ArrayList* __pContentInfoList; Osp::App::_PackageInfoImpl* __pPackageInfoImpl; Osp::App::_PackageAppInfoImpl* __pPackageAppInfoImpl; Osp::App::_AppControlInfoImpl* __pAppControlInfoImpl; @@ -101,6 +105,7 @@ private: Osp::App::_LaunchConditionInfoImpl* __pLaunchConditionImpl; Osp::App::_NotificationInfoImpl* __pNotificationImpl; LiveboxInfo* __pLiveboxInfo; + ContentInfo* __pContentInfo; char* __pDefaultIconType; bool __isDefaultMainmenu; |