|
1 /* |
|
2 * Copyright (c) 2002-2004 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 * This class implements notifications from bearers which is needed when |
|
16 * transferring data to/from wap gw. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CMMSBEARERSTATUS_H |
|
23 #define CMMSBEARERSTATUS_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 #include <nifman.h> |
|
28 |
|
29 #include "mmssession.h" |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // DATA TYPES |
|
36 |
|
37 // FUNCTION PROTOTYPES |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class MMmsTransportObserver; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 /** |
|
44 * Class for detecting GPRS state and if transfer was cancelled |
|
45 */ |
|
46 NONSHARABLE_CLASS( CMmsBearerStatus ): public CActive |
|
47 { |
|
48 enum TMmsBearerType |
|
49 { |
|
50 EMmsBearerGprs = 0, |
|
51 EMmsBearerWcdma |
|
52 }; |
|
53 |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * @param aRConnection opened RConnection |
|
59 */ |
|
60 static CMmsBearerStatus* NewL( RConnection& aRConnection ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CMmsBearerStatus(); |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * Used to query if the bearer is set to GPRS |
|
71 * @return True if GPRS, false otherwise |
|
72 */ |
|
73 TBool IsGprs() const; |
|
74 |
|
75 /** |
|
76 * Used to query if the bearer (GPRS only) is in suspended state |
|
77 * @return True if suspended, false otherwise |
|
78 */ |
|
79 TBool IsSuspended(); |
|
80 |
|
81 /** |
|
82 * A request function to notify the requester if transfer is cancelled |
|
83 * NOTE! NotifySuspendResume and NotifyTransferCancel can not be called |
|
84 * from same instance at the same time ! |
|
85 * @param aRequester Pointer to the object making the request |
|
86 */ |
|
87 void SubscribeNotification( MMmsTransportObserver* aRequester); |
|
88 |
|
89 /** |
|
90 * Function to set the bearer in use |
|
91 * @param aBearerType Type of bearer |
|
92 */ |
|
93 void SetBearer( TMmsBearerType aBearerType ); |
|
94 |
|
95 public: // Functions from base classes |
|
96 |
|
97 protected: // New functions |
|
98 |
|
99 protected: // Functions from base classes |
|
100 |
|
101 /** |
|
102 * Active object cancellation |
|
103 */ |
|
104 void DoCancel(); |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * C++ default constructor. |
|
110 */ |
|
111 CMmsBearerStatus(); |
|
112 |
|
113 /** |
|
114 * By default Symbian OS constructor is private. |
|
115 * @param aRConnection opened RConnection |
|
116 */ |
|
117 void ConstructL( RConnection& aRConnection ); |
|
118 |
|
119 /** |
|
120 * Completion |
|
121 */ |
|
122 void RunL(); |
|
123 |
|
124 // By default, prohibit copy constructor |
|
125 CMmsBearerStatus( const CMmsBearerStatus& ); |
|
126 |
|
127 // Prohibit assignment operator |
|
128 CMmsBearerStatus& operator= ( const CMmsBearerStatus& ); |
|
129 |
|
130 public: // Data |
|
131 |
|
132 protected: // Data |
|
133 |
|
134 private: // Data |
|
135 |
|
136 TMmsBearerType iBearerType; |
|
137 MMmsTransportObserver* iRequester; |
|
138 |
|
139 RConnection* iRConnection; |
|
140 TNifProgressBuf iProgressBuffer; |
|
141 |
|
142 TBool iConnected; |
|
143 TBool iSuspended; |
|
144 |
|
145 public: // Friend classes |
|
146 protected: // Friend classes |
|
147 private: // Friend classes |
|
148 |
|
149 }; |
|
150 |
|
151 #include "mmsbearerstatus.inl" |
|
152 |
|
153 #endif // CMMSBEARERSTATUS_H |
|
154 |
|
155 // End of File |