2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
19 * @brief This is the header file for the %PhoneApp class.
21 * This header file contains the declarations for %PhoneApp class.
23 #ifndef _PHN_PHONE_APP_H_
24 #define _PHN_PHONE_APP_H_
31 class IAppStateChangeListener;
35 * @brief PhoneApp must inherit from UiApp class
36 * which provides basic features necessary to define an UiApp.
40 : public Tizen::App::UiApp
41 , public Tizen::System::IScreenEventListener
42 , public Tizen::App::IAppControlProviderEventListener
46 static Tizen::App::UiApp* CreateInstance(void);
50 virtual ~PhoneApp(void);
53 bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
54 bool OnAppInitialized(void);
55 bool OnAppWillTerminate(void);
56 bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
57 void OnForeground(void);
58 void OnBackground(void);
59 void OnLowMemory(void);
60 void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
61 void OnScreenOn(void);
62 void OnScreenOff(void);
64 // Called when the application control request is received from the caller application.
65 virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData);
67 //Used to query whether application is initialized as AppControl.
68 bool IsOpenAsAppControl(void);
69 //Used to get the initial scene Id
70 Tizen::Ui::Scenes::SceneId GetInitialScene(void);
71 //Used to set initial scene id
72 void SetInitialScene(Tizen::Ui::Scenes::SceneId initialSceneId);
73 //Used to get launch arguments at application launch
74 Tizen::Base::Collection::IList* GetAppLaunchArguments(void);
76 void AddAppStateChangeListener(const IAppStateChangeListener& listener);
77 void RemoveAppStateChangeListener(const IAppStateChangeListener& listener);
80 //internal function to process AppControl request.
81 void ProcessAppControlRequest(RequestId reqId, const Tizen::Base::String& operationId,const Tizen::Base::Collection::IMap* pArgsMap);
82 //internal function to handle AppControl Request for Incoming call.
83 void HandleIncomingCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
84 //internal function to handle AppControl Request for Dial.
85 void HandleDialerAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
86 //internal function to handle AppControl Request for dial call.
87 void HandleDialCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
88 //internal function to handle AppControl Request for call Settings.
89 void HandleSettingsAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
92 //Used to implement AppControl Specific features.
93 bool __isOpenAsAppControl;
94 Tizen::Base::Collection::ArrayList* __pLaunchArgs;
95 //Used to store initial scene id
96 Tizen::Ui::Scenes::SceneId __initialSceneId;
97 Tizen::Base::Collection::ArrayList __listenerList;
100 #endif // _PHN_PHONE_APP_H_