2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
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.
24 class IAppStateChangeListener;
27 * [CallAppApp] UiApp must inherit from UiApp class
28 * which provides basic features necessary to define an UiApp.
31 : public Tizen::App::UiApp
32 , public Tizen::System::IScreenEventListener
33 , public Tizen::App::IAppControlProviderEventListener
34 , public Tizen::App::IActiveAppEventListener
38 * [Test] UiApp must have a factory method that creates an instance of itself.
40 static Tizen::App::UiApp* CreateInstance(void);
44 virtual~CallApp(void);
47 // Called when the UiApp is initializing.
48 virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
50 // Called when the UiApp initializing is finished.
51 virtual bool OnAppInitialized(void);
53 // Called when the UiApp is requested to terminate.
54 virtual bool OnAppWillTerminate(void);
56 // Called when the UiApp is terminating.
57 virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
59 // Called when the UiApp's frame moves to the top of the screen.
60 virtual void OnForeground(void);
62 // Called when this UiApp's frame is moved from top of the screen to the background.
63 virtual void OnBackground(void);
65 // Called when the system memory is not sufficient to run the UiApp any further.
66 virtual void OnLowMemory(void);
68 // Called when the battery level changes.
69 virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
71 // Called when the screen turns on.
72 virtual void OnScreenOn(void);
74 // Called when the screen turns off.
75 virtual void OnScreenOff(void);
77 //Called when application becomes active
78 virtual void OnActiveAppChanged(const Tizen::Base::String& appId);
80 virtual Tizen::Ui::Scenes::SceneId GetInitialScene(void);
82 //Used to get launch arguments at application launch
83 Tizen::Base::Collection::IList* GetAppLaunchArguments(void);
85 void AddAppStateChangeListener(const IAppStateChangeListener& listener);
87 void RemoveAppStateChangeListener(const IAppStateChangeListener& listener);
89 // Called when the application control request is received from the caller application.
90 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);
91 //Called when incoming call has to be handled
92 void SetTopMostWindow(bool bTopMost);
95 //internal function to process AppControl request.
96 void ProcessAppControlRequest(RequestId reqId, const Tizen::Base::String& operationId,const Tizen::Base::Collection::IMap* pArgsMap,const Tizen::Base::String* pUriData =null);
97 //internal function to process AppControl request.
98 void ProcessWebAppControlRequest(RequestId reqId, const Tizen::Base::String& operationId,const Tizen::Base::String* pUriData);
100 //internal function to handle AppControl Request for Incoming call.
101 void HandleIncomingCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
102 //internal function to handle AppControl Request for dial call.
103 void HandleDialCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap,const Tizen::Base::String* pUriData);
104 //Checks if the number is valid
105 bool CheckNumberIsValid(Tizen::Base::String phoneNumber);
110 Tizen::Ui::Scenes::SceneId __initialSceneId;
111 Tizen::Base::Collection::ArrayList* __pLaunchArgs;
112 Tizen::Base::Collection::ArrayList __listenerList;
115 #endif // _CALLAPP_H_