2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CertificateSelectorApp.cpp
19 * @brief This is the implementation for the %CertificateSelectorApp class.
22 #include <unique_ptr.h>
23 #include <FAppAppRegistry.h>
24 #include <FAppAppControlProviderManager.h>
26 #include "CertificateSelectorFrame.h"
27 #include "CertificateSelectorApp.h"
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
31 using namespace Tizen::System;
32 using namespace Tizen::Ui;
33 using namespace Tizen::Ui::Controls;
35 CertificateSelectorApp::CertificateSelectorApp(void)
40 CertificateSelectorApp::~CertificateSelectorApp(void)
45 CertificateSelectorApp::CreateInstance(void)
47 return new CertificateSelectorApp();
51 CertificateSelectorApp::OnAppInitializing(AppRegistry& appRegistry)
55 r = Tizen::App::AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this);
60 CertificateSelectorApp::OnAppInitialized(void)
64 std::unique_ptr<CertificateSelectorFrame> pCertificateSelectorFrame(new (std::nothrow) CertificateSelectorFrame());
65 TryReturnResult(pCertificateSelectorFrame, false, E_OUT_OF_MEMORY
66 , "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
68 r = pCertificateSelectorFrame->Construct();
69 TryReturnResult(!IsFailed(r), false, r, "[%s] Propagating.", GetErrorMessage(r));
71 pCertificateSelectorFrame->SetName(L"CertificateSelector");
73 AppAssertf(__reqId > -1, "The request ID is invalid.");
74 pCertificateSelectorFrame->SetRequestId(__reqId);
76 r = AddFrame(*(pCertificateSelectorFrame.release()));
77 TryReturnResult(!IsFailed(r), false, r, "[%s] Propagating.", GetErrorMessage(r));
83 CertificateSelectorApp::OnAppWillTerminate(void)
90 CertificateSelectorApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
96 CertificateSelectorApp::OnForeground(void)
101 CertificateSelectorApp::OnBackground(void)
106 CertificateSelectorApp::OnLowMemory(void)
111 CertificateSelectorApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
116 CertificateSelectorApp::OnScreenOn(void)
121 CertificateSelectorApp::OnScreenOff(void)
126 CertificateSelectorApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)
128 AppLog("The current value of the request ID is %d.", reqId);