2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
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.
18 * @file PhnSettingsCallForwardWaitBarrForm.h
19 * @brief This is the header file for the %SettingsCallForwardWaitBarrForm class.
21 * This header file contains the declarations for %SettingsCallForwardWaitBarrForm class.
23 #ifndef _PHN_SETTINGS_CALL_FORWARD_WAIT_BARR_FORM_H_
24 #define _PHN_SETTINGS_CALL_FORWARD_WAIT_BARR_FORM_H_
28 #include "PhnErrorMsgPopup.h"
29 #include "PhnISettingsEventListener.h"
31 class SettingsPresentationModel;
34 * @class SettingsCallForwardWaitBarrForm
35 * @brief This class presents a settings form based UI for call settings - Forwarding, waiting, barring call .
38 class SettingsCallForwardWaitBarrForm
39 : public ISettingsEventListener
40 , public IPopupClosedEventListener
41 , public Tizen::Ui::IActionEventListener
42 , public Tizen::Ui::Controls::Form
43 , public Tizen::Ui::Controls::IFormBackEventListener
44 , public Tizen::Ui::Controls::IGroupedTableViewItemProvider
45 , public Tizen::Ui::Controls::IGroupedTableViewItemEventListener
46 , public Tizen::Ui::Scenes::ISceneEventListener
51 FORMTYPE_CALLFORWARDING_TYPE, //decide voice/video type for forwarding
52 FORMTYPE_VOICE_CALLFORWARDING, //actual options for call forwarding
53 FORMTYPE_CALLBARRING_TYPE, //decide voice/video type for barring
54 FORMTYPE_VOICE_CALLBARRING, //actual options for call barring
55 FORMTYPE_CALL_WAITING, //call waiting options
59 SettingsCallForwardWaitBarrForm(FormType formType);
60 virtual ~SettingsCallForwardWaitBarrForm(void);
61 void Initialize(void);
64 virtual result OnInitializing(void);
65 virtual result OnTerminating(void);
66 //From IActionEventListener
67 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
68 //From IFormBackEventListener
69 virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
70 //From ISceneEventListener
71 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
72 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
74 //From IGroupedTableViewItemEventListener - Called when the state of a TableViewGroupItem is changed.
75 virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status){};
76 //From IGroupedTableViewItemEventListener - Called when the state of a TableViewItem in the GroupedTableView is changed.
77 virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
78 //From IGroupedTableViewItemEventListener - Called when the TableViewContextItem is opened or closed.
79 virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated){};
81 //From IGroupedTableViewItemProvider - Gets the total number of groups.
82 virtual int GetGroupCount(void);
83 //From IGroupedTableViewItemProvider - Gets the total number of items in the specified group.
84 virtual int GetItemCount(int groupIndex);
85 //From IGroupedTableViewItemProvider - Gets the group item for the specified index from the item provider.
86 virtual Tizen::Ui::Controls::TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth);
87 //From IGroupedTableViewItemProvider - Deletes the specified group item.
88 virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
89 //From IGroupedTableViewItemProvider - Updates the specified group item.
90 virtual void UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
91 //From IGroupedTableViewItemProvider - Creates the specified item.
92 virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth);
93 //From IGroupedTableViewItemProvider - Deletes the specified item.
94 virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
95 //From IGroupedTableViewItemProvider - Updates the specified item.
96 virtual void UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
97 //From IGroupedTableViewItemProvider - Gets the default height of an group item.
98 virtual int GetDefaultGroupItemHeight(void);
99 //From IGroupedTableViewItemProvider - Gets the default height of an item.
100 virtual int GetDefaultItemHeight(void);
102 //From ISettingsEventListener
103 virtual void HandleGetCallWaitingResponse(bool isCallSuccessful, bool callWaitingActivated);
104 virtual void HandleSetCallWaitingResponse(bool isCallSuccessful, bool isCallWaitingEnabled);
105 virtual void HandleGetCallForwardResponse(bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool callForwardActivated, int noReplyWaitTime);
106 virtual void HandleSetCallForwardResponse(bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool isCallForwardActivated, int noReplyWaitTime);
107 virtual void HandleGetCallBarringResponse(bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
108 virtual void HandleSetCallBarringResponse(bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
110 //Event Listener method from IPopupClosedEventListener
111 virtual void HandlePopupClosed(void);
114 //Function is used to initialize group table menu
115 result InitializeGroupedTableView(void);
116 // Function is used to create list items which come under "CallTypeItemIds"
117 Tizen::Ui::Controls::TableViewItem* CreateSettingCallTypeMenuItem(int itemIndex, int itemWidth);
118 // Function is used to handle item selection which come under "CallTypeItemIds"
119 void HandleCallTypeSelected(int itemIndex);
120 // Function is used to create list items under "CallForwardItemIds"
121 Tizen::Ui::Controls::TableViewItem* CreateCallForwardingOptions(int itemIndex, int itemWidth);
122 // Function is used to handle item selection for "CallForwardItemIds"
123 void HandleCallForwardingOptionSelected(int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
124 // Function is used to create list items only which come under "CallBarringItemIds"
125 Tizen::Ui::Controls::TableViewItem* CreateCallBarringOptions(int itemIndex, int itemWidth);
126 // Function is used to handle item selection for "CallBarringItemIds"
127 void HandleCallBarringOptionSelected(int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
128 // This function is used to create list items which come under "CallBarringItemIds"
129 Tizen::Ui::Controls::TableViewItem* CreateCallWaitingOptions(int itemIndex, int itemWidth);
130 // Function is used to handle item selection for "CallWaitingItemIds"
131 void HandleCallWaitingOptionSelected(Tizen::Ui::Controls::TableViewItem* pItem, int itemIndex, Tizen::Ui::Controls::TableViewItemStatus status);
132 // Used to show error message popup
133 void ShowErrorMessage(int errorCode);
134 //used to un-check all items in group
135 void UncheckAllOptions(void);
136 //Used to fetch processing animation and construct animation list.
137 void ConstructAnimationList(void);
140 //Groups supported by group table view
146 CALLFORWARDING_GROUP,
149 //Setting ids for "CALLFORWARDING_GROUP" group
150 enum CallForwardItemIds
154 CALLFORWARD_IF_NO_REPLY,
155 CALLFORWARD_IF_OUT_OF_REACH,
156 CALLFORWARD_TOTALITEMCOUNT, //always the last element to get settings count
158 //Setting ids for "CALLBARRING_GROUP" group
159 enum CallBarringItemIds
161 CALLBARRING_ALL_OUTGOING_CALL,
162 CALLBARRING_INTERNATIONAL_CALL,
163 CALLBARRING_INTERNATIONAL_EXCEPT_HOME,
164 CALLBARRING_ALL_INCOMING_CALL,
165 CALLBARRING_INCOMING_WHILE_ROAMING,
166 CALLBARRING_TOTALCOUNT, //always the last element to get settings count
168 //Setting ids for "CALLWAITING_GROUP" group
169 enum CallWaitingItemIds
172 CALLWAITING_TOTALCOUNT, //always the last element to get settings count
178 // CALLTYPE_VIDEO_CALL,
179 CALLTYPE_TOTALCOUNT, //always the last element to get group count
182 //used to record which view to open - Call Forwarding, Barring, Waiting.
184 SettingsPresentationModel* __pSettingsPresentor;
186 ErrorMsgPopup* __pErrorMsgPopup;
187 //used to check if 'CALLFORWARD_ALWAYS' is activated
188 bool __isCallForwardAlwaysActivated;
189 //For processing animation
190 Tizen::Base::Collection::ArrayList* __pAnimationFrameList;
191 //Used to check if call waiting status is available.
192 bool __isCallWaitingStatusAvailable;
193 //Used to check call waiting is Enabled
194 bool __isCallWaitingEnabled;
197 #endif //_PHN_SETTINGS_CALL_FORWARD_WAIT_BARR_FORM_H_