1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CBSUITOPICLISTVIEW_H |
|
19 #define CBSUITOPICLISTVIEW_H |
|
20 |
|
21 #include <hbview.h> |
|
22 #include <CbsCommon.h> |
|
23 #include <CbsCommonTypes.h> |
|
24 |
|
25 #include "mcbsuitopicmonitorobserver.h" |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KNumberOfStandardTopics = 17; //TODO what's this |
|
29 |
|
30 class HbListWidget; |
|
31 class HbAction; |
|
32 class CCbsUiTopicListMonitor; |
|
33 class CbsUiViewManager; |
|
34 class MCbs; |
|
35 class HbInputDialog; |
|
36 class HbListWidgetItem; |
|
37 class QPointF; |
|
38 |
|
39 typedef CArrayFixFlat< TCbsTopicNumber > TCbsUiTopicNumberList; |
|
40 |
|
41 class CbsUiTopicListView: public HbView, |
|
42 public MCbsUiTopicMonitorObserver |
|
43 { |
|
44 Q_OBJECT |
|
45 public: |
|
46 /** |
|
47 * Constructor |
|
48 */ |
|
49 CbsUiTopicListView(); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 ~CbsUiTopicListView(); |
|
55 |
|
56 /** |
|
57 * Init. |
|
58 * |
|
59 * @param server MCbs reference from CbsUiMainWindow |
|
60 * @param viewManager CbsUiViewManager reference from CbsUiMainWindow |
|
61 */ |
|
62 void init(MCbs &server, CbsUiViewManager &viewManager); |
|
63 |
|
64 public: // from MCbsUiTopicMonitorObserver |
|
65 /** |
|
66 * Topic list or topic messages are changed. |
|
67 * |
|
68 * @param aEvent reason for event |
|
69 * @param aTopicNumber Topic number, which caused the event |
|
70 */ |
|
71 virtual void TopicListChangedL(TCbsTopicListEvent aEvent, |
|
72 TCbsTopicNumber aTopicNumber); |
|
73 |
|
74 private slots: |
|
75 |
|
76 /** |
|
77 * Connect with left toolbar |
|
78 */ |
|
79 void toggleReception(); |
|
80 |
|
81 /** |
|
82 * Connect with popup menu hotmark action |
|
83 */ |
|
84 void toggleHotmark(); |
|
85 |
|
86 /** |
|
87 * Connect with popup menu Subscription action |
|
88 */ |
|
89 void toggleSubscription(); |
|
90 |
|
91 /** |
|
92 * Connect with add topic toolbar |
|
93 */ |
|
94 void addTopic(); |
|
95 |
|
96 /** |
|
97 * Connect with popup menu delete action |
|
98 */ |
|
99 void deleteTopic(); |
|
100 |
|
101 /** |
|
102 * Connect with popup menu edit action |
|
103 */ |
|
104 void editTopic(); |
|
105 |
|
106 /** |
|
107 * Connect with short press |
|
108 * |
|
109 * @param item selection item |
|
110 */ |
|
111 void showTopicSelectionView(HbListWidgetItem *item); |
|
112 |
|
113 /** |
|
114 * showTopicView |
|
115 * |
|
116 * @param item selection item |
|
117 */ |
|
118 void showTopicView(HbListWidgetItem *item); |
|
119 |
|
120 /** |
|
121 * showTopicIndexMenu(000) |
|
122 * |
|
123 * @param item selection item |
|
124 * @param coords availalbe menu show position |
|
125 */ |
|
126 void showTopicIndexMenu(HbListWidgetItem *item, QPointF coords); |
|
127 |
|
128 /** |
|
129 * ShowTopicsMenu(1-999) |
|
130 * |
|
131 * @param item selection item |
|
132 * @param coords availalbe menu show position |
|
133 */ |
|
134 void showTopicsMenu(HbListWidgetItem *item, QPointF coords); |
|
135 |
|
136 /** |
|
137 * Connect with add / edit popup dialog to en/dis able OK button |
|
138 */ |
|
139 void updateQueryAction(QString text); |
|
140 |
|
141 private: |
|
142 |
|
143 /** |
|
144 * createComponents |
|
145 */ |
|
146 void createComponents(); |
|
147 |
|
148 /** |
|
149 * Reload topic index data and update topic index widget. (000) |
|
150 */ |
|
151 void reloadTopicIndex(); |
|
152 |
|
153 /** |
|
154 * Reload topics data and update topics widget (1-999) |
|
155 */ |
|
156 void reloadTopics(); |
|
157 |
|
158 /** |
|
159 * Update given item |
|
160 * |
|
161 * @param item selection item |
|
162 * @param topic selection topic |
|
163 */ |
|
164 void updateItem(HbListWidgetItem &item, const TCbsTopic &topic); |
|
165 |
|
166 /** |
|
167 * UpdateItemIcon |
|
168 * |
|
169 * @param item selection item |
|
170 * @param topic selection topic |
|
171 */ |
|
172 void updateItemIcon(HbListWidgetItem &item, const TCbsTopic &topic); |
|
173 |
|
174 /** |
|
175 * updateItemText |
|
176 * |
|
177 * @param item selection item |
|
178 * @param topic selection topic |
|
179 */ |
|
180 void updateItemText(HbListWidgetItem &item, const TCbsTopic &topic); |
|
181 |
|
182 /** |
|
183 * Update current item by mTopicRow |
|
184 * |
|
185 * @param topic selection topic |
|
186 */ |
|
187 void updateCurrentItem(const TCbsTopic &topic); |
|
188 |
|
189 /** |
|
190 * UpdateCurrentItemIcon, (un)subcribe and (un)hotmark |
|
191 * |
|
192 * @param topic selection topic |
|
193 */ |
|
194 void updateCurrentItemIcon(const TCbsTopic &topic); |
|
195 |
|
196 /** |
|
197 * UpdateCurrentItemText |
|
198 * |
|
199 * @param topic selection topic |
|
200 */ |
|
201 void updateCurrentItemText(const TCbsTopic &topic); |
|
202 |
|
203 /** |
|
204 * ShowPopupMenu |
|
205 * |
|
206 * @param topic selection topic |
|
207 * @param coords availalbe menu show position |
|
208 */ |
|
209 void showPopupMenu(const TCbsTopic &topic, QPointF coords); |
|
210 |
|
211 /** |
|
212 * Show current topic query dialog |
|
213 * (edit/add current topic number or name) |
|
214 * |
|
215 * @param topic selection topic |
|
216 * @param isAddTopic check if add or edit mode |
|
217 */ |
|
218 bool showTopicQuery(TCbsTopic &topic, const bool isAddTopic); |
|
219 |
|
220 /** |
|
221 * Show topic number in use popup when edit topic |
|
222 */ |
|
223 void showNumberInUsePopup(); |
|
224 |
|
225 private: // Data |
|
226 /** |
|
227 * Not own, from CbsUiMainWindow |
|
228 */ |
|
229 MCbs *mServer; |
|
230 /** |
|
231 * Not own, from CbsUiMainWindow |
|
232 */ |
|
233 CbsUiViewManager *mViewManager; |
|
234 |
|
235 int mTopicRow; |
|
236 |
|
237 /** |
|
238 * Not own, load from docml |
|
239 */ |
|
240 HbListWidget *mTopicIndexWidget; |
|
241 |
|
242 /** |
|
243 * Not own, load from docml |
|
244 */ |
|
245 HbListWidget *mTopicsWidget; |
|
246 |
|
247 /** |
|
248 * Not own, load from docml |
|
249 */ |
|
250 HbAction *mReceptionButton; |
|
251 |
|
252 /** |
|
253 * Not own, load from docml |
|
254 */ |
|
255 HbAction *mOpenAction; |
|
256 |
|
257 /** |
|
258 * Not own, load from docml |
|
259 */ |
|
260 HbAction *mSubscibeAction; |
|
261 |
|
262 /** |
|
263 * Not own, load from docml |
|
264 */ |
|
265 HbAction *mUnSubscibeAction; |
|
266 |
|
267 /** |
|
268 * Not own, load from docml |
|
269 */ |
|
270 HbAction *mHotmarkAction; |
|
271 |
|
272 /** |
|
273 * Not own, load from docml |
|
274 */ |
|
275 HbAction *mUnHotmarkAction; |
|
276 |
|
277 /** |
|
278 * Not own, load from docml |
|
279 */ |
|
280 HbAction *mEditAction; |
|
281 |
|
282 /** |
|
283 * Not own, load from docml |
|
284 */ |
|
285 HbAction *mDeleteAction; |
|
286 |
|
287 //Monitors changes in topic list (Symbian). |
|
288 CCbsUiTopicListMonitor *mMonitor; |
|
289 |
|
290 /** |
|
291 * Own, for add / edit topic |
|
292 */ |
|
293 HbInputDialog *mTopicQuery; |
|
294 |
|
295 /** |
|
296 * Own |
|
297 */ |
|
298 TCbsUiTopicNumberList *mTopicNumberList; |
|
299 }; |
|
300 |
|
301 #endif // CBSUITOPICLISTVIEW_H |
|