2 // Open Service Platform
\r
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Flora License, Version 1.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://www.tizenopensource.org/license
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an AS IS BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
17 //==================================================================
\r
18 // APP. Name : XmlParserApp.cpp
\r
22 //==================================================================
\r
25 #include "XmlParserApp.h"
\r
26 #include "FormMgr.h"
\r
27 #include "MainListForm.h"
\r
28 #include "XmlReader.h"
\r
30 using namespace Osp::App;
\r
31 using namespace Osp::Base;
\r
32 using namespace Osp::System;
\r
33 using namespace Osp::Ui;
\r
34 using namespace Osp::Ui::Controls;
\r
36 XmlParserApp::XmlParserApp()
\r
40 XmlParserApp::~XmlParserApp()
\r
45 XmlParserApp::CreateInstance(void)
\r
47 // Create the instance through the constructor.
\r
48 return new XmlParserApp();
\r
52 XmlParserApp::OnAppInitializing(AppRegistry& appRegistry)
\r
54 /////////////////////////////////////////////////////////////////////////////////////
\r
55 //this codes is automatically inserted by Tizen C++ application wizard.
\r
56 Frame* pAppFrame = new Frame();
\r
57 pAppFrame->Construct();
\r
58 AddFrame(*pAppFrame);
\r
59 ////////////////////////////////////////////////////////////////////////////////////
\r
60 FormMgr *pFormMgr = new FormMgr();
\r
62 String lastFormName("");
\r
63 String formIDkey("AppLastFormId");
\r
64 String formNamekey("AppLastFormName");
\r
65 result r = E_SUCCESS;
\r
67 pFormMgr->Initialize();
\r
68 GetAppFrame()->GetFrame()->AddControl(*pFormMgr);
\r
69 r = appRegistry.Get(formIDkey, lastFormId);
\r
70 if ( r == E_KEY_NOT_FOUND)
\r
72 lastFormId = FormMgr::REQUEST_MainListForm;
\r
73 appRegistry.Add(formIDkey, lastFormId);
\r
75 r = appRegistry.Get(formNamekey, lastFormName);
\r
76 if ( r == E_KEY_NOT_FOUND)
\r
78 appRegistry.Add(formNamekey, L"IDF_FORM1");
\r
80 pFormMgr->SetStarterForm((RequestId)lastFormId, null);
\r
82 // Uncomment the following statement to listen to the screen on/off events.
\r
83 //PowerManager::SetScreenEventListener(*this);
\r
88 XmlParserApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
\r
91 // Deallocate resources allocated by this application for termination.
\r
92 // The application's permanent data and context can be saved via appRegistry.
\r
98 XmlParserApp::OnForeground(void)
\r
101 // Start or resume drawing when the application is moved to the foreground.
\r
105 XmlParserApp::OnBackground(void)
\r
108 // Stop drawing when the application is moved to the background.
\r
112 XmlParserApp::OnLowMemory(void)
\r
115 // Free unused resources or close the application.
\r
119 XmlParserApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
\r
122 // Handle any changes in battery level here.
\r
123 // Stop using multimedia features(camera, mp3 etc.) if the battery level is CRITICAL.
\r
127 XmlParserApp::OnScreenOn (void)
\r
130 // Get the released resources or resume the operations that were paused or stopped in OnScreenOff().
\r
134 XmlParserApp::OnScreenOff (void)
\r
137 // 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.
\r
138 // 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.
\r
139 // Similarly, do not perform lengthy operations in this listener method. Any operation must be a quick one.
\r