Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnSettingsMainMenuForm.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                PhnSettingsMainMenuForm.h
19  * @brief               This is the header file for the %SettingsMainMenuForm class.
20  *
21  * This header file contains the declarations for %SettingsMainMenuForm class.
22  */
23 #ifndef _PHN_SETTINGS_MAIN_MENU_FORM_H_
24 #define _PHN_SETTINGS_MAIN_MENU_FORM_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28
29 /**
30  * @class SettingsMainMenuForm
31  * @brief This class presents a main menu form based UI for call settings.
32  *
33  */
34 class SettingsMainMenuForm
35         : public Tizen::Ui::IActionEventListener
36         , public Tizen::Ui::Controls::Form
37         , public Tizen::Ui::Controls::IFormBackEventListener
38         , public Tizen::Ui::Controls::IGroupedTableViewItemProvider
39         , public Tizen::Ui::Controls::IGroupedTableViewItemEventListener
40         , public Tizen::Ui::Scenes::ISceneEventListener
41 {
42 public:
43         SettingsMainMenuForm(void);
44         virtual ~SettingsMainMenuForm(void);
45         bool Initialize(void);
46
47 public:
48         virtual result OnInitializing(void);
49         virtual result OnTerminating(void);
50         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
51         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
52         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
53         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
54
55         //From IGroupedTableViewItemEventListener - Called when the state of a TableViewGroupItem is changed.
56         virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status){};
57         //From IGroupedTableViewItemEventListener - Called when the state of a TableViewItem in the GroupedTableView is changed.
58         virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
59         //From IGroupedTableViewItemEventListener - Called when the TableViewContextItem is opened or closed.
60         virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated){};
61
62         //From IGroupedTableViewItemProvider - Gets the total number of groups.
63         virtual int GetGroupCount(void);
64         //From IGroupedTableViewItemProvider - Gets the total number of items in the specified group.
65         virtual int GetItemCount(int groupIndex);
66         //From IGroupedTableViewItemProvider - Gets the group item for the specified index from the item provider.
67         virtual Tizen::Ui::Controls::TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth);
68         //From IGroupedTableViewItemProvider - Deletes the specified group item.
69         virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
70         //From IGroupedTableViewItemProvider - Updates the specified group item.
71         virtual void UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
72         //From IGroupedTableViewItemProvider - Creates the specified item.
73         virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth);
74         //From IGroupedTableViewItemProvider - Deletes the specified item.
75         virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
76         //From IGroupedTableViewItemProvider - Updates the specified item.
77         virtual void UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
78         //From IGroupedTableViewItemProvider - Gets the default height of an group item.
79         virtual int GetDefaultGroupItemHeight(void);
80         //From IGroupedTableViewItemProvider - Gets the default height of an item.
81         virtual int GetDefaultItemHeight(void);
82
83 private:
84         //Function is used to initialize group table view.
85         result InitializeGroupedTableView(void);
86
87 private:
88         //Groups for main menu
89         enum MainMenuGroupId
90         {
91                 GROUP_CALL_REJECTION,
92                 GROUP_CALL_REJECTION_HLPTXT,
93                 GROUP_REJECT_MSG,
94                 GROUP_REJECT_MSG_HLPTXT,
95                 GROUP_MAIN_CALL_SETTINGS,
96 //              GROUP_VIDEOCALL_SETTING,
97 //              GROUP_VOICEMAIL_SETTING,
98                 GROUP_TOTALCOUNT, //always the last element to get group count
99         };
100
101         //Items for 'GROUP_CALL_REJECTION'
102         enum GroupCallRejectionItems
103         {
104                 CALLREJECTION_CALLREJECT_SETTINGS,
105                 CALLREJECTION_TOTALCOUNT,
106         };
107
108         //Items for 'GROUP_REJECT_MSG'
109         enum GroupRejectMsgItems
110         {
111                 REJECTMSG_REJECT_MESSAGES_SETTINGS,
112                 REJECTMSG_TOTALCOUNT,
113         };
114
115         //Setting id's for "GROUP_MAIN_CALL_SETTINGS" group
116         enum GroupMainCallSettingsItems
117         {
118                 MAINCALLSETTINGS_SPEEDDIAL,
119                 MAINCALLSETTINGS_CALLFORWARDING,
120                 MAINCALLSETTINGS_MORECALLSETTINGS,
121                 MAINCALLSETTINGS_TOTALCOUNT, //always the last element to get settings count
122         };
123 };
124
125 #endif  //_PHN_SETTINGS_MAIN_MENU_FORM_H_