|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Class definition 3G QoS enabling |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMCCQOSHANDLER_H |
|
22 #define CMCCQOSHANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <es_sock.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CMccQosSocketHandler; |
|
30 class CMccQosEventMonitor; |
|
31 class MMccQosEventObserver; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * |
|
37 * The main purpose of this class is to enable 3G conversational/streaming QoS |
|
38 * and secondary PDP context using RSubConnection class. |
|
39 * |
|
40 * @lib mmccsubcontroller.dll |
|
41 * @since Series 60 3.2 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CMccQosHandler ) : public CBase |
|
44 { |
|
45 #ifdef TEST_EUNIT |
|
46 friend class UT_CMccQosHandler; |
|
47 #endif |
|
48 |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * NewL |
|
53 * |
|
54 * @since S60 3.2 |
|
55 * @param Observer for RSubConnection events |
|
56 * @return Instance of class interface |
|
57 */ |
|
58 static CMccQosHandler* NewL( MMccQosEventObserver& aObserver ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 * |
|
63 * @return void |
|
64 */ |
|
65 virtual ~CMccQosHandler(); |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * Method for enabling QoS. QoS handler will try to obtain conversational |
|
71 * or streaming traffic classes. |
|
72 * |
|
73 * @since S60 3.2 |
|
74 * @pre SetSubConnectionParams() |
|
75 * @leave KErrInUse If QoS has been already enabled |
|
76 * @leave KErrNotReady If SetSubConnectionParams has not been called. |
|
77 * @return void |
|
78 */ |
|
79 void EnableQosL(); |
|
80 |
|
81 /** |
|
82 * Method for disabling Qos |
|
83 * |
|
84 * @since S60 3.2 |
|
85 * @return void |
|
86 */ |
|
87 void DisableQoS(); |
|
88 |
|
89 /** |
|
90 * Method for setting params for subconnection. |
|
91 * |
|
92 * @since S60 3.2 |
|
93 * @param aConnection RConnection handle |
|
94 * @param aSocketServ RSocketServ handle |
|
95 * @param aSocket RSocket handle |
|
96 * @return void |
|
97 */ |
|
98 void SetSubConnectionParams( RConnection& aConnection, |
|
99 RSocketServ& aSocketServ, RSocket& aSocket ); |
|
100 |
|
101 /** |
|
102 * Method for querying QoS status (Enabled/Disabled) |
|
103 * |
|
104 * @since S60 3.2 |
|
105 * @return TBool ETrue if QoS is enabled. |
|
106 */ |
|
107 TBool QoSEnabled() const; |
|
108 |
|
109 private: |
|
110 |
|
111 /** |
|
112 * C++ default constructor. |
|
113 * |
|
114 * @return void |
|
115 */ |
|
116 CMccQosHandler( MMccQosEventObserver& aObserver ); |
|
117 |
|
118 /** |
|
119 * Handles sockethandler deletion. Needed because AddSocket may return |
|
120 * after the subconnection has gone down and QoS handler has been deleted. |
|
121 * |
|
122 * @since S60 v3.2 |
|
123 * @return void |
|
124 */ |
|
125 void HandleSocketHandlerDeletion(); |
|
126 |
|
127 private: // data |
|
128 |
|
129 /** |
|
130 * Pointer to RConnection handle. |
|
131 * Not Own. |
|
132 */ |
|
133 RConnection* iConnection; |
|
134 |
|
135 /** |
|
136 * Pointer to RSocketServ handle. |
|
137 * Not Own. |
|
138 */ |
|
139 RSocketServ* iSocketServ; |
|
140 |
|
141 /** |
|
142 * Pointer to socket object. |
|
143 * Not Own. |
|
144 */ |
|
145 RSocket* iSocket; |
|
146 |
|
147 /** |
|
148 * RSubConnection handle. |
|
149 */ |
|
150 RSubConnection iSubConnection; |
|
151 |
|
152 /** |
|
153 * Pointer to object that monitors RSubConnection related events. |
|
154 * Own. |
|
155 */ |
|
156 CMccQosSocketHandler* iQosSocketHandler; |
|
157 |
|
158 /** |
|
159 * Observer reference |
|
160 */ |
|
161 MMccQosEventObserver& iObserver; |
|
162 |
|
163 /** |
|
164 * Instance of event monitor |
|
165 * Own. |
|
166 */ |
|
167 CMccQosEventMonitor* iEventMonitor; |
|
168 |
|
169 }; |
|
170 |
|
171 #endif // CMCCQOSHANDLER_H |
|
172 |
|
173 // End of File |