|
1 /* |
|
2 * Copyright (c) 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: Connection Settings notifier. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CIMPSCONNUICONNECTIONSETTINGSNOTIFIER_H |
|
19 #define __CIMPSCONNUICONNECTIONSETTINGSNOTIFIER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <impspresenceconnectionuiconstsng.h> |
|
24 |
|
25 |
|
26 //FORWARD DECLARATIONS |
|
27 class MIMPSConnUiConnectionSettingsObserver; |
|
28 class CIMPSConnUiConnectionSettingsNotifierImp; |
|
29 |
|
30 |
|
31 /** |
|
32 * Connection mode notifier. |
|
33 * |
|
34 * Notifies registered observers from client |
|
35 * specific connection settings changes. |
|
36 * |
|
37 * For more information about connection mode |
|
38 * changes, see TIMPSConnectionSettingsEvent settings |
|
39 * event enumeration. |
|
40 * |
|
41 * @lib IMPSConnectionUi.lib |
|
42 * @since 2.1 |
|
43 */ |
|
44 class CIMPSConnUiConnectionSettingsNotifier : public CBase |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * |
|
51 * @since 2.1 |
|
52 * @param aClient The client for which to deliver |
|
53 * the connection mode events. |
|
54 */ |
|
55 IMPORT_C static CIMPSConnUiConnectionSettingsNotifier* NewL( |
|
56 TIMPSConnectionClient aClient ); |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 * Leaves CIMPSConnUiConnectionSettingsNotifier object on the |
|
61 * CleanupStack. |
|
62 * |
|
63 * @since 2.1 |
|
64 * @param aClient The client for which to deliver |
|
65 * the connection mode events. |
|
66 */ |
|
67 IMPORT_C static CIMPSConnUiConnectionSettingsNotifier* NewLC( |
|
68 TIMPSConnectionClient aClient ); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 IMPORT_C virtual ~CIMPSConnUiConnectionSettingsNotifier(); |
|
74 |
|
75 |
|
76 public: // New functions |
|
77 |
|
78 /** |
|
79 * Start listening connection settings events. |
|
80 * |
|
81 * Starts to deliver notifications from connection |
|
82 * setting changes (e.g. user settings selections that inpact to |
|
83 * connection state). |
|
84 * |
|
85 * Starting fails with leave if: |
|
86 * - already started (KErrInUse) |
|
87 * - no observers registered (KErrNotReady) |
|
88 * - if running out of resourcies (KErrNoMemory) |
|
89 * - or with other standard Symbian OS error codes |
|
90 * coming from underlying implementation. |
|
91 * @since 2.1 |
|
92 * |
|
93 * @see MIMPSConnUiConnectionModeObserver |
|
94 * @see TIMPSConnectionSettingsEvent |
|
95 */ |
|
96 IMPORT_C virtual void StartL(); |
|
97 |
|
98 |
|
99 /** |
|
100 * Stop listening connection mode events. |
|
101 * |
|
102 * Stops listening connection mode events. |
|
103 * KErrCancel error is notified |
|
104 * synchronously to reqistered observers. |
|
105 * |
|
106 * @since 2.1 |
|
107 */ |
|
108 IMPORT_C virtual void Stop(); |
|
109 |
|
110 |
|
111 /** |
|
112 * Add observer. |
|
113 * |
|
114 * Adds observer to receive notifications about |
|
115 * connection mode events. |
|
116 * |
|
117 * @since 2.1 |
|
118 */ |
|
119 IMPORT_C virtual void AddObserverL( MIMPSConnUiConnectionSettingsObserver* aObserver ); |
|
120 |
|
121 |
|
122 /** |
|
123 * Remove observer. |
|
124 * |
|
125 * Removes observer from getting |
|
126 * connection mode events. |
|
127 * |
|
128 * @since 2.1 |
|
129 * @return KErrNotFound if the observer wasn't previously added. |
|
130 * Otherwise KErrNone. |
|
131 */ |
|
132 IMPORT_C virtual TInt RemoveObserver( MIMPSConnUiConnectionSettingsObserver* aObserver ); |
|
133 |
|
134 |
|
135 |
|
136 /** |
|
137 * Gets current/last connection settting event for in the |
|
138 * construction registered client type. |
|
139 * |
|
140 * Events are devided to different event groups |
|
141 * and last event for each group is maintained by the |
|
142 * notification system. It is possible to query |
|
143 * each group last event by giving the event identifying |
|
144 * the group as method parameter. |
|
145 * |
|
146 * @since 2.1 |
|
147 * @param aSettingsEventCateqory Event identifying the category |
|
148 * for which to get the last event. |
|
149 * @return Current/last connection settings event for the requested |
|
150 * event category. If there isn't any last/current event recognized |
|
151 * for the asked event group, EIMPSCSEUnknown is returned. |
|
152 */ |
|
153 IMPORT_C virtual TIMPSConnectionSettingsEvent ConnectionSettingByCategoryL( |
|
154 TIMPSConnectionSettingsEvent aSettingsEventCateqory ); |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 private: //Constructors. |
|
160 |
|
161 /** |
|
162 * C++ default constructor. |
|
163 */ |
|
164 CIMPSConnUiConnectionSettingsNotifier(); |
|
165 |
|
166 |
|
167 /** |
|
168 * Symbian OS constructor. |
|
169 */ |
|
170 void ConstructL( TIMPSConnectionClient aClient ); |
|
171 |
|
172 |
|
173 |
|
174 private: //Data |
|
175 ///<Implementation, owned |
|
176 CIMPSConnUiConnectionSettingsNotifierImp* iImp; |
|
177 |
|
178 ///<Reserved, owned |
|
179 TAny* iReserved1; |
|
180 }; |
|
181 |
|
182 #endif // __CIMPSCONNUICONNECTIONSETTINGSNOTIFIER_H |
|
183 |
|
184 // End of File |