Change the certmgr appcontrol into seperated app
authorso.yu <so.yu@samsung.com>
Thu, 28 Mar 2013 02:18:06 +0000 (11:18 +0900)
committerso.yu <so.yu@samsung.com>
Thu, 28 Mar 2013 02:29:53 +0000 (11:29 +0900)
Change-Id: I992b563126cd16c9cdbf887c7edbbbd6fad6454b
Signed-off-by: so.yu <so.yu@samsung.com>
CMakeLists.txt
packaging/osp-app-controls.spec
res/arm/usr/etc/app-control-info.ini [deleted file]
src/certmgr-app-control/CMakeLists.txt [deleted file]
src/certmgr-app-control/CertMgrAppControlDllEntry.cpp [deleted file]
src/certmgr-app-control/CertificateListForm.cpp [deleted file]
src/certmgr-app-control/CertificateListForm.h [deleted file]

index 5e0863b..96c6ca7 100755 (executable)
@@ -10,7 +10,6 @@ SET(COMMON_INCLUDE_DIRS
        /usr/include/osp/base
        /usr/include/osp/io
        /usr/include/osp/net
-       /usr/include/osp/security
        /usr/include/osp/system
        /usr/include/osp/media
        /usr/include/system
@@ -48,7 +47,6 @@ ADD_SUBDIRECTORY(src/browser-app-control osp-ac-browser)
 ADD_SUBDIRECTORY(src/calendar-app-control osp-ac-calendar)
 ADD_SUBDIRECTORY(src/call-app-control osp-ac-call)
 ADD_SUBDIRECTORY(src/camera-app-control osp-ac-camera)
-ADD_SUBDIRECTORY(src/certmgr-app-control osp-ac-certmgr)
 ADD_SUBDIRECTORY(src/contact-app-control osp-ac-contact)
 ADD_SUBDIRECTORY(src/media-app-control osp-ac-media)
 ADD_SUBDIRECTORY(src/message-app-control osp-ac-message)
@@ -64,4 +62,4 @@ INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug
                                FILES_MATCHING PATTERN "*.so*" 
                                PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
                                                                                GROUP_EXECUTE GROUP_READ
-                                                                               WORLD_EXECUTE WORLD_READ)
\ No newline at end of file
+                                                                               WORLD_EXECUTE WORLD_READ)
index f3ebaae..a2de1e5 100755 (executable)
@@ -36,6 +36,7 @@ Requires: osp-bluetooth
 Requires: osp-nfc
 Requires: osp-installer
 Requires: osp-social
+Requires: apps.CertificateSelector
 
 Requires(post): coreutils
 
