|
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: Interface for Connection mode handling. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MCNUICONNMODEHANDLER_H |
|
19 #define __MCNUICONNMODEHANDLER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Std.h> |
|
23 #include <impspresenceconnectionuiconstsng.h> |
|
24 |
|
25 |
|
26 //FORWARD DECLARATION |
|
27 class MCnUiConnModeHandler; |
|
28 class MCnUiConnModeObserver; |
|
29 |
|
30 |
|
31 /** |
|
32 * Global factory method to create connection mode handler. |
|
33 * |
|
34 * @since 2.1 |
|
35 * @return New MCnUiConnModeHandler instance. |
|
36 */ |
|
37 GLREF_D MCnUiConnModeHandler* CreateConnModeHandlerL(); |
|
38 |
|
39 |
|
40 |
|
41 /** |
|
42 * Raw mode events that the clients can send trough this interface |
|
43 * |
|
44 * @since 2.1 |
|
45 */ |
|
46 enum TIMPSUserConnectionSelection |
|
47 { |
|
48 EUserLevelLogin, ///<manual login |
|
49 EUserLevelLogout, ///<manual logout |
|
50 EUserLevelAAConnectionStart ///<AA connection started |
|
51 }; |
|
52 |
|
53 |
|
54 |
|
55 // CLASS DECLARATION |
|
56 /** |
|
57 * Interface for Connection mode handling. |
|
58 * |
|
59 * @since 2.1 |
|
60 */ |
|
61 NONSHARABLE_CLASS( MCnUiConnModeHandler ) |
|
62 { |
|
63 public: // New connection mode related functions. |
|
64 |
|
65 |
|
66 /** |
|
67 * Sends connection mode connection related event. |
|
68 * |
|
69 * @since 2.1 |
|
70 * @param aConnMode New connection mode event. |
|
71 * @param aClient The client for which to send. |
|
72 */ |
|
73 virtual void SendUserSelectionL( TIMPSUserConnectionSelection aUserSelection, |
|
74 TIMPSConnectionClient aClient ) = 0; |
|
75 |
|
76 /** |
|
77 * Registers this MCnUiConnModeHandler instance as |
|
78 * significant scheduling client. |
|
79 * |
|
80 * When first client is counted as significant connection client |
|
81 * "EIMPSCMEFirstSSClientStart" is notified to registered |
|
82 * MCnUiConnModeObserver observers. When last client |
|
83 * cancels the counting, the "EIMPSCMELastSSClientStop" |
|
84 * event is posted to MCnUiConnModeObserver observers. |
|
85 * |
|
86 * @since 2.1 |
|
87 * @param aClient The client for which to count. |
|
88 * @return KErrNone if could successfully register. |
|
89 * KErrInUse if counting already in use. |
|
90 */ |
|
91 virtual TInt RegisterAsSignificantSchedulingClientL( TIMPSConnectionClient aClient ) = 0; |
|
92 |
|
93 |
|
94 /** |
|
95 * Cancels any previously issued significant client |
|
96 * registering. Cancellation is also done automaticly |
|
97 * in the MCnUiConnModeHandler destructor. |
|
98 * |
|
99 * @since 2.1 |
|
100 */ |
|
101 virtual void CancelRegisteringAsSSClient() = 0; |
|
102 |
|
103 |
|
104 /** |
|
105 * Gets the connection mode. |
|
106 * |
|
107 * Gets the connection mode for given client. |
|
108 * |
|
109 * @since 2.1 |
|
110 * @param aClient The client for which to get the event |
|
111 * @param aClient |
|
112 * @return Client current connection mode from requested event category. |
|
113 */ |
|
114 virtual TIMPSConnectionModeEvent ConnectionModeL( |
|
115 TIMPSConnectionClient aClient, |
|
116 TIMPSConnectionModeEvent aModeEventCateqory ) = 0; |
|
117 |
|
118 |
|
119 /** |
|
120 * Requests notification from given client connection |
|
121 * mode changes. |
|
122 * |
|
123 * @since 2.1 |
|
124 * @param aObserver The observer to notify. |
|
125 * @param aClientToNotify For which client to report |
|
126 * mode changes. |
|
127 */ |
|
128 virtual void NotifyConnectionModeChangesL( MCnUiConnModeObserver* aObserver, |
|
129 TIMPSConnectionClient aClientToNotify ) = 0; |
|
130 |
|
131 /** |
|
132 * Cancels any previously issued connection mode notify. |
|
133 * |
|
134 * @since 2.1 |
|
135 */ |
|
136 virtual void CancelConnectionModeNotify() = 0; |
|
137 |
|
138 public: //Destructor |
|
139 |
|
140 /** |
|
141 * Virtual inline destructor. |
|
142 * |
|
143 * Concrete object can be destructed |
|
144 * using this interface. |
|
145 * |
|
146 * Cancels any previously issued connection |
|
147 * mode notify. |
|
148 */ |
|
149 virtual ~MCnUiConnModeHandler() {}; |
|
150 }; |
|
151 |
|
152 |
|
153 |
|
154 /** |
|
155 * Connection mode observer. |
|
156 * |
|
157 * @since 2.1 |
|
158 */ |
|
159 NONSHARABLE_CLASS( MCnUiConnModeObserver ) |
|
160 { |
|
161 public: // New observation methods |
|
162 |
|
163 /** |
|
164 * Method called to handle connection mode notifications. |
|
165 * |
|
166 * @since 2.1 |
|
167 * @param aRequestedClient The clientfor which the connection |
|
168 * mode changes was requested. |
|
169 * @param aConnMode The new connection mode for client. |
|
170 */ |
|
171 virtual void HandleConnModeChange( TIMPSConnectionClient aRequestedClient, |
|
172 TIMPSConnectionModeEvent aConnMode ) = 0; |
|
173 |
|
174 protected: //Destructor |
|
175 |
|
176 /** |
|
177 * Virtual inline destructor. |
|
178 * |
|
179 * Concrete observer can't be destroyed |
|
180 * using this interface. |
|
181 */ |
|
182 virtual ~MCnUiConnModeObserver() {}; |
|
183 }; |
|
184 |
|
185 |
|
186 #endif // __MCNUICONNMODEHANDLER_H |
|
187 |
|
188 // End of File |
|
189 |