|
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 RMcnSubSession class. |
|
15 * |
|
16 * Client-side MCN Subsession. Responsible for specifying topics |
|
17 * to route and posting a routing request at CbsServer. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef RMCNSUBSESSION_H |
|
23 #define RMCNSUBSESSION_H |
|
24 |
|
25 // INCLUDES |
|
26 #include "CbsMcnCommon.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CMcnTopicArray; |
|
30 class RCbsMcnSession; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * This class represents a MCN session with CBS server. |
|
36 */ |
|
37 class RMcnSubSession |
|
38 : public RSubSessionBase |
|
39 { |
|
40 public: // New functions |
|
41 /** |
|
42 * Constructor. |
|
43 */ |
|
44 RMcnSubSession(); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~RMcnSubSession(); |
|
50 |
|
51 /** |
|
52 * Creates a MCN subsession to CbsServer. |
|
53 * |
|
54 * @param aMcnSession Open MCN session |
|
55 * @return Result code |
|
56 */ |
|
57 TInt Open( RCbsMcnSession& aMcnSession ); |
|
58 |
|
59 /** |
|
60 * Closes the subsession. |
|
61 * |
|
62 * @return Result code |
|
63 */ |
|
64 TInt Close(); |
|
65 |
|
66 /** |
|
67 * Request next subscribed MCN message to be delivered to this session. |
|
68 * |
|
69 * The delivered message will be copied into aBuffer. |
|
70 * |
|
71 * @param aStatus Request status, indicates the result of |
|
72 * the operation. |
|
73 * @param aMcnPckg MCN message package, |
|
74 * includes msg and parameters |
|
75 */ |
|
76 void ReadMcnMessage( TRequestStatus& aStatus, TPckg<TCbsMcnMessage>& aMcnPckg ); |
|
77 |
|
78 /** |
|
79 * Cancels an outstanding request. |
|
80 * |
|
81 * @return Result code from server. |
|
82 */ |
|
83 TInt ReadMcnMessageCancel(); |
|
84 |
|
85 /** |
|
86 * Subscribes topics given in aArray. |
|
87 * |
|
88 * Leave reasons: |
|
89 * KErrNoMemory Client- or server-side out-of-memory. |
|
90 * Others Leave occured while accessing EPOC Telephony Sever. |
|
91 * In this case, the leave reason from EPOC Telephony Sever |
|
92 * is returned here. |
|
93 * |
|
94 * @param aArray Subscribed topics. |
|
95 */ |
|
96 void RegisterL( const CMcnTopicArray& aArray ); |
|
97 |
|
98 /** |
|
99 * Clears topic subscriptions of this session in CbsServer |
|
100 * |
|
101 * Leaves if server reports any error. |
|
102 */ |
|
103 void ClearSubscriptionsL(); |
|
104 |
|
105 private: // Prohibited operators and methods |
|
106 /// Assignment operator. |
|
107 RMcnSubSession& operator=( const RMcnSubSession& ); |
|
108 |
|
109 /// Copy constructor. |
|
110 RMcnSubSession( const RMcnSubSession& ); |
|
111 |
|
112 private: // Data |
|
113 /// ETrue, if a connection has been established. |
|
114 TBool iConnected; |
|
115 }; |
|
116 |
|
117 #endif // RMCNSubSession_H |
|
118 |
|
119 // End of File |
|
120 |
|
121 |