Tizen 2.0 Release
[apps/osp/Phone.git] / src / PhnPhoneAppFrame.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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
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 /**
18  * @file    PhoneAppFrame.cpp
19  * @brief   Phone Application Frame
20  */
21 #include "PhnPhoneApp.h"
22 #include "PhnPhoneAppFrame.h"
23 #include "PhnSceneRegister.h"
24
25 using namespace Tizen::App;
26 using namespace Tizen::Ui::Scenes;
27
28 PhoneAppFrame::PhoneAppFrame(void)
29 {
30 }
31
32 PhoneAppFrame::~PhoneAppFrame(void)
33 {
34 }
35
36 result
37 PhoneAppFrame::OnInitializing(void)
38 {
39         result r = E_FAILURE;
40         PhoneApp* pPhoneApp = static_cast<PhoneApp*>(UiApp::GetInstance());
41         if(pPhoneApp != null && pPhoneApp->GetInitialScene().IsEmpty() == false)
42         {
43                 //Initialize factory methods and register all scenes.
44                 r = SceneRegister::RegisterAllScenes();
45                 TryReturn(r == E_SUCCESS, r , "Scene registration failed");
46
47                 //start initial Form
48                 SceneManager* pSceneManager = SceneManager::GetInstance();
49                 r = pSceneManager->GoForward( ForwardSceneTransition(pPhoneApp->GetInitialScene(), SCENE_TRANSITION_ANIMATION_TYPE_NONE,
50                         SCENE_HISTORY_OPTION_NO_HISTORY), pPhoneApp->GetAppLaunchArguments());
51         }
52         return r;
53 }
54
55 result
56 PhoneAppFrame::OnTerminating(void)
57 {
58         result r = E_SUCCESS;
59         return r;
60 }