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
35 , public Tizen::Base::Runtime::ITimerEventListener
39 * [Test] UiApp must have a factory method that creates an instance of itself.
41 static Tizen::App::UiApp* CreateInstance(void);
45 virtual~CallApp(void);
48 // Called when the UiApp is initializing.
49 virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
51 // Called when the UiApp initializing is finished.
52 virtual bool OnAppInitialized(void);
54 // Called when the UiApp is requested to terminate.
55 virtual bool OnAppWillTerminate(void);
57 // Called when the UiApp is terminating.
58 virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
60 // Called when the UiApp's frame moves to the top of the screen.
61 virtual void OnForeground(void);
63 // Called when this UiApp's frame is moved from top of the screen to the background.
64 virtual void OnBackground(void);
66 // Called when the system memory is not sufficient to run the UiApp any further.
67 virtual void OnLowMemory(void);
69 // Called when the battery level changes.
70 virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
72 // Called when the screen turns on.
73 virtual void OnScreenOn(void);
75 // Called when the screen turns off.
76 virtual void OnScreenOff(void);
78 //Called when application becomes active
79 virtual void OnActiveAppChanged(const Tizen::Base::String& appId);
81 virtual Tizen::Ui::Scenes::SceneId GetInitialScene(void);
83 //Used to get launch arguments at application launch
84 Tizen::Base::Collection::IList* GetAppLaunchArguments(void);
86 void AddAppStateChangeListener(const IAppStateChangeListener& listener);
88 void RemoveAppStateChangeListener(const IAppStateChangeListener& listener);
90 // Called when the application control request is received from the caller application.
91 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);
92 //Called when incoming call has to be handled
93 void SetTopMostWindow(bool bTopMost);
94 //Gets the time duration since appplication has been launched
95 long long GetCallAppTicks(void);
98 //internal function to process AppControl request.
99 void ProcessAppControlRequest(RequestId reqId, const Tizen::Base::String& operationId,const Tizen::Base::Collection::IMap* pArgsMap,const Tizen::Base::String* pUriData =null);
100 //internal function to process AppControl request.
101 void ProcessWebAppControlRequest(RequestId reqId, const Tizen::Base::String& operationId,const Tizen::Base::String* pUriData);
103 //internal function to handle AppControl Request for Incoming call.
104 void HandleIncomingCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
105 //internal function to handle AppControl Request for dial call.
106 void HandleDialCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap,const Tizen::Base::String* pUriData);
107 //Checks if the number is valid
108 bool CheckNumberIsValid(Tizen::Base::String phoneNumber);
110 void ShowAutoRejectPopup(Tizen::Base::String contactNumber);
111 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer &timer);
116 Tizen::Ui::Scenes::SceneId __initialSceneId;
117 Tizen::Base::Collection::ArrayList* __pLaunchArgs;
118 Tizen::Base::Collection::ArrayList __listenerList;
119 Tizen::Ui::Controls::Popup* __pCallRejectedIonPopup;
120 Tizen::Base::Runtime::Timer __callRejectedIontimer;
121 long long __callTicks;
122 Tizen::Base::Runtime::Timer* __pCallAppTimer;
125 #endif // _CALLAPP_H_