|
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 CBSUITOPICVIEW_H |
|
19 #define CBSUITOPICVIEW_H |
|
20 |
|
21 #include <hbview.h> |
|
22 #include <hbaction.h> |
|
23 #include <CbsCommonTypes.h> |
|
24 #include "mcbsuitopicmonitorobserver.h" |
|
25 |
|
26 class HbListWidget; |
|
27 class MCbs; |
|
28 class CbsUiViewManager; |
|
29 |
|
30 class CbsUiTopicView : public HbView, |
|
31 public MCbsUiTopicMonitorObserver |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Constructor |
|
39 */ |
|
40 CbsUiTopicView(); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~CbsUiTopicView(); |
|
46 |
|
47 /** |
|
48 * Constructor |
|
49 * @param server The handler of connecting to Cbs server. |
|
50 * @param viewManager CbsUiViewManager. |
|
51 */ |
|
52 void init(MCbs &server, CbsUiViewManager &viewManager); |
|
53 |
|
54 public: // From MCbsUiTopicMonitorObserver |
|
55 /** |
|
56 * Topic list or topic messages are changed. |
|
57 * |
|
58 * @param aEvent reason for event |
|
59 * @param aTopicNumber Topic number, which caused the event |
|
60 */ |
|
61 virtual void TopicListChangedL(TCbsTopicListEvent aEvent, |
|
62 TCbsTopicNumber aTopicNumber); |
|
63 |
|
64 /** |
|
65 * Reload Messages |
|
66 * |
|
67 * @param topicNumber topic number |
|
68 */ |
|
69 void reloadMessages(TCbsTopicNumber topicNumber); |
|
70 |
|
71 private: |
|
72 /** |
|
73 * It defines the type for message handle lists. |
|
74 */ |
|
75 //typedef CArrayFixFlat< TCbsMessageHandle > TCbsUiMessageHandleList; |
|
76 |
|
77 void createComponents(); |
|
78 void addMessage(const TCbsMessage &message, const QString &msgName); |
|
79 |
|
80 private: // Data |
|
81 // Not own |
|
82 MCbs *mServer; |
|
83 |
|
84 // Not own |
|
85 CbsUiViewManager *mViewManager; |
|
86 |
|
87 // Own |
|
88 HbListWidget *mTopic; |
|
89 |
|
90 //TCbsUiMessageHandleList* mMsgHandles; |
|
91 TCbsTopicNumber mCurrentTopicNumber; |
|
92 |
|
93 // Previous Message(not own) |
|
94 HbAction *mPrevious; |
|
95 |
|
96 //Previous Message(not own) |
|
97 HbAction *mBack; |
|
98 }; |
|
99 |
|
100 #endif // CBSUITOPICVIEW_H |