Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnLogsDetailForm.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                PhnLogsDetailForm.h
19  * @brief               This is the header file for the %DlLogsDetailForm class.
20  *
21  * This header file contains the declarations for %DlLogsDetailForm class.
22  */
23 #ifndef _PHN_LOGS_DETAIL_FORM_H_
24 #define _PHN_LOGS_DETAIL_FORM_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28 #include "PhnLogsDetailItemProvider.h"
29
30 class CallLogDetails;
31 class CallLogManager;
32
33 /**
34  * @class DlLogsDetailForm
35  * @brief This class presents a form based UI for call log details scene.
36  *
37  */
38 class DlLogsDetailForm
39         : public Tizen::Ui::Controls::Form
40         , public Tizen::Ui::IActionEventListener
41         , public Tizen::App::IAppControlResponseListener
42         , public Tizen::Ui::Controls::IFormBackEventListener
43         , public Tizen::Ui::Controls::IListViewItemEventListener
44         , public Tizen::Ui::Scenes::ISceneEventListener
45 {
46
47 // Construction
48 public:
49         ///DlLogsDetailForm constructor
50         DlLogsDetailForm(void);
51
52         ///DlLogsDetailForm destructor
53         virtual ~DlLogsDetailForm(void);
54
55         ///Initializes the DlLogsDetailForm form
56         /*
57          * @param: Whether Initialize is success or not
58          */
59         bool Initialize();
60
61         ///This functions gets called during form OnInitializing
62         /*
63          * @param: result
64          */
65         result OnInitializing(void);
66
67         ///This functions gets called during form terminating
68         /*
69          * @param: result
70          */
71         result OnTerminating(void);
72
73         ///IActionEventListener
74         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
75
76         ///IFormBackEventListener method
77         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
78
79         void SetFormMode(bool mode);
80
81         void SetAllListItems(bool checked);
82
83         void UnCheckAllItems(void);
84
85         void GetUpdatedListFromDatabase(char* number);
86
87         bool DeleteSelectedCalllog(void);
88
89         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
90         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
91         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
92         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
93
94         ///ISceneEventListener
95         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
96         ///ISceneEventListener
97         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
98         void UpdateForm(void);
99         /**
100          * Called when the application control is completed.
101          */
102         virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
103
104 private:
105         ///Call button
106         Tizen::Ui::Controls::Button* __pButtonCall;
107
108         ///Message button
109         Tizen::Ui::Controls::Button* __pButtonMessage;
110
111         ///Contact Image
112         Tizen::Ui::Controls::Button* __pButtonContactImage;
113
114         ///Contact name
115         Tizen::Ui::Controls::Label* __pLabelName;
116
117         ///Contact number
118         Tizen::Ui::Controls::Label* __pLabelNumber;
119         Tizen::Ui::Controls::Label* __pLabelNumberUnsaved;
120         Tizen::Ui::Controls::Label* __pLabelBlocked;
121
122         ///Form footer
123         Tizen::Ui::Controls::Footer* __pFormFooter;
124
125         ///Delete footer item
126         Tizen::Ui::Controls::FooterItem __pFooterItemDelete;
127
128         ///Delete footer item
129         Tizen::Ui::Controls::FooterItem __pFooterItemCancel;
130
131         ///Grouped list view
132         Tizen::Ui::Controls::ListView* __pList;
133
134         Tizen::Ui::Controls::CheckButton*       __pSelectAll;
135
136         //Selected pop up label
137         Tizen::Ui::Controls::Label* __pSelectedLabel;
138
139         ///Grouped list view item provider
140         DlLogsDetailItemDataProvider* __pDataProvider;
141
142         ///List view height
143         int __listHeight;
144
145         ///form mode
146         bool __isEditMode;
147
148         bool __isSelectAll;
149         bool __isPresentInContacts;
150
151         int __listItemCount;
152         int __selectedItemCount;
153         //Tizen::Base::Collection::HashMapT<int, CallLogDetails>* __calllogListByNum;
154         Tizen::Base::Collection::ArrayListT<CallLogDetails>* __calllogListByNum;
155         CallLogManager* __pCallMgr;
156         int __calllogCount;
157         Tizen::Base::String __number;
158         bool __isMsgAppControlLaunched;
159 };
160
161 #endif /*_PHN_LOGS_DETAIL_FORM_H_*/