diff options
author | Dongeup Ham <dongeup.ham@samsung.com> | 2012-12-20 10:53:41 +0900 |
---|---|---|
committer | Dongeup Ham <dongeup.ham@samsung.com> | 2012-12-20 10:53:41 +0900 |
commit | 9020676bd843c56312bcf5733054148c654460cd (patch) | |
tree | 5a6ad3beb60d3f27df18ba22014b3d5ad45735a5 /src/XmlHandler/ManifestHandler.cpp | |
parent | c4b295fa2bfb5815fd54d8d3a16ec9ca58285741 (diff) | |
download | installer-9020676bd843c56312bcf5733054148c654460cd.tar.gz installer-9020676bd843c56312bcf5733054148c654460cd.tar.bz2 installer-9020676bd843c56312bcf5733054148c654460cd.zip |
SubMode Implementation
Change-Id: I684b31141ea7a4239adafc9c6fc35ade9fe1a5eb
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
Diffstat (limited to 'src/XmlHandler/ManifestHandler.cpp')
-rwxr-xr-x | src/XmlHandler/ManifestHandler.cpp | 110 |
1 files changed, 106 insertions, 4 deletions
diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index e745dee..aa52b1c 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -61,6 +61,8 @@ ManifestHandler::ManifestHandler(void) ,__isDefaultName(false) ,__isDefaultAppDetected(false) ,__pAppData(null) +,__pSubModeAppControlData(null) +,__pOperationData(null) { } @@ -162,6 +164,10 @@ ManifestHandler::OnStartElement(const char *pName) { status = OnContentStartElement(); } + else if (strcasecmp(pName, "Operation") == 0) + { + status = OnOperationStartElement(); + } if (!status) { @@ -220,7 +226,7 @@ ManifestHandler::OnEndElement(const char *pName) } else if (strcasecmp(pName, "Apps") == 0) { - AppLogTag(OSP_INSTALLER, "</%s>", pName); + status = OnAppsEndElement(); } else if (strcasecmp(pName, "UiScalability") == 0) { @@ -250,6 +256,10 @@ ManifestHandler::OnEndElement(const char *pName) { status = OnManifestEndElement(); } + else if (strcasecmp(pName, "Operation") == 0) + { + status = OnOperationEndElement(); + } if (!status) { @@ -332,6 +342,14 @@ ManifestHandler::OnCharacters(const char *pCharacters) { status = OnCategoryValue(pCharacters); } + else if (strcasecmp(pName, "MimeType") == 0) + { + status = OnMimeTypeValue(pCharacters); + } + else if (strcasecmp(pName, "Uri") == 0) + { + status = OnUriValue(pCharacters); + } if (!status) { @@ -406,20 +424,20 @@ ManifestHandler::OnUiAppStartElement(void) } AddAppFeature("MainmenuVisible", pMainmenuVisible); - AppLogTag(OSP_INSTALLER, "<MainmenuVisible=%s>", pMainmenuVisible); + AppLogTag(OSP_INSTALLER, " - MainmenuVisible=%s", pMainmenuVisible); } char* pGlFrame = pAttr->Find("GlFrame"); if (pGlFrame) { AddAppFeature("GlFrame", pGlFrame); - AppLogTag(OSP_INSTALLER, "<GlFrame=%s>", pGlFrame); + AppLogTag(OSP_INSTALLER, " - GlFrame=%s", pGlFrame); } char* pCategory = pAttr->Find("Category"); if (pCategory) { - AppLogTag(OSP_INSTALLER, "<Category=%s>", pCategory); + AppLogTag(OSP_INSTALLER, " - Category=%s", pCategory); if (strcasecmp(pCategory, "home-screen") == 0) { @@ -440,6 +458,16 @@ ManifestHandler::OnUiAppStartElement(void) // __pPackageAppInfoImpl->SetAppFeature(categoryType); } + char* pSubMode = pAttr->Find("SubMode"); + if (pSubMode) + { + if (strcasecmp(pSubMode, "True") == 0) + { + __pContext->__isSubMode = true; + AppLogTag(OSP_INSTALLER, " - SubMode=%s", pSubMode); + } + } + String app_id; if (__pContext->GetPackageNameType() == INSTALLER_PREFIX_TYPE_ORG) { @@ -780,6 +808,28 @@ ManifestHandler::OnResolutionStartElement(void) } bool +ManifestHandler::OnOperationStartElement(void) +{ + XmlAttribute *pAttr = null; + char *pId = null; + + pAttr = GetAttribute(); + TryReturn(pAttr, true, "[osp-installer] pAttr is null"); + + pId = pAttr->Find("Id"); + TryReturn(pId, true, "[osp-installer] pId is null"); + + __pOperationData = new (std::nothrow) OperationData; + TryReturn(__pOperationData, false, "[osp-installer] __pOperationData is null"); + + __pOperationData->__id = pId; + + AppLogTag(OSP_INSTALLER, "<Operation Id=\"%s\">", pId); + + return true; +} + +bool ManifestHandler::OnDataControlStartElement(void) { XmlAttribute *pAttr = null; @@ -961,6 +1011,25 @@ ManifestHandler::OnServiceAppEndElement(void) } bool +ManifestHandler::OnAppsEndElement(void) +{ + if (__pContext->__isSubMode == true) + { + __pAppData = new (std::nothrow) AppData; + TryReturn(__pAppData, false, "[osp-installer] __pAppData is null"); + + __pAppData->__pAppControlData = __pSubModeAppControlData; + __pSubModeAppControlData = null; + + __pContext->__pAppDataList->Add(__pAppData); + } + + AppLogTag(OSP_INSTALLER, "</Apps>"); + + return true; +} + +bool ManifestHandler::OnIconsEndElement(void) { delete[] __pDefaultIconType; @@ -977,6 +1046,12 @@ ManifestHandler::OnAppControlEndElement(void) __pAppControlInfoImpl = null; AppLogTag(OSP_INSTALLER, "</AppControl>"); + if (__pContext->__isSubMode == true) + { + __pSubModeAppControlData = __pAppData->__pAppControlData; + __pAppData->__pAppControlData = null; + } + return true; } @@ -1004,6 +1079,14 @@ ManifestHandler::OnResolutionEndElement(void) } bool +ManifestHandler::OnOperationEndElement(void) +{ + __pAppData->__pAppControlData->__pOperationDataList->Add(__pOperationData); + + return true; +} + +bool ManifestHandler::OnDataControlEndElement(void) { __pPackageAppInfoImpl->AddDataControl(__pDataControlInfoImpl); @@ -1447,6 +1530,25 @@ ManifestHandler::OnCategoryValue(const char *pCharacters) } bool +ManifestHandler::OnMimeTypeValue(const char* pCharacters) +{ + __pOperationData->__mimeType = pCharacters; + + AppLogTag(OSP_INSTALLER, "<MimeType>%s</MimeType>", pCharacters); + return true; +} + +bool +ManifestHandler::OnUriValue(const char* pCharacters) +{ + __pOperationData->__uri = pCharacters; + + AppLogTag(OSP_INSTALLER, "<Uri>%s</Uri>", pCharacters); + return true; + +} + +bool ManifestHandler::FindElement(const char *pName) { bool res = false; |