[BasicApp] Change license statements
[apps/native/sample/BasicApp.git] / project / src / BasicApp.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 #include <new>
18
19 #include "BasicApp.h"
20 #include "BasicAppFrame.h"
21
22 using namespace Tizen::App;
23 using namespace Tizen::Base;
24 using namespace Tizen::System;
25 using namespace Tizen::Ui::Controls;
26
27 BasicApp::BasicApp(void)
28 {
29 }
30
31 BasicApp::~BasicApp(void)
32 {
33 }
34
35 Application*
36 BasicApp::CreateInstance(void)
37 {
38         // Create the instance through the constructor.
39         return new (std::nothrow) BasicApp();
40 }
41
42 bool
43 BasicApp::OnAppInitializing(AppRegistry& appRegistry)
44 {
45         int lastPanelId = 0;
46         String lastPanelName(L"");
47         String panelIDkey(L"AppLastPanelId");
48         String panelNamekey(L"AppLastPanelName");
49
50         result r = appRegistry.Get(panelIDkey, lastPanelId);
51         if (r == E_KEY_NOT_FOUND)
52         {
53                 lastPanelId = 0;
54                 appRegistry.Add(panelIDkey, lastPanelId);
55         }
56
57         r = appRegistry.Get(panelNamekey, lastPanelName);
58         if (r == E_KEY_NOT_FOUND)
59         {
60                 appRegistry.Add(panelNamekey, L"Panel1");
61         }
62
63         // Create a Frame
64         BasicAppFrame* pBasicAppFrame = new (std::nothrow) BasicAppFrame();
65         pBasicAppFrame->Initialize(lastPanelId);
66         pBasicAppFrame->SetName(L"BasicApp");
67         AddFrame(*pBasicAppFrame);
68
69         return true;
70 }
71
72 bool
73 BasicApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
74 {
75         return true;
76 }
77
78 void
79 BasicApp::OnForeground(void)
80 {
81 }
82
83 void
84 BasicApp::OnBackground(void)
85 {
86 }
87
88 void
89 BasicApp::OnLowMemory(void)
90 {
91 }
92
93 void
94 BasicApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
95 {
96 }
97
98 void
99 BasicApp::OnScreenOn (void)
100 {
101 }
102
103 void
104 BasicApp::OnScreenOff (void)
105 {
106 }