2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.tizenopensource.org/license
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #include "FaceRecognizer.h"
19 #include "FaceDetectionForm.h"
21 using namespace Osp::App;
22 using namespace Osp::Base;
23 using namespace Osp::Graphics;
24 using namespace Osp::Io;
25 using namespace Osp::System;
26 using namespace Osp::Text;
27 using namespace Osp::Ui;
28 using namespace Osp::Ui::Controls;
30 FaceRecognizer::FaceRecognizer()
34 FaceRecognizer::~FaceRecognizer()
39 FaceRecognizer::CreateInstance(void)
41 // Create the instance through the constructor.
42 return new FaceRecognizer();
46 FaceRecognizer::OnAppInitializing(AppRegistry& appRegistry)
48 // Initialize UI resources and application specific data.
49 // The application's permanent data and context can be obtained from the appRegistry.
51 // If this method is successful, return true; otherwise, return false.
52 // If this method returns false, the application will be terminated.
54 FaceDetectionForm *pForm = new FaceDetectionForm();
55 pForm->Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER |FORM_STYLE_INDICATOR);
58 Header* pHeader = pForm->GetHeader();
59 pHeader->SetTitleText(L"Face Recognizer");
61 result r = GetAppFrame()->GetFrame()->AddControl(*pForm);
64 AppLog("Failed to attach FormMgr to the frame\n");
68 // Uncomment the following statement to listen to the screen on/off events.
69 //PowerManager::SetScreenEventListener(*this);
76 FaceRecognizer::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
78 // Deallocate resources allocated by this application for termination.
79 // The application's permanent data and context can be saved via appRegistry.
84 FaceRecognizer::OnForeground(void)
86 // Start or resume drawing when the application is moved to the foreground.
90 FaceRecognizer::OnBackground(void)
92 // Stop drawing when the application is moved to the background.
96 FaceRecognizer::OnLowMemory(void)
98 // Free unused resources or close the application.
102 FaceRecognizer::OnBatteryLevelChanged(BatteryLevel batteryLevel)
104 // Handle any changes in battery level here.
105 // Stop using multimedia features(camera, mp3 etc.) if the battery level is CRITICAL.
109 FaceRecognizer::OnScreenOn (void)
111 // Get the released resources or resume the operations that were paused or stopped in OnScreenOff().
115 FaceRecognizer::OnScreenOff (void)
117 // Unless there is a strong reason to do otherwise, release resources (such as 3D, media, and sensors) to allow the device to enter the sleep mode to save the battery.
118 // Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a callback before the device enters the sleep mode.
119 // Similarly, do not perform lengthy operations in this listener method. Any operation must be a quick one.