7be1215a811befb815ed2516731841240dbb1ec9
[apps/osp/Call.git] / inc / CallApp.h
1 #ifndef _CALLAPP_H_
2 #define _CALLAPP_H_
3
4 #include <FApp.h>
5 #include <FBase.h>
6 #include <FSystem.h>
7 #include <FUi.h>
8
9 class IAppStateChangeListener;
10
11 /**
12  * [CallAppApp] UiApp must inherit from UiApp class
13  * which provides basic features necessary to define an UiApp.
14  */
15 class CallApp
16         : public Tizen::App::UiApp
17         , public Tizen::System::IScreenEventListener
18         , public Tizen::App::IAppControlProviderEventListener
19 {
20 public:
21         /**
22          * [Test] UiApp must have a factory method that creates an instance of itself.
23          */
24         static Tizen::App::UiApp* CreateInstance(void);
25
26 public:
27         CallApp(void);
28         virtual~CallApp(void);
29
30 public:
31         // Called when the UiApp is initializing.
32         virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
33
34         // Called when the UiApp initializing is finished. 
35         virtual bool OnAppInitialized(void); 
36
37         // Called when the UiApp is requested to terminate. 
38         virtual bool OnAppWillTerminate(void); 
39
40         // Called when the UiApp is terminating.
41         virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
42
43         // Called when the UiApp's frame moves to the top of the screen.
44         virtual void OnForeground(void);
45
46         // Called when this UiApp's frame is moved from top of the screen to the background.
47         virtual void OnBackground(void);
48
49         // Called when the system memory is not sufficient to run the UiApp any further.
50         virtual void OnLowMemory(void);
51
52         // Called when the battery level changes.
53         virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
54
55         // Called when the screen turns on.
56         virtual void OnScreenOn(void);
57
58         // Called when the screen turns off.
59         virtual void OnScreenOff(void);
60
61         virtual Tizen::Ui::Scenes::SceneId GetInitialScene(void);
62
63         //Used to get launch arguments at application launch
64         Tizen::Base::Collection::IList* GetAppLaunchArguments(void);
65
66         void AddAppStateChangeListener(const IAppStateChangeListener& listener);
67
68         void RemoveAppStateChangeListener(const IAppStateChangeListener& listener);
69
70         // Called when the application control request is received from the caller application.
71         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);
72
73 private:
74         //internal function to process AppControl request.
75         void ProcessAppControlRequest(RequestId reqId, const Tizen::Base::String& operationId,const Tizen::Base::Collection::IMap* pArgsMap);
76         //internal function to handle AppControl Request for Incoming call.
77         void HandleIncomingCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
78         //internal function to handle AppControl Request for dial call.
79         void HandleDialCallAppControlRequest(RequestId reqId,const Tizen::Base::Collection::IMap* pArgsMap);
80         //Checks if the number is valid
81         bool CheckNumberIsValid(Tizen::Base::String phoneNumber);
82
83
84
85 private:
86         Tizen::Ui::Scenes::SceneId __initialSceneId;
87         Tizen::Base::Collection::ArrayList* __pLaunchArgs;
88         Tizen::Base::Collection::ArrayList __listenerList;
89 };
90
91 #endif // _CALLAPP_H_