|
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: Phone UI View |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPHONEVIEW_H |
|
19 #define __CPHONEVIEW_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <coecntrl.h> |
|
24 #include <coeview.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CAknsLayeredBackgroundControlContext; |
|
28 class TPhoneCommandParam; |
|
29 class CEikButtonGroupContainer; |
|
30 class MPhoneViewObserver; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Base class for protocol spesific call header views. |
|
36 */ |
|
37 class CPhoneView : public CCoeControl, public MCoeView |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 static CPhoneView* NewL( TRect aRect, CEikButtonGroupContainer& aCba ); |
|
42 |
|
43 virtual ~CPhoneView(); |
|
44 |
|
45 public: // Functions from base classes |
|
46 |
|
47 /** |
|
48 * Returns a TVwsViewId uniquely identifying the view. |
|
49 * @return Represents a view in the server |
|
50 */ |
|
51 TVwsViewId ViewId() const; |
|
52 |
|
53 void ActivateL(); |
|
54 |
|
55 /** |
|
56 * From CCoeControl; notifier for resource changes |
|
57 * @param aType : Type of resource change |
|
58 */ |
|
59 void HandleResourceChange( TInt aType ); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * Sets the control as component. |
|
65 * @param aControl It is the new component. |
|
66 */ |
|
67 void SetControl( CCoeControl* aControl ); |
|
68 |
|
69 /** |
|
70 * Returns the control in the view. |
|
71 * @return aControl The control. |
|
72 */ |
|
73 CCoeControl* Control() const; |
|
74 |
|
75 /** |
|
76 * Sets the bitmap |
|
77 * @param aCommandParam a command parameter |
|
78 */ |
|
79 void SetBitmap( TPhoneCommandParam* aCommandParam ); |
|
80 |
|
81 /** |
|
82 * Gets the bitmap |
|
83 * @param aCommandParam a command parameter |
|
84 */ |
|
85 void GetBitmap( TPhoneCommandParam* aCommandParam ); |
|
86 |
|
87 /** |
|
88 * Sets the security mode flag ETrue or EFalse |
|
89 * @param aStatus ETrue for the security mode. EFalse for the |
|
90 * normal mode. |
|
91 */ |
|
92 void SetSecurityMode ( TBool aStatus ); |
|
93 |
|
94 /** |
|
95 * Get state of the security mode flag |
|
96 * @return aStatus ETrue for the security mode. EFalse for the |
|
97 * normal mode. |
|
98 */ |
|
99 TBool IsSecurityMode(); |
|
100 |
|
101 /** |
|
102 * Gets the previous app flag value. |
|
103 */ |
|
104 TBool GetActivatePreviousApp(); |
|
105 |
|
106 /** |
|
107 * Sets the fall back flag ETrue or EFalse |
|
108 * @param aStatus ETrue if back activates previous app. |
|
109 * EFalse if idle is to be opened. |
|
110 */ |
|
111 void SetActivatePreviousApp( const TBool aStatus ); |
|
112 |
|
113 /** |
|
114 * Sets dialer activate flag to ETrue or EFalse |
|
115 * @param aStatus ETrue if next activate view inside |
|
116 * phoneapp is dialer. EFalse if not dialer. |
|
117 */ |
|
118 void SetPhoneAppViewToDialer( const TBool aStatus ); |
|
119 |
|
120 /** |
|
121 * Returns dialer activate flag status. |
|
122 */ |
|
123 TBool PhoneAppViewToDialer(); |
|
124 |
|
125 /** |
|
126 * Enables or disables pointer capture for phoneview |
|
127 * @param aStatus ETrue, pointer capture will be enabled |
|
128 */ |
|
129 void CapturePointerEvents( const TBool aCapture ); |
|
130 |
|
131 /** |
|
132 * Sets view observer for view events. |
|
133 */ |
|
134 void SetPhoneViewObserver( MPhoneViewObserver& aObserver ); |
|
135 |
|
136 /** |
|
137 * Sets permission to activate dialer view. |
|
138 */ |
|
139 void SetDialerActivation( TBool aActivation ); |
|
140 |
|
141 public: // Functions from base classes |
|
142 |
|
143 /** |
|
144 * From CCoeControl |
|
145 */ |
|
146 void SetRect( const TRect &aRect ); |
|
147 |
|
148 protected: // Functions from base classes |
|
149 |
|
150 /** |
|
151 * From CCoeControl |
|
152 */ |
|
153 void HandlePointerEventL( |
|
154 const TPointerEvent& aPointerEvent ); |
|
155 |
|
156 /** |
|
157 * From CCoeControl |
|
158 */ |
|
159 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
160 |
|
161 /** |
|
162 * From CCoeControl |
|
163 */ |
|
164 TInt CountComponentControls() const; |
|
165 |
|
166 /** |
|
167 * From CCoeControl |
|
168 */ |
|
169 void Draw( const TRect& aRect ) const; |
|
170 |
|
171 /** |
|
172 * From CCoeControl, informs that the size is changed to update |
|
173 * the sizes of component controls appropriately. |
|
174 */ |
|
175 void SizeChanged(); |
|
176 |
|
177 /** |
|
178 * From CCoeControl, informs that the position has been changed. |
|
179 */ |
|
180 void PositionChanged(); |
|
181 |
|
182 /** |
|
183 * From CCoeControl, MopSupplyObject |
|
184 */ |
|
185 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
186 |
|
187 /** |
|
188 * From CCoeControl |
|
189 */ |
|
190 void FocusChanged( TDrawNow aDrawNow ); |
|
191 |
|
192 private: // Functions from base classes |
|
193 |
|
194 /** |
|
195 * Takes any action required on activation of the view. |
|
196 * Reimplemented versions should read the message text |
|
197 * @param aCustomMessage message for any message type |
|
198 * identified by aCustomMessageId |
|
199 * @param aCustomMessageId message ID that the view understands |
|
200 * @param aPrevViewId The id of the previously active view |
|
201 * so that the view may switch back to its caller |
|
202 * at some later stage |
|
203 */ |
|
204 void ViewActivatedL( |
|
205 const TVwsViewId& aPrevViewId, |
|
206 TUid aCustomMessageId, |
|
207 const TDesC8& aCustomMessage ); |
|
208 |
|
209 /** |
|
210 * Takes any action required on deactivation of the view e.g. to |
|
211 * make the controls owned by the view non-visible |
|
212 * (thereby saving the window server uneccessary work). |
|
213 */ |
|
214 void ViewDeactivated(); |
|
215 |
|
216 private: |
|
217 |
|
218 CPhoneView( CEikButtonGroupContainer& aCba ); |
|
219 |
|
220 void ConstructL( TRect aRect ); |
|
221 |
|
222 private: |
|
223 |
|
224 /** |
|
225 * Updates size of the control. |
|
226 */ |
|
227 void UpdateControlRect(); |
|
228 |
|
229 private: |
|
230 |
|
231 // Region type. |
|
232 typedef RRegionBuf< KPhoneRegionAmount > RPhoneRegionBuf; |
|
233 |
|
234 // Owned: region |
|
235 RPhoneRegionBuf iRegion; |
|
236 |
|
237 // Owned: background context. |
|
238 CAknsLayeredBackgroundControlContext* iBgContext; |
|
239 |
|
240 // Pointer to active control. |
|
241 CCoeControl* iControl; |
|
242 |
|
243 // Owned: Active Idle main bitmap. |
|
244 CFbsBitmap* iBitmap; |
|
245 |
|
246 //Id of the fullscreen AI plugin |
|
247 TInt iFsAiId; |
|
248 |
|
249 //MainPane |
|
250 TRect iMainPane; |
|
251 |
|
252 //Is security mode or not |
|
253 TBool iSecurityMode; |
|
254 |
|
255 // Previous app flag. |
|
256 TBool iActivatePreviousApp; |
|
257 |
|
258 // Dialer activation flag. |
|
259 TBool iPhoneAppViewToDialer; |
|
260 |
|
261 CEikButtonGroupContainer& iCba; |
|
262 |
|
263 MPhoneViewObserver* iObserver; |
|
264 |
|
265 TBool iDialerActivation; |
|
266 }; |
|
267 |
|
268 #endif // __CPHONEVIEW_H |
|
269 |