|
1 /* |
|
2 * Copyright (c) 2003 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: This file contains the header file of the RCbsMcnSession class. |
|
15 * |
|
16 * Represents a MCN session to CBS Server. |
|
17 * A client can register to the session to be informed of |
|
18 * arrival of a new MCN message. Registering object must |
|
19 * implement interface MCbsMcnObserver. |
|
20 * |
|
21 * This session class is responsible for opening the MCN session |
|
22 * and querying the current cell information message from CbsServer. |
|
23 * Other MCN requests are processed by the subsession class |
|
24 * RMcnSubSession. |
|
25 * |
|
26 */ |
|
27 |
|
28 |
|
29 |
|
30 #ifndef RCBSMCNSESSION_H |
|
31 #define RCBSMCNSESSION_H |
|
32 |
|
33 // INCLUDES |
|
34 |
|
35 #include <e32std.h> |
|
36 #include <e32base.h> // CArrayPtrFlat |
|
37 #include "RMcnSubSession.h" |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 |
|
41 class MCbsMcnObserver; |
|
42 class CCbsMcnListener; |
|
43 class CMcnTopicArray; |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * This class represents a MCN session to the CBS server. |
|
49 */ |
|
50 class RCbsMcnSession |
|
51 : public RSessionBase |
|
52 { |
|
53 public: // New functions |
|
54 /** |
|
55 * Constructor |
|
56 */ |
|
57 RCbsMcnSession(); |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 */ |
|
62 ~RCbsMcnSession(); |
|
63 |
|
64 /** |
|
65 * Retrieves the current MCN message from CBS server. |
|
66 * An arriving MCN message always overwrites the previous one in CBS |
|
67 * server, no buffering is done. |
|
68 * |
|
69 * @param aMcnMessage Returns the current MCN message. |
|
70 * @return Result code from server. |
|
71 */ |
|
72 TInt GetCellInfo( TDes& aMcnMessage ) const; |
|
73 |
|
74 /** |
|
75 * Retrieves the current info message from CBS server. |
|
76 * |
|
77 * @param aMessage Returns the current info message from the |
|
78 * specified topic. |
|
79 * @param aTopicNumber Number of the topic that the msg belongs to. |
|
80 * @return Result code from server. |
|
81 */ |
|
82 TInt GetInfoMessage( TDes& aMessage, const TInt aTopicNumber ) const; |
|
83 |
|
84 /** |
|
85 * Request next subscribed MCN message to be delivered to this session. |
|
86 * Passed to the subsession object. |
|
87 * |
|
88 * The delivered message will be copied into aBuffer. |
|
89 * |
|
90 * @param aStatus Request status, indicates the result of |
|
91 * the operation. |
|
92 * @param aMcnPckg MCN message package, |
|
93 * includes msg and parameters |
|
94 */ |
|
95 void ReadMcnMessage( TRequestStatus& aStatus, TPckg<TCbsMcnMessage>& aMcnPckg ); |
|
96 |
|
97 /** |
|
98 * Cancels an outstanding request. Passed to the subsession object. |
|
99 * |
|
100 * @return Result code from server. |
|
101 */ |
|
102 TInt ReadMcnMessageCancel(); |
|
103 |
|
104 /** |
|
105 * Subscribes topics given in aArray. Passed to the subsession object. |
|
106 * |
|
107 * For leave reasons, see RMcnSubSession. |
|
108 * |
|
109 * @param aArray Subscribed topics. |
|
110 */ |
|
111 void RegisterL( const CMcnTopicArray& aArray ); |
|
112 |
|
113 /** |
|
114 * Clears all topic subscriptions of this session in CbsServer. |
|
115 * |
|
116 * Leaves if server reports an error. |
|
117 */ |
|
118 void ClearSubscriptionsL(); |
|
119 |
|
120 public: // From RSessionBase |
|
121 /** |
|
122 * Establishes a connection with CbsServer. |
|
123 * |
|
124 * @return Result code indicating the success of |
|
125 * operation. |
|
126 */ |
|
127 TInt Connect(); |
|
128 |
|
129 /** |
|
130 * Closes the connection with CbsServer. |
|
131 */ |
|
132 void Close(); |
|
133 |
|
134 /** |
|
135 * Returns version information of this dll. |
|
136 */ |
|
137 TVersion Version() const; |
|
138 |
|
139 private: // Prohibited operators and methods |
|
140 /// Assignment operator. |
|
141 RCbsMcnSession& operator=( const RCbsMcnSession& ); |
|
142 |
|
143 /// Copy constructor. |
|
144 RCbsMcnSession( const RCbsMcnSession& ); |
|
145 |
|
146 private: // Data |
|
147 /// Represents MCN subsession |
|
148 RMcnSubSession iSubSession; |
|
149 |
|
150 /// ETrue, if a connection has been established. |
|
151 TBool iConnected; |
|
152 |
|
153 }; |
|
154 |
|
155 #endif // __RCBSMCNSESSION_H |
|
156 |
|
157 // End of File |
|
158 |
|
159 |