Initialize Tizen 2.3
[apps/osp/Contacts.git] / inc / CtContactsApp.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file        CtContactsApp.h
19  * @brief       This is the header file for the ContactsApp class.
20  */
21
22 #ifndef _CT_CONTACTS_APP_H_
23 #define _CT_CONTACTS_APP_H_
24
25 #include <FApp.h>
26 #include <FBase.h>
27 #include <FSystem.h>
28 #include <FUi.h>
29 #include "CtTypes.h"
30
31 #define __SUPPORT_VIDEO_CALL 0
32
33 class IContactsAppStateChangeEventListener;
34
35 class ContactsApp
36         : public Tizen::App::UiApp
37         , public Tizen::App::IAppCheckpointEventListener
38         , public Tizen::App::IAppControlProviderEventListener
39         , public Tizen::System::IScreenEventListener
40         , public Tizen::System::ISettingEventListener
41 {
42 public:
43         ContactsApp(void);
44         virtual ~ContactsApp(void);
45
46         static Tizen::App::UiApp* CreateInstance(void);
47
48         Tizen::Base::String GetOperationId(void);
49         AppControlSelectionMode GetSelectionMode(void);
50         AppControlReturnType GetReturnType(void);
51         RequestId GetRequestId(void);
52         Tizen::Ui::Scenes::SceneId GetInitialSceneId(void);
53         Tizen::Base::Collection::IList* GetArguments(void);
54
55         void InitializeFontSize(void);
56         int GetFontSize(void);
57         int GetListItemSingleLineHeight(void);
58         int GetFontHeightOffset(void);
59
60         void AddContactsAppChangeEventListener(const IContactsAppStateChangeEventListener& listener);
61         void RemoveContactsAppChangeEventListener(const IContactsAppStateChangeEventListener& listener);
62
63         bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
64         bool OnAppInitialized(void); 
65         bool OnAppWillTerminate(void); 
66         bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
67         void OnForeground(void);
68         void OnBackground(void);
69         void OnLowMemory(void);
70         void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
71         void OnScreenOn(void);
72         void OnScreenOff(void);
73         void OnAppCheckpointing(Tizen::App::AppRegistry& appRegistry);
74
75         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);
76         virtual void OnSettingChanged(Tizen::Base::String& key);
77
78 private:
79         result InitializeAppControl(Tizen::Base::Collection::IList* pArg);
80         result ParseAppControlArgument(const Tizen::Base::String& argument, Tizen::Base::String& type, Tizen::Base::String& content);
81
82 private:
83         Tizen::Ui::Scenes::SceneId __initialSceneId;
84         Tizen::Base::Collection::ArrayList __listenerList;
85         Tizen::Base::Collection::IList* __pArgs;
86         Tizen::Base::String __operationId;
87         AppControlSelectionMode __selectionMode;
88         AppControlReturnType __returnType;
89         RequestId __requestId;
90         int             __fontSize;
91 };
92
93 #endif  //_CT_CONTACTS_APP_H_