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 |
|
19 #ifndef CCBSUITOPICLISTMONITOR_H |
|
20 #define CCBSUITOPICLISTMONITOR_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <CbsCommon.h> |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MCbs; |
|
29 class MCbsUiTopicMonitorObserver; |
|
30 |
|
31 // CLASS DEFINITIONS |
|
32 |
|
33 |
|
34 /** |
|
35 * Monitors topic related events. |
|
36 */ |
|
37 class CCbsUiTopicListMonitor : public CActive |
|
38 { |
|
39 public: // New functions |
|
40 |
|
41 /** |
|
42 * Create an instance of the class. |
|
43 * |
|
44 * @param aServer cbs server |
|
45 */ |
|
46 static CCbsUiTopicListMonitor* NewL( MCbs& aServer ); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 ~CCbsUiTopicListMonitor(); |
|
52 |
|
53 /** |
|
54 * Issues the request. |
|
55 */ |
|
56 void IssueRequest(); |
|
57 |
|
58 public: // From CActive |
|
59 |
|
60 /** |
|
61 * It is called when server notifies. |
|
62 */ |
|
63 void RunL(); |
|
64 |
|
65 /** |
|
66 * Cancels the request. |
|
67 */ |
|
68 void DoCancel(); |
|
69 |
|
70 public: // New functions |
|
71 |
|
72 /** |
|
73 * Adds a observer to this monitor. |
|
74 * |
|
75 * @param aObserver Observer to be added. |
|
76 */ |
|
77 void AddObserverL( MCbsUiTopicMonitorObserver* aObserver ); |
|
78 |
|
79 private: |
|
80 |
|
81 typedef CArrayFixFlat<MCbsUiTopicMonitorObserver*> |
|
82 TCbsUiMonitorObservers; |
|
83 |
|
84 /** |
|
85 * Constructor. |
|
86 * |
|
87 * @param aServer cbs server |
|
88 */ |
|
89 CCbsUiTopicListMonitor( MCbs& aServer ); |
|
90 |
|
91 /** |
|
92 * Finalizes the construction. |
|
93 */ |
|
94 void ConstructL(); |
|
95 |
|
96 private: // Data |
|
97 |
|
98 // ETrue if request is active. |
|
99 TBool iContinue; |
|
100 |
|
101 // To issue the request. |
|
102 MCbs& iServer; |
|
103 |
|
104 // Observers who are interested in topic changes. |
|
105 // Monitor doesn't own the observers. |
|
106 TCbsUiMonitorObservers* iObservers; |
|
107 |
|
108 // Which topic handle the event is conserning. |
|
109 TCbsTopicNumber iTopicNumber; |
|
110 |
|
111 // What kind of event has been. |
|
112 TCbsTopicListEvent iEvent; |
|
113 }; |
|
114 |
|
115 #endif // CCBSUITOPICLISTMONITOR_H |
|
116 |
|
117 // End of File |
|