diff --git a/res/arm/usr/etc/app-control-info.ini b/res/arm/usr/etc/app-control-info.ini
deleted file mode 100644 (file)
index 2e667b4..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-#tizen.contacts
-Title=APPCONTROL_PROVIDER_CONTACT
-Vendor=Samsung
-Overridable=No
-OPID_Count=5
-OPID_0=http://tizen.org/appcontrol/operation/pick
-OPID_1=http://tizen.org/appcontrol/operation/add
-OPID_2=http://tizen.org/appcontrol/operation/edit
-OPID_3=http://tizen.org/appcontrol/operation/default
-OPID_4=http://tizen.org/appcontrol/operation/view
-MIME_4=text/x-cCard
-Path=libosp-ac-contact.so
-LaunchType=2
-Name=Contacts
-Public=1
-Category=osp.appcontrol.category.contact
-#tizen.calendar
-Title=APPCONTROL_PROVIDER_CALENDAR
-Overridable=No
-Vendor=Samsung
-OPID_Count=2
-OPID_0=http://tizen.org/appcontrol/operation/pick
-OPID_1=http://tizen.org/appcontrol/operation/view
-MIME_1=text/x-vCalendar
-Path=libosp-ac-calendar.so
-LaunchType=2
-Name=Calendar
-Public=1
-Category=osp.appcontrol.category.calendar
-#tizen.todo
-Title=APPCONTROL_PROVIDER_TODO
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/pick
-Path=libosp-ac-calendar.so
-LaunchType=2
-Public=0
-Category=osp.appcontrol.category.calendar
-#tizen.bluetooth
-Title=APPCONTROL_PROVIDER_BLUETOOTH
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/pick
-Path=libosp-ac-bluetooth.so
-LaunchType=2
-Name=Bluetooth
-Public=1
-Category=osp.appcontrol.category.bluetooth
-#tizen.phone
-Title=APPCONTROL_PROVIDER_CALL
-Overridable=No
-Vendor=Samsung
-OPID_Count=2
-OPID_0=http://tizen.org/appcontrol/operation/call
-OPID_1=http://tizen.org/appcontrol/operation/dial
-SCHEME_0=tel
-SCHEME_1=tel
-Path=libosp-ac-call.so
-LaunchType=2
-Name=Logs
-Public=1
-Category=osp.appcontrol.category.videocall;osp.appcontrol.category.voicecall
-#tizen.filemanager
-Title=APPCONTROL_PROVIDER_MEDIA
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/pick
-MIME_0=audio/*;video/*;image/*
-Path=libosp-ac-media.so
-LaunchType=2
-Name=My files
-Public=1
-Category=osp.appcontrol.category.media
-#tizen.messages
-Title=APPCONTROL_PROVIDER_MESSAGE
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/compose
-SCHEME_0=mms;mmsto;sms;smsto
-Path=libosp-ac-message.so
-LaunchType=2
-Name=Messages
-Public=1
-Category=osp.appcontrol.category.mms;osp.appcontrol.category.sms
-#tizen.email
-Title=APPCONTROL_PROVIDER_EMAIL
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/compose
-Path=libosp-ac-message.so
-LaunchType=2
-Name=EMail
-Public=1
-Category=osp.appcontrol.category.email
-#tizen.imageviewer
-Title=APPCONTROL_PROVIDER_IMAGE
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/view
-MIME_0=image/*
-Path=libosp-ac-media.so
-LaunchType=2
-Name=Gallery
-Public=1
-Category=osp.appcontrol.category.image
-#tizen.imageeditor
-Title=APPCONTROL_PROVIDER_IMAGE_EDITOR
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/crop
-Path=libosp-ac-media.so
-LaunchType=2
-Public=0
-Category=osp.appcontrol.category.image
-#tizen.videoplayer
-Title=APPCONTROL_PROVIDER_VIDEO
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/view
-SCHEME_0=rtsp
-MIME_0=video/*
-Path=libosp-ac-media.so
-LaunchType=2
-Name=Videos
-Public=1
-Category=osp.appcontrol.category.video
-#tizen.musicplayer
-Title=APPCONTROL_AUDIO_AUDIO
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/view
-MIME_0=audio/*
-Path=libosp-ac-media.so
-LaunchType=2
-Name=Music
-Public=1
-Category=osp.appcontrol.category.audio
-#tizen.camera
-Title=APPCONTROL_PROVIDER_CAMERA
-Overridable=No
-Vendor=Samsung
-OPID_Count=2
-OPID_0=http://tizen.org/appcontrol/operation/createcontent
-OPID_1=http://tizen.org/appcontrol/operation/createcontent
-Path=libosp-ac-camera.so
-LaunchType=2
-Name=Camera
-Public=1
-Category=osp.appcontrol.category.image
-#tizen.settings
-Title=APPCONTROL_PROVIDER_SETTINGS
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/configure
-Path=libosp-ac-setting.so
-LaunchType=2
-Public=1
-Name=Settings
-Category=osp.appcontrol.category.settings
-#tizen.certificatemanager
-Title=APPCONTROL_PROVIDER_CERTIFICATE_MANAGER
-Overridable=No
-Vendor=Samsung
-OPID_Count=1
-OPID_0=http://tizen.org/appcontrol/operation/pick
-Path=libosp-ac-certmgr.so
-LaunchType=2
-Public=1
-Name=CertificateManager
-Category=osp.appcontrol.category.certificate
diff --git a/src/certmgr-app-control/CMakeLists.txt b/src/certmgr-app-control/CMakeLists.txt
deleted file mode 100755 (executable)
index af24be3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-SET (this_target osp-ac-certmgr)
-
-INCLUDE_DIRECTORIES (
-  ${COMMON_INCLUDE_DIRS}
-       )
-
-SET (${this_target}_SOURCE_FILES
-       CertMgrAppControlDllEntry.cpp
-       CertificateListForm.cpp
-       )
-       
-## SET EXTRA COMPILER FLAGS
-SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -fPIC -Wall" )
-
-## SET C COMPILER FLAGS
-SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
-
-## SET CPP COMPILER FLAGS
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
-
-## Create Library
-ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
-
-TARGET_LINK_LIBRARIES(${this_target} osp-appfw)
-
-OSP_STRIP(${this_target})
diff --git a/src/certmgr-app-control/CertMgrAppControlDllEntry.cpp b/src/certmgr-app-control/CertMgrAppControlDllEntry.cpp
deleted file mode 100644 (file)
index c486451..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// Open Service Platform
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file        CertMgrAppControlDllEntry.cpp
- * @brief      This is the implementation for the CertMgrAppControlDllEntry.cpp class.
- */
-
-#include <appsvc/appsvc.h>
-#include <unique_ptr.h>
-#include <FAppAppControl.h>
-#include <FAppUiApp.h>
-#include <FAppIAppFrame.h>
-#include <FBaseColIList.h>
-#include <FBaseColArrayList.h>
-#include <FBaseColAllElementsDeleter.h>
-#include <FBaseDataType.h>
-#include <FBaseSysLog.h>
-#include <FBaseString.h>
-#include <FBaseErrors.h>
-#include <FBaseErrorDefine.h>
-#include <FUiCtrlFrame.h>
-#include <FOspConfig.h>
-#include <FApp_AppControlManager.h>
-#include "CertificateListForm.h"
-
-namespace Tizen { namespace Base { namespace Collection
-{
-class IList;
-} } } // Tizen::Base::Collection
-
-using namespace Tizen::App;
-using namespace Tizen::Base;
-using namespace Tizen::Base::Collection;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void Finish(bool isSelected, int certId);
-result _OSP_EXPORT_ StartAppControl(int req, const String&, const String&, const String*, const String*, const IMap*);
-result _OSP_EXPORT_ TerminateAppControl(int reqId);
-void OnAppControlResult(void*, int, service_result_e, void*);
-
-#ifdef __cplusplus
-}
-#endif
-
-namespace
-{
-int __reqId = -1;
-CertificateListForm* __pCertificateListForm = null;
-Tizen::Ui::Controls::Frame* __pFrame = null;
-const wchar_t __allowedAppControlTable[][2][64] =
-{
-       {L"osp.appcontrol.provider.certificatemanager", L"osp.appcontrol.operation.pick"},
-       {L"http://tizen.org/appcontrol/provider/certificatemanager", L"http://tizen.org/appcontrol/operation/pick"},
-       {L"tizen.certificatemanager", L"http://tizen.org/appcontrol/operation/pick"},
-};
-}
-
-result
-StartAppControl(int reqId, const String& aId, const String& oId, const String* pUri, const String* pMime, const IMap* pMap)
-{
-       result r = E_SUCCESS;
-
-       UiApp* pApp = null;
-       IAppFrame* pAppFrame = null;
-       Tizen::Ui::Controls::Frame* pFrame = null;
-
-       __reqId = reqId;
-
-       SysLog(NID_SEC_CERT, "Enter.");
-
-       SysAssertf(!__pCertificateListForm, "CertificateListForm is already constructed.");
-       SysAssertf(!__pFrame, "Frame is already prepared.");
-
-       SysTryReturnResult(NID_SEC_CERT, _AppControlManager::IsAllowedAppControl(__allowedAppControlTable, 3, aId, oId), E_SYSTEM
-               , "Invalid AppControl entry for (%ls, %ls).", aId.GetPointer(), oId.GetPointer());
-
-       SysLog(NID_SEC_CERT, "Certificate Manager AppControl.");
-
-       // Get AppFrame
-       pApp = Application::GetInstance();
-       SysTryReturnResult(NID_SEC_CERT, pApp, E_SYSTEM, "UiApp instance is not available.");
-       pAppFrame = pApp->GetAppFrame();
-       SysTryReturnResult(NID_SEC_CERT, pAppFrame, E_SYSTEM, "AppFrame instance is not available.");
-       pFrame = pAppFrame->GetFrame();
-       SysTryReturnResult(NID_SEC_CERT, pFrame, E_SYSTEM, "Frame instance is not available.");
-
-       // Add the form to the frame
-       std::unique_ptr<CertificateListForm> pCertificateListForm(new (std::nothrow) CertificateListForm());
-       SysTryReturnResult(NID_SEC_CERT, pCertificateListForm, E_OUT_OF_MEMORY, "Memory allocation failed.");
-
-       r = pCertificateListForm->Initialize();
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       r = pFrame->AddControl(*(pCertificateListForm.get()));
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       r = pFrame->SetCurrentForm(*(pCertificateListForm.get()));
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       // Draw and Show the form
-       r = pCertificateListForm->Draw();
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       __pFrame = pFrame;
-       __pCertificateListForm = pCertificateListForm.release();
-
-       SysLog(NID_SEC_CERT, "Exit.");
-
-       return r;
-}
-
-result
-TerminateAppControl(int reqId)
-{
-       result r = E_SUCCESS;
-
-       if (__reqId == reqId)
-       {
-               SysLog(NID_SEC_CERT, "The current value of reqId is %d.", reqId);
-
-               SysAssertf(__pFrame != null, "Frame instance must not be null.");
-               SysAssertf(__pCertificateListForm != null, "CertificateListForm instance must not be null.");
-
-               r = __pFrame->RemoveControl(*__pCertificateListForm);
-               SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               __reqId = -1;
-               __pCertificateListForm = null;
-               __pFrame = null;
-       }
-
-       return r;
-}
-
-void
-Finish(bool isSelected, int certId)
-{
-       result r = E_SUCCESS;
-
-       SysLog(NID_SEC_CERT, "The current value of certId is %d.", certId);
-
-       std::unique_ptr<HashMap, AllElementsDeleter> pList(new (std::nothrow) HashMap());
-       SysTryCatch(NID_SEC_CERT, pList != null, , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-       r = pList->Construct(2);
-       SysTryCatch(NID_SEC_CERT, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
-
-       if (isSelected)
-       {
-               SysLog(NID_SEC_CERT, "The current value of isSelected is true.");
-               SysTryCatch(NID_SEC_CERT, certId >= 0, , E_INVALID_ARG, "[%s] Invalid Certificate ID.", GetErrorMessage(E_INVALID_ARG));
-
-               pList->Add(new (std::nothrow) String(L"Id"), new (std::nothrow) String(Integer(certId).ToString()));
-               SysTryCatch(NID_SEC_CERT, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
-
-               // send result
-               _AppControlManager::GetInstance()->FinishAppControl(__reqId, APP_CTRL_RESULT_SUCCEEDED, pList.release());
-       }
-       else
-       {
-               SysLog(NID_SEC_CERT, "The current value of isSelected is false.");
-
-               // send result
-               _AppControlManager::GetInstance()->FinishAppControl(__reqId, APP_CTRL_RESULT_CANCELED, null);
-       }
-
-       return;
-
-CATCH:
-       _AppControlManager::GetInstance()->FinishAppControl(__reqId, APP_CTRL_RESULT_FAILED, null);
-}
-
-void
-OnAppControlResult(void* b, int requestCode, service_result_e res, void* userData)
-{
-}
diff --git a/src/certmgr-app-control/CertificateListForm.cpp b/src/certmgr-app-control/CertificateListForm.cpp
deleted file mode 100644 (file)
index ca3d867..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-// Open Service Platform
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file       CertificateListForm.cpp
- * @brief      This file contains the implementation of CertificateListForm class.
- */
-
-#include <unique_ptr.h>
-#include <FBaseDataType.h>
-#include <FBaseErrors.h>
-#include <FBaseErrorDefine.h>
-#include <FBaseString.h>
-#include <FBaseSysLog.h>
-#include <FGrpDimension.h>
-#include <FGrpRectangle.h>
-#include <FUiCtrlCustomItem.h>
-#include <FUiCtrlFooter.h>
-#include <FUiCtrlForm.h>
-#include <FUiCtrlFooter.h>
-#include <FUiCtrlListItemBase.h>
-#include <FUiCtrlListView.h>
-#include <FSecCert_CertService.h>
-#include <FSecCert_CertTypes.h>
-#include "CertificateListForm.h"
-
-
-using namespace Tizen::Base;
-using namespace Tizen::Ui::Controls;
-using namespace Tizen::Graphics;
-using namespace Tizen::Security::Cert;
-
-extern "C"
-{
-void Finish(bool isSelected, int certId);
-}
-
-static const int HD_RESOLUTION_WIDTH = 720;
-static const int ITEM_HEIGHT = 112; // in 720X1280px resolution
-static const int ITEM_LEFT_MARGIN = 26; // in 720X1280px resolution
-static const wchar_t EMPTY_LIST_STRING[] = L"No Certificate";
-static const wchar_t TITLE_STRING[] = L"USER CERTIFICATES";
-
-CertificateListForm::CertificateListForm(void)
-       : __pCertList(null)
-       , __pCertIndex(null)
-       , __certCount(0)
-       , __itemLeftMargin(ITEM_LEFT_MARGIN)
-       , __itemHeight(ITEM_HEIGHT)
-{
-}
-
-CertificateListForm::~CertificateListForm(void)
-{
-}
-
-result
-CertificateListForm::Initialize(void)
-{
-       result r = E_SUCCESS;
-
-       r = Construct(FORM_STYLE_INDICATOR | FORM_STYLE_TITLE | FORM_STYLE_FOOTER);
-       SysTryReturnResult(NID_SEC_CERT, !IsFailed(r), E_SYSTEM, "Failed to construct CertificateListForm.");
-
-       return r;
-}
-
-result
-CertificateListForm::OnInitializing(void)
-{
-       result r = E_SUCCESS;
-
-       int count = 0;
-       int certCount = 0;
-       int invalidCount = 0;
-       Footer* pFooter = null;
-
-       r = SetTitleText(TITLE_STRING, ALIGNMENT_LEFT);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       // footer
-       pFooter = GetFooter();
-       SysTryReturnResult(NID_SEC_CERT, pFooter != null, E_SYSTEM, "Footer instance is not available.");
-
-       r = pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       r = pFooter->SetBackButton();
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       SetFormBackEventListener(this);
-
-       // load user certificates
-       _CertFieldInfos* pRawCertList = null;
-       certCount = _CertService::GetUserCertFieldInfoN(pRawCertList);
-       r = GetLastResult();
-       std::unique_ptr<_CertFieldInfos[]> pCertList(pRawCertList);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       // trivial condition
-       SysAssertf(((certCount > 0) && (pCertList != null)) || ((certCount == 0) && (pCertList == null))
-               , "A system error has been occurred. Because invalid cert count was returned.");
-
-       // cert index : count only for valid certificate
-       std::unique_ptr<int[]> pCertIndex(new (std::nothrow) int[certCount]);
-       SysTryReturnResult(NID_SEC_CERT, pCertIndex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
-
-       // assign number of certificate which is valid(certTitle or subjectName must be exist)
-       for (count = 0; count < certCount; count++)
-       {
-               if (!pCertList[count].certTitle[0] && !pCertList[count].subjectName[0])
-               {
-                       invalidCount++;
-                       continue;
-               }
-               pCertIndex[count - invalidCount] = count;
-       }
-       __certCount = certCount - invalidCount;
-
-       // listview
-       std::unique_ptr<ListView> pListView(new (std::nothrow) ListView());
-       SysTryReturnResult(NID_SEC_CERT, pListView != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
-
-       if (__itemHeight == ITEM_HEIGHT && __itemLeftMargin == ITEM_LEFT_MARGIN)
-       {
-               double ratio = 1.0;
-               double logicalWidth = HD_RESOLUTION_WIDTH;
-               Dimension tempDim = CoordinateSystem::GetLogicalResolution();
-               logicalWidth = tempDim.width;
-               SysAssertf(logicalWidth > 0.0, "invalid logical resolution (%lf)", logicalWidth);
-
-               ratio = logicalWidth / HD_RESOLUTION_WIDTH;
-
-               // __itemHeight : 112 = logicalWidth : HD_RESOLUTION_WIDTH(720)
-               __itemHeight = static_cast<int>(__itemHeight * ratio);
-
-               // __itemLeftMargin : 26 = logicalWidth : HD_RESOLUTION_WIDTH(720)
-               __itemLeftMargin = static_cast<int>(__itemLeftMargin * ratio);
-       }
-
-       Rectangle rect(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
-       r = pListView->Construct(rect, true, false);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       r = pListView->SetItemProvider(*this);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       r = pListView->SetTextOfEmptyList(EMPTY_LIST_STRING);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       pListView->AddListViewItemEventListener(*this);
-
-       r = AddControl(*(pListView.release()));
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-
-       __pCertIndex = std::move(pCertIndex);
-       __pCertList = std::move(pCertList);
-
-       return r;
-}
-
-result
-CertificateListForm::OnTerminating(void)
-{
-       return E_SUCCESS;
-}
-
-// IFormBackEventListener
-void
-CertificateListForm::OnFormBackRequested(Form& source)
-{
-       Finish(false, -1);
-}
-
-// IListViewItemProvider
-ListItemBase*
-CertificateListForm::CreateItem(int index, int itemWidth)
-{
-       result r = E_SUCCESS;
-       int validIndex = 0;
-       ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
-
-       Rectangle rect(__itemLeftMargin, 0, itemWidth - (__itemLeftMargin * 2), __itemHeight);
-       Dimension dim(itemWidth, __itemHeight);
-
-       SysLog(NID_SEC_CERT, "The current value of index is %d", index);
-
-       // convert to valid index
-       SysAssertf((index >= 0) && (index < __certCount), "index (%d) is out of range.", index);
-       SysAssertf(__pCertIndex != null, "__pCertIndex instance must not be null.");
-       validIndex = __pCertIndex[index];
-       SysLog(NID_SEC_CERT, "The current value of validIndex is %d", validIndex);
-
-       // make item
-       std::unique_ptr<CustomItem> pItem(new (std::nothrow) CustomItem());
-       SysTryReturn(NID_SEC_CERT, pItem != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
-       r = pItem->Construct(dim, style);
-       SysTryReturn(NID_SEC_CERT, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       // prevent overflow
-       __pCertList[validIndex].certTitle[_MAX_ISSUER_SUBJECT_NAME_SIZE] = '\0';
-       __pCertList[validIndex].subjectName[_MAX_ISSUER_SUBJECT_NAME_SIZE] = '\0';
-
-       SysLog(NID_SEC_CERT, "The current value of certFileId is %d", __pCertList[validIndex].certFileId);
-
-       // add to item, certFileId become elementId
-       if (__pCertList[validIndex].certTitle[0])
-       {       // it has valid certTitle
-               SysLog(NID_SEC_CERT, "The current value of certTitle is %s", __pCertList[validIndex].certTitle);
-               r = pItem->AddElement(rect, __pCertList[validIndex].certFileId, __pCertList[validIndex].certTitle);
-               SysTryReturn(NID_SEC_CERT, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
-       }
-       else
-       {       // it is not reached because it already checked by OnInitializing method.
-               SysAssertf(__pCertList[validIndex].subjectName[0], "_CertFieldInfos instance must not be null.");
-
-               // it has valid subjectName
-               SysLog(NID_SEC_CERT, "The current value of subjectName is %s", __pCertList[validIndex].subjectName);
-               r = pItem->AddElement(rect, __pCertList[validIndex].certFileId, __pCertList[validIndex].subjectName);
-               SysTryReturn(NID_SEC_CERT, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
-       }
-
-       return pItem.release();
-}
-
-bool
-CertificateListForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
-{
-       delete pItem;
-       return true;
-}
-
-int
-CertificateListForm::GetItemCount(void)
-{
-       SysLog(NID_SEC_CERT, "The current value of __certCount is %d", __certCount);
-       return __certCount;
-}
-
-// IListViewItemEventListener
-void
-CertificateListForm::OnListViewItemStateChanged(ListView &listView, int index, int elementId, ListItemStatus status)
-{
-       SysLog(NID_SEC_CERT, "The current value of elementId(certFileId) is %d", elementId);
-       Finish(true, elementId);
-}
-
-void
-CertificateListForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
-{
-}
-
-void
-CertificateListForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
-{
-}
diff --git a/src/certmgr-app-control/CertificateListForm.h b/src/certmgr-app-control/CertificateListForm.h
deleted file mode 100644 (file)
index 88b0f36..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// Open Service Platform
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file               CertificateListForm.h
- * @brief              This file contains the declaration of CertificateListForm class.
- */
-
-#ifndef _CERTIFICATELISTFORM_H_
-#define _CERTIFICATELISTFORM_H_
-
-#include <unique_ptr.h>
-#include <FBaseDataType.h>
-#include <FUiCtrlForm.h>
-#include <FUiCtrlIFormBackEventListener.h>
-#include <FUiCtrlIListViewItemEventListener.h>
-#include <FUiCtrlIListViewItemProvider.h>
-#include <FUiCtrlListViewTypes.h>
-#include <FUiCtrlListItemBase.h>
-
-
-namespace Tizen { namespace Ui { namespace Controls
-{
-class ListView;
-} } } // Tizen::Ui::Controls
-
-namespace Tizen { namespace Security { namespace Cert
-{
-struct _CertFieldInfos;
-} } } // Tizen::Security::Cert
-
-class CertificateListForm
-       : public Tizen::Ui::Controls::Form
-       , virtual public Tizen::Ui::Controls::IListViewItemProvider
-       , virtual public Tizen::Ui::Controls::IListViewItemEventListener
-       , virtual public Tizen::Ui::Controls::IFormBackEventListener
-{
-
-// Construction
-public:
-       CertificateListForm(void);
-       virtual ~CertificateListForm(void);
-       result Initialize(void);
-
-private:
-       // prevent copy and assignment
-       CertificateListForm(const CertificateListForm& rhs);
-       CertificateListForm& operator =(const CertificateListForm& rhs);
-
-       // Form
-       virtual result OnInitializing(void);
-       virtual result OnTerminating(void);
-
-       // IFormBackEventListener
-       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
-
-       // IListViewItemProvider
-       virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
-       virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
-       virtual int GetItemCount(void);
-
-       // IListViewItemEventListener
-       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
-       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
-       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
-
-private:
-       std::unique_ptr<Tizen::Security::Cert::_CertFieldInfos[]> __pCertList;
-       std::unique_ptr<int[]> __pCertIndex;
-       int __certCount;
-       int __itemLeftMargin;
-       int __itemHeight;
-};
-
-#endif //_CERTIFICATELISTFORM_H_