[BasicApp] Change license statements
[apps/native/sample/BasicApp.git] / project / src / BasicAppFrame.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 "BasicAppFrame.h"
20 #include "MainForm.h"
21
22 using namespace Tizen::Base;
23 using namespace Tizen::Ui;
24 using namespace Tizen::Ui::Controls;
25
26 BasicAppFrame::BasicAppFrame(void)
27         : __panelId(0)
28 {
29 }
30
31 BasicAppFrame::~BasicAppFrame(void)
32 {
33 }
34
35 result
36 BasicAppFrame::Initialize(int panelId)
37 {
38         result r = Frame::Construct();
39         __panelId = panelId;
40
41         return r;
42 }
43
44 result
45 BasicAppFrame::OnInitializing(void)
46 {
47         // Create a form
48         MainForm* pMainForm = new (std::nothrow) MainForm();
49         result r = pMainForm->Initialize(__panelId);
50
51         // Add the form to the frame
52         AddControl(pMainForm);
53
54         // Set the current form
55         SetCurrentForm(*pMainForm);
56
57         // Draw the form
58         pMainForm->Invalidate(true);
59
60         return r;
61 }
62
63 result
64 BasicAppFrame::OnTerminating(void)
65 {
66         result r = E_SUCCESS;
67
68         return r;
69 }