Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnSettingsSpeedDialForm.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
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                PhnSettingsSpeedDialForm.h
19  * @brief               This is the header file for the %SettingsSpeedDialForm class.
20  *
21  * This header file contains the declarations for %SettingsSpeedDialForm class.
22  */
23 #ifndef _PHN_SETTINGS_SPEED_DIAL_FORM_H_
24 #define _PHN_SETTINGS_SPEED_DIAL_FORM_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28 #include "PhnSettingsConstants.h"
29 #include "PhnSpeedDialPopup.h"
30 #include "PhnIPopupItemSelectListener.h"
31
32 class SettingsPresentationModel;
33 class SpeedDialInfo;
34
35 /**
36  * @class SettingsSpeedDialForm
37  * @brief This class presents a additional settings form for setting and updating speed dial settings.
38  *
39  */
40 class SettingsSpeedDialForm
41         : public Tizen::Ui::IActionEventListener
42         , public Tizen::Ui::Controls::Form
43         , public Tizen::Ui::Controls::IFormBackEventListener
44         , public Tizen::Ui::Scenes::ISceneEventListener
45         , public Tizen::App::IAppControlResponseListener
46         , public Tizen::Social::IAddressbookEventListener
47         , public IPopupItemSelectListener
48 {
49 public:
50         SettingsSpeedDialForm(void);
51         virtual ~SettingsSpeedDialForm(void);
52         bool Initialize(void);
53
54 public:
55         virtual result OnInitializing(void);
56         virtual result OnTerminating(void);
57         //From IActionEventListener
58         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
59         //From IFormBackEventListener
60         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
61
62         //From ISceneEventListener
63         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
64         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
65         //From IAppControlResponseListener
66         virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
67         //From IPopupEventListener
68         void OnItemSelected(int itemIndex);
69         //From IAddressbookEventListener
70         virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
71         virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList){};
72
73
74 private:
75         // Function is used to initialise footer and footer items.
76         void InitializeFooter(void);
77         // Function is used to initialise buttons and add listener.
78         void InitializePhotoButtons(const Tizen::Base::String& btnName, const Tizen::Base::String& lblName, ActionId actionId);
79         // Function is used to initialise voice mail button and add listener.
80         void InitializeVoiceMail(void);
81         //Launches contacts app control for pick operation
82         void LaunchAppControl(void);
83         // updates the button according to the button clicked
84         void UpdateButton(void);
85         // updates all buttons
86         void UpdateAllButtons(void);
87
88 private:
89         Tizen::Base::Collection::HashMapT<int,SpeedDialInfo>* __pSpeedDialMappingList;
90         //Singleton do not delete
91         SettingsPresentationModel* __pSettingsPresentor;
92         int __keyToMap;
93         bool __isUpdate;
94         bool __isDeleteMode;
95         Tizen::Social::Addressbook* __pAddressbook;
96         SpeedDialPopup* __pSpeedDialPopup;
97         Tizen::Base::Collection::ArrayListT<int>* __pDeleteList;
98         Tizen::Ui::Scenes::SceneId* __pPreviousSceneId;
99         bool __isContactAppControlLaunched;
100 };
101
102 #endif  //_PHN_SETTINGS_SPEED_DIAL_FORM_H_