Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnSettingsRejectMsgsForm.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                PhnSettingsRejectListForm.h
19  * @brief               This is the header file for the %SettingsRejectMsgsForm class.
20  *
21  * This header file contains the declarations for %SettingsRejectMsgsForm class.
22  */
23 #ifndef _PHN_SETTINGS_REJECT_MSGS_FORM_H_
24 #define _PHN_SETTINGS_REJECT_MSGS_FORM_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28
29 class SettingsPresentationModel;
30
31 /**
32  * @class SettingsRejectMsgsForm
33  * @brief This class presents a additional settings form for storing reject messages.
34  *
35  */
36 class SettingsRejectMsgsForm
37         : public Tizen::Ui::IActionEventListener
38         , public Tizen::Ui::Controls::Form
39         , public Tizen::Ui::Controls::IFormBackEventListener
40         , public Tizen::Ui::Controls::IGroupedTableViewItemProvider
41         , public Tizen::Ui::Controls::IGroupedTableViewItemEventListener
42         , public Tizen::Ui::Scenes::ISceneEventListener
43 {
44 public:
45         SettingsRejectMsgsForm(void);
46         virtual ~SettingsRejectMsgsForm(void);
47         bool Initialize(void);
48
49 public:
50         virtual result OnInitializing(void);
51         virtual result OnTerminating(void);
52         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
53         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
54         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
55         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
56
57         //From IGroupedTableViewItemEventListener - Called when the state of a TableViewGroupItem is changed.
58         virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status){};
59         //From IGroupedTableViewItemEventListener - Called when the state of a TableViewItem in the GroupedTableView is changed.
60         virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
61         //From IGroupedTableViewItemEventListener - Called when the TableViewContextItem is opened or closed.
62         virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated){};
63
64         //From IGroupedTableViewItemProvider - Gets the total number of groups.
65         virtual int GetGroupCount(void);
66         //From IGroupedTableViewItemProvider - Gets the total number of items in the specified group.
67         virtual int GetItemCount(int groupIndex);
68         //From IGroupedTableViewItemProvider - Gets the group item for the specified index from the item provider.
69         virtual Tizen::Ui::Controls::TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth);
70         //From IGroupedTableViewItemProvider - Deletes the specified group item.
71         virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
72         //From IGroupedTableViewItemProvider - Updates the specified group item.
73         virtual void UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
74         //From IGroupedTableViewItemProvider - Creates the specified item.
75         virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth);
76         //From IGroupedTableViewItemProvider - Deletes the specified item.
77         virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
78         //From IGroupedTableViewItemProvider - Updates the specified item.
79         virtual void UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
80         //From IGroupedTableViewItemProvider - Gets the default height of an group item.
81         virtual int GetDefaultGroupItemHeight(void);
82         //From IGroupedTableViewItemProvider - Gets the default height of an item.
83         virtual int GetDefaultItemHeight(void);
84
85 private:
86         // Function is used to initialise group list view.
87         result InitializeGroupedTableView(void);
88         // Function is used to fetch list of "rejected with messages".
89         void FetchRejectMsgs(void);
90         // Function is used to initialise footer and footer items.
91         void InitializeFooter(void);
92
93 private:
94         //list of reject messages fetched from Db.
95         Tizen::Base::Collection::IMapT<int, Tizen::Base::String>* __pMsgsMap;
96         //settings presentation model
97         SettingsPresentationModel* __pSettingsPresentor;
98         //footer action id
99         enum FooterActionId
100         {
101                 IDA_ADD_FOOTER_ITEMID,
102                 IDA_DELETE_FOOTER_ITEMID,
103                 IDA_CANCEL_FOOTER_ITEMID,
104         };
105         //matching criteria
106         enum MatchingCriteriaId
107         {
108                 CRITERIAID_EXACT,
109                 CRITERIAID_STARTSWITH,
110                 CRITERIAID_ENDSWITH,
111                 CRITERIAID_INCLUDE,
112         };
113 };
114
115 #endif  //_PHN_SETTINGS_REJECT_MSGS_FORM_H_