|
1 /* |
|
2 * Copyright (c) 2005 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: See class definition below. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CSIPBEARERMONITOR_H |
|
19 #define CSIPBEARERMONITOR_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <ecom.h> |
|
23 #include "sipbearermonitorobserver.h" |
|
24 #include "sipnetworkobserver.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MSIPBearerOwner; |
|
28 class MSIPNetworkInfoObserver; |
|
29 |
|
30 /** |
|
31 * @publishedPartner |
|
32 * |
|
33 * Construction parameters for CSIPBearerMonitor are packaged into |
|
34 * TSIPBearerParams |
|
35 */ |
|
36 class TSIPBearerParams |
|
37 { |
|
38 public: |
|
39 inline TSIPBearerParams( MSIPBearerOwner& aOwner, |
|
40 TInt aIapId, |
|
41 TInt aError, |
|
42 MSIPNetworkInfoObserver& aNetworkInfoObserver ); |
|
43 |
|
44 private: |
|
45 TSIPBearerParams(); |
|
46 |
|
47 public: |
|
48 MSIPBearerOwner& iOwner; |
|
49 TInt iIapId; |
|
50 TInt iError; |
|
51 MSIPNetworkInfoObserver& iNetworkInfoObserver; |
|
52 }; |
|
53 |
|
54 // CLASS DECLARATION |
|
55 /** |
|
56 * @publishedPartner |
|
57 * |
|
58 * Interface for ECom Bearer Monitor plugins. Implementations must implement the |
|
59 * abstract functions defined in MSIPBearerMonitorObserver. |
|
60 */ |
|
61 class CSIPBearerMonitor : |
|
62 public CObject, |
|
63 public MSIPBearerMonitorObserver |
|
64 { |
|
65 public: // Constructors and destructor |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 * Informs ECom framework that this specific instance |
|
70 * of the interface has been destroyed. |
|
71 */ |
|
72 inline ~CSIPBearerMonitor(); |
|
73 |
|
74 public: // New methods |
|
75 |
|
76 /** |
|
77 * @return Current bearer monitor state |
|
78 */ |
|
79 inline MSIPNetworkObserver::TNetworkState State() const; |
|
80 |
|
81 /** |
|
82 * Inherited monitor may override this to get refresh requests from observer |
|
83 */ |
|
84 virtual inline void RefreshL( TInt aError ); |
|
85 |
|
86 /** |
|
87 * Inherited monitor may override this to inform whether monitoring should be |
|
88 * continued after aError occured |
|
89 * |
|
90 * @return Default implementation returns always EFalse |
|
91 */ |
|
92 virtual inline TBool ContinueMonitoring( TInt aError ); |
|
93 |
|
94 protected: // Constructors |
|
95 |
|
96 /** |
|
97 * Constructor. |
|
98 * |
|
99 * @param aParams ECom instantiation parameters, basically |
|
100 * this is a MSIPBearerOwner*. |
|
101 */ |
|
102 inline CSIPBearerMonitor( TAny* aParams ); |
|
103 |
|
104 private: // Constructors |
|
105 |
|
106 /** |
|
107 * Default constructor. Not implemented. |
|
108 */ |
|
109 CSIPBearerMonitor(); |
|
110 |
|
111 public: // Data |
|
112 |
|
113 // Unique key for implementations of this interface. |
|
114 TUid iInstanceKey; |
|
115 |
|
116 protected: // Data |
|
117 |
|
118 // Reference to our parent |
|
119 MSIPBearerOwner& iParent; |
|
120 |
|
121 // Network state. |
|
122 MSIPNetworkObserver::TNetworkState iState; |
|
123 |
|
124 // IapId which created this monitor, monitor plugins which are shared |
|
125 // by multiple accesspoints (e.g. gprs monitor) don't really need this |
|
126 // information |
|
127 TInt iIapId; |
|
128 |
|
129 // Error which caused plugins loading, may be also KErrNone |
|
130 TInt iError; |
|
131 |
|
132 // Observer listening for access network information changes |
|
133 MSIPNetworkInfoObserver& iNetworkInfoObserver; |
|
134 }; |
|
135 |
|
136 #include "sipbearermonitor.inl" |
|
137 |
|
138 #endif // CSIPBEARERMONITOR_H |