|
1 /* |
|
2 * Copyright (c) 2002-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: Avkon cap server discreet popup handler |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_AKNCAPSERVERDISCREETPOPUPHANDLER_H |
|
19 #define C_AKNCAPSERVERDISCREETPOPUPHANDLER_H |
|
20 |
|
21 #include <coecobs.h> |
|
22 #include <coemain.h> |
|
23 #include <eikcmobs.h> |
|
24 |
|
25 class CAknDiscreetPopupControl; |
|
26 |
|
27 /** |
|
28 * Data storage class for cap server discreet popup data. |
|
29 */ |
|
30 NONSHARABLE_CLASS( TAknCapServerDiscreetPopupData ) |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Cap server command id. |
|
37 */ |
|
38 TInt iCommandId; |
|
39 |
|
40 /** |
|
41 * App uid to be launched. |
|
42 */ |
|
43 TUid iAppUid; |
|
44 |
|
45 /** |
|
46 * View uid to be activated. |
|
47 */ |
|
48 TUid iViewUid; |
|
49 |
|
50 /** |
|
51 * Discreet popup control. |
|
52 */ |
|
53 CAknDiscreetPopupControl* iPopupControl; |
|
54 |
|
55 /** |
|
56 * Server message. |
|
57 */ |
|
58 RMessagePtr2 iMessage; |
|
59 |
|
60 }; |
|
61 |
|
62 |
|
63 /** |
|
64 * Avkon cap server discreet popup handler takes care of showing |
|
65 * global discreet popups. |
|
66 */ |
|
67 NONSHARABLE_CLASS( CAknCapServerDiscreetPopupHandler ) |
|
68 : |
|
69 public CCoeStatic, |
|
70 public MEikCommandObserver, |
|
71 public MCoeControlObserver |
|
72 { |
|
73 |
|
74 public: |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 ~CAknCapServerDiscreetPopupHandler(); |
|
80 |
|
81 /** |
|
82 * Handles discreet popup message received by cap server. |
|
83 * |
|
84 * @param aMessage Server message. |
|
85 */ |
|
86 static void HandleDiscreetPopupMessageL( const RMessage2& aMessage ); |
|
87 |
|
88 /** |
|
89 * Creates AknCapServerDiscreetPopupHandler. |
|
90 * |
|
91 */ |
|
92 static void CreateDiscreetPopupHandlerL(); |
|
93 |
|
94 private: |
|
95 |
|
96 /** |
|
97 * C++ constructor. |
|
98 */ |
|
99 CAknCapServerDiscreetPopupHandler(); |
|
100 |
|
101 /** |
|
102 * Symbian second-phase constructor. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 /** |
|
107 * Provides the discreet popup handler singleton. |
|
108 * |
|
109 * @return Discreet popup handler instance. |
|
110 */ |
|
111 static CAknCapServerDiscreetPopupHandler* InstanceL(); |
|
112 |
|
113 /** |
|
114 * Handles discreet popup message received by cap server. |
|
115 * |
|
116 * @param aMessage Server message. |
|
117 */ |
|
118 void DoHandleDiscreetPopupMessageL( const RMessage2& aMessage ); |
|
119 |
|
120 /** |
|
121 * Launches global discreet popup defined in resources. |
|
122 * |
|
123 * @param aMessage Server message. |
|
124 */ |
|
125 void LaunchFromResourceL( const RMessage2& aMessage ); |
|
126 |
|
127 /** |
|
128 * Launches global discreet popup defined with parameters. |
|
129 * |
|
130 * @param aMessage Server message. |
|
131 */ |
|
132 void LaunchWithParamsL( const RMessage2& aMessage ); |
|
133 |
|
134 /** |
|
135 * Handles request cancellation. |
|
136 * |
|
137 * @param aMessage Server message. |
|
138 */ |
|
139 void HandleRequestCancellationL( const RMessage2& aMessage ); |
|
140 |
|
141 /** |
|
142 * Handles query in user global discreet popup rect |
|
143 * |
|
144 * @param aMessage Server message. |
|
145 */ |
|
146 void HandleQueryInUseRect( const RMessage2& aMessage ); |
|
147 |
|
148 /** |
|
149 * Shows popup. |
|
150 * |
|
151 * @param aCommandId Popup command id. |
|
152 * @param aPopup Popup control. |
|
153 * @param aAppUid Application uid. |
|
154 * @param aViewUid View uid. |
|
155 * @param aMessage Server message. |
|
156 */ |
|
157 void ShowPopupL( |
|
158 const TInt& aCommandId, |
|
159 CAknDiscreetPopupControl* aPopup, |
|
160 const TUid& aAppUid, |
|
161 const TUid& aViewUid, |
|
162 const RMessage2& aMessage ); |
|
163 |
|
164 /** |
|
165 * Provides the next available command id. |
|
166 * |
|
167 * @return Next available command id. |
|
168 */ |
|
169 TInt NextAvailableCommandId(); |
|
170 |
|
171 /** |
|
172 * Publish a RProperty indicates the running global discreet popup changed, |
|
173 * either new global discreet popup being displayed, or existing global dis- |
|
174 * creet popup quit |
|
175 * |
|
176 * @since v5.2 |
|
177 */ |
|
178 void NotifyRunningGlobalDiscreetPopupChanged(); |
|
179 |
|
180 // from base class MEikCommandObserver |
|
181 |
|
182 /** |
|
183 * Processes user commands. |
|
184 * |
|
185 * @param aCommandId ID of the command to respond to. |
|
186 */ |
|
187 void ProcessCommandL( TInt aCommandId ); |
|
188 |
|
189 // from base class MCoeControlObserver |
|
190 |
|
191 /** |
|
192 * Handles an event from an observed control. |
|
193 * |
|
194 * @param aControl The control that sent the event. |
|
195 * @param aEventType The event type. |
|
196 */ |
|
197 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
198 |
|
199 private: // data |
|
200 |
|
201 /** |
|
202 * Active popup's data. |
|
203 */ |
|
204 RArray<TAknCapServerDiscreetPopupData> iPopupDataArray; |
|
205 |
|
206 /** |
|
207 * Cap server app ui. |
|
208 */ |
|
209 CCoeAppUi* iAppUi; |
|
210 |
|
211 }; |
|
212 |
|
213 |
|
214 #endif // C_AKNCAPSERVERDISCREETPOPUPHANDLER_H |