|
1 /* |
|
2 * Copyright (c) 2002-2008 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: EIKON Status Pane control. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __EIKSPANE_H__ |
|
20 #define __EIKSPANE_H__ |
|
21 |
|
22 #include <eikspmod.h> |
|
23 #include <coecntrl.h> |
|
24 #include <coecobs.h> |
|
25 |
|
26 class CCoeBrushAndPenContext; |
|
27 class CEikStatusPaneContainer; |
|
28 class CEikStatusPaneBaseExtension; |
|
29 class CAknStatuspaneClearer; |
|
30 class CAknDelayedForegroundObserver; |
|
31 class CAknStatusPaneDataSubscriber; |
|
32 class TAknsItemID; |
|
33 |
|
34 /** |
|
35 * Status pane flag indicating that a sub-pane exists |
|
36 * in the status pane. |
|
37 */ |
|
38 const TInt KStatusPaneCapsPresentBit = 1; |
|
39 |
|
40 /** |
|
41 * Status pane flag indicating that a sub-pane is owned |
|
42 * by the application side status pane. |
|
43 */ |
|
44 const TInt KStatusPaneCapsAppOwnedBit = 2; |
|
45 |
|
46 /** |
|
47 * Status pane flag indicating that a sub-pane is part of |
|
48 * a specific status pane layout. |
|
49 */ |
|
50 const TInt KStatusPaneCapsInCurrentLayoutBit = 4; |
|
51 |
|
52 /** |
|
53 * The @c MEikStatusPaneObserver interface allows a status pane observer to |
|
54 * pick up changes in the size or position of the status pane. Such events |
|
55 * will be as a result of layout changes which cause an actual change in the |
|
56 * status pane rectangle. |
|
57 */ |
|
58 class MEikStatusPaneObserver |
|
59 { |
|
60 public: |
|
61 virtual void HandleStatusPaneSizeChange() = 0; |
|
62 }; |
|
63 |
|
64 /** |
|
65 * The base class for status panes. |
|
66 */ |
|
67 class CEikStatusPaneBase : public CBase |
|
68 { |
|
69 |
|
70 public: |
|
71 |
|
72 /** |
|
73 * Describes the capabilities of a subpane. |
|
74 */ |
|
75 class TPaneCapabilities |
|
76 { |
|
77 |
|
78 public: |
|
79 |
|
80 /** |
|
81 * Constructor. |
|
82 */ |
|
83 TPaneCapabilities(); |
|
84 |
|
85 /** |
|
86 * Tests whether the subpane exists in the status pane. |
|
87 * |
|
88 * @return @c ETrue if the subpane exists and can be used by the |
|
89 * application, even if the subpane is not visible. |
|
90 */ |
|
91 inline TBool IsPresent() const; |
|
92 |
|
93 /** |
|
94 * Tests whether the pane is owned by the application or the server. |
|
95 * Applications can only interact directly with application owned |
|
96 * subpanes. |
|
97 * |
|
98 * @return @c ETrue if the subpane is owned by the application. |
|
99 */ |
|
100 inline TBool IsAppOwned() const; |
|
101 |
|
102 /** |
|
103 * Tests if this pane is part of the current status pane layout. |
|
104 * |
|
105 * @return @c ETrue if pane is part of the current status pane layout. |
|
106 */ |
|
107 inline TBool IsInCurrentLayout() const; |
|
108 |
|
109 private: |
|
110 |
|
111 inline void SetPresent(); |
|
112 inline void SetAppOwned(); |
|
113 inline void SetInCurrentLayout(); |
|
114 |
|
115 private: |
|
116 |
|
117 TInt iFlags; |
|
118 |
|
119 private: |
|
120 |
|
121 friend class CEikStatusPaneBase; |
|
122 }; |
|
123 |
|
124 public: |
|
125 |
|
126 /** |
|
127 * Destructor. |
|
128 */ |
|
129 IMPORT_C ~CEikStatusPaneBase(); |
|
130 |
|
131 /** |
|
132 * Gets a pointer to the thread's currently active status pane |
|
133 * without transferring ownership. |
|
134 * |
|
135 * @return Pointer to currently active status pane. |
|
136 * Returns @c NULL if no such pane exists. |
|
137 */ |
|
138 IMPORT_C static CEikStatusPaneBase* Current(); |
|
139 |
|
140 /** |
|
141 * Sets the status pane observer. |
|
142 * |
|
143 * @param aObserver Pointer to status pane observer. |
|
144 */ |
|
145 inline void SetObserver( MEikStatusPaneObserver* aObserver ); |
|
146 |
|
147 /** |
|
148 * Modifies the bounding rectangle so that it lies next to the |
|
149 * status pane rectangle. |
|
150 * |
|
151 * The status pane always places itself along the edge of the screen, so |
|
152 * that it is consistent across applications and the server. It is |
|
153 * assumed that the given bounding rectangle does not extend beyond |
|
154 * the screen area. |
|
155 * |
|
156 * @param[in,out] aBoundingRect The bounding rectangle. |
|
157 */ |
|
158 IMPORT_C void ReduceRect( TRect& aBoundingRect ) const; |
|
159 |
|
160 /** |
|
161 * Adds and removes pane rectangles from @c aRegion. |
|
162 * |
|
163 * @param aRegion The two-dimensional area from where |
|
164 * rectangles are removed from or where |
|
165 * rectangles are added to. |
|
166 * @param aIncludeAppPanes If @c ETrue, app panes are added, otherwise |
|
167 * removed. |
|
168 * @param aIncludeServerPanes If @c ETrue, server panes are added, |
|
169 * otherwise removed. |
|
170 */ |
|
171 IMPORT_C void GetShapeL( TRegion& aRegion, |
|
172 TBool aIncludeAppPanes, |
|
173 TBool aIncludeServerPanes ) const; |
|
174 |
|
175 /** |
|
176 * Switches to the specified status pane layout. |
|
177 * |
|
178 * The actual layout to which this method switches may not be the |
|
179 * same as specified in @c aLayoutResourceId parameter. |
|
180 * Eg. if landscape mode status pane layout is set with this method, |
|
181 * while in portrait mode, it's mapped to the corresponding layout |
|
182 * in the portrait mode. This should be noted when using |
|
183 * @c CEikStatusPaneBase::CurrentLayoutResId(). |
|
184 * |
|
185 * From release 3.2 on the old status pane layouts are also mapped |
|
186 * to the new layouts, ie. |
|
187 * @c R_AVKON_STATUS_PANE_LAYOUT_USUAL -> |
|
188 * @c R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT |
|
189 * |
|
190 * @c R_AVKON_STATUS_PANE_LAYOUT_IDLE -> |
|
191 * @c R_AVKON_STATUS_PANE_LAYOUT_IDLE_EXT |
|
192 * |
|
193 * @param aLayoutResourceId Layout resource ID. This must be one of the |
|
194 * layouts identified in the status pane |
|
195 * resource structures, otherwise the function |
|
196 * leaves @c KErrNotFound. |
|
197 * @see avkon.rsg |
|
198 * |
|
199 * @leave KErrNotFound The specified layout does not exist in the |
|
200 * status pane resource structures. |
|
201 */ |
|
202 IMPORT_C virtual void SwitchLayoutL( TInt aLayoutResourceId ); |
|
203 |
|
204 /** |
|
205 * Sets the visibility of the status pane and it's contents. |
|
206 * |
|
207 * @param aVisible If @c ETrue the status pane and it's contents are set |
|
208 * visible. |
|
209 */ |
|
210 IMPORT_C virtual void MakeVisible( TBool aVisible ); |
|
211 |
|
212 /** |
|
213 * Sets the status pane and it's contents to dimmed state. |
|
214 * |
|
215 * @param aDimmed If @c ETrue the status pane and it's contents are |
|
216 * set to dimmed state. |
|
217 */ |
|
218 IMPORT_C virtual void SetDimmed( TBool aDimmed ); |
|
219 |
|
220 /** |
|
221 * Not implemented. |
|
222 * |
|
223 * @param aFaded Not used. |
|
224 */ |
|
225 IMPORT_C virtual void SetFaded( TBool aFaded ); |
|
226 |
|
227 /** |
|
228 * Handles changes in resources which are shared across the environment. |
|
229 * This function responds to the changes in resources by propagating them |
|
230 * to sub-parts of the status pane. |
|
231 * |
|
232 * @param aType A message type. |
|
233 */ |
|
234 IMPORT_C virtual void HandleResourceChange( TInt aType ); |
|
235 |
|
236 /** |
|
237 * Returns always @c ETrue. |
|
238 * |
|
239 * @return @c ETrue. |
|
240 */ |
|
241 IMPORT_C virtual TBool OkToChangeStatusPaneNow(); |
|
242 |
|
243 /** |
|
244 * Sets all the visual flags at once |
|
245 * (@c KEikStatusPaneBaseVisibleBit and |
|
246 * @c KEikStatusPaneBaseDimmedBit). |
|
247 * |
|
248 * @param aFlags Flags to be set. |
|
249 */ |
|
250 IMPORT_C void SetFlags( TInt aFlags ); |
|
251 |
|
252 /** |
|
253 * Gets status pane settings. |
|
254 * |
|
255 * @return Flags used by status pane base class. |
|
256 */ |
|
257 IMPORT_C TInt Flags() const; |
|
258 |
|
259 /** |
|
260 * Gets the visibility of the status pane. |
|
261 * |
|
262 * @return @c ETrue if the status pane is visible. |
|
263 */ |
|
264 IMPORT_C TBool IsVisible() const; |
|
265 |
|
266 /** |
|
267 * Gets the dimmed state of the status pane. |
|
268 * |
|
269 * @return @c ETrue if the status pane is dimmed. |
|
270 */ |
|
271 IMPORT_C TBool IsDimmed() const; |
|
272 |
|
273 /** |
|
274 * Gets the fade status of the status pane. |
|
275 * |
|
276 * @return @c ETrue if status pane is faded. |
|
277 */ |
|
278 IMPORT_C TBool IsFaded() const; |
|
279 |
|
280 /** |
|
281 * Gets the capabilities of a sub-pane in the status pane. |
|
282 * |
|
283 * @param aPaneId Sub-pane ID. |
|
284 * |
|
285 * @return Capabilities of the pane. |
|
286 */ |
|
287 IMPORT_C TPaneCapabilities PaneCapabilities( TPaneId aPaneId ) const; |
|
288 |
|
289 /** |
|
290 * Provides the screen rectangle of a sub-pane. |
|
291 * This can be used to set the size of a new control which you want |
|
292 * to place in the status pane. |
|
293 * |
|
294 * @param aPaneId Sub-pane ID. |
|
295 * |
|
296 * @return The sub-pane rectangle. |
|
297 * |
|
298 * @leave KErrNotFound The sub-pane ID is not valid. |
|
299 */ |
|
300 IMPORT_C TRect PaneRectL( TPaneId aPaneId ) const; |
|
301 |
|
302 /** |
|
303 * Provides the control currently inside a sub-pane. |
|
304 * This gives the application direct access to the contents of a pane. |
|
305 * |
|
306 * @param aPaneId Sub-pane ID. |
|
307 * |
|
308 * @return Pointer to the control instance inside the sub-pane. |
|
309 * |
|
310 * @leave KErrNotFound The sub-pane ID is not valid. |
|
311 */ |
|
312 IMPORT_C CCoeControl* ControlL( TPaneId aPaneId ) const; |
|
313 |
|
314 /** |
|
315 * Swaps the control currently inside a sub-pane. |
|
316 * The new control must be a fully constructed control. |
|
317 * It will be placed inside the status pane, and the current |
|
318 * content will be returned to the caller. |
|
319 * |
|
320 * @param aPaneId ID of the sub-pane. |
|
321 * @param aNewControl A fully constructed control to |
|
322 * place at @c aPaneId. |
|
323 * |
|
324 * @return The control which was at @c aPaneId. |
|
325 * |
|
326 * @leave KErrNotFound This can occur before ownership of the new |
|
327 * control is taken, if the subpane ID is not valid. |
|
328 */ |
|
329 IMPORT_C CCoeControl* SwapControlL( TPaneId aPaneId, |
|
330 CCoeControl* aNewControl ); |
|
331 |
|
332 /** |
|
333 * Provides access to the container control of a sub-pane. |
|
334 * You will need access to the container of a sub pane if you want |
|
335 * to swap in a new control. The container control should be set as the |
|
336 * parent window of the new control. |
|
337 * It also provides a fast way to get the rectangle of the sub-pane |
|
338 * (@see PaneRect()). |
|
339 * |
|
340 * @param aPaneId ID of the sub-pane. |
|
341 * |
|
342 * @return Pointer to the new container control for the sub-pane. |
|
343 * |
|
344 * @leave KErrNotFound The sub-pane ID is not valid. |
|
345 */ |
|
346 IMPORT_C CCoeControl* ContainerControlL( TPaneId aPaneId ) const; |
|
347 |
|
348 /** |
|
349 * Provides access to a server-side window group. |
|
350 * |
|
351 * @return Pointer to the window group. |
|
352 */ |
|
353 inline RWindowGroup* WindowGroup() const; |
|
354 |
|
355 /** |
|
356 * Draws the control. |
|
357 */ |
|
358 IMPORT_C void DrawNow(); |
|
359 |
|
360 /** |
|
361 * Gets the resource ID of the current layout. |
|
362 * |
|
363 * @return The resource ID of the current layout. |
|
364 * @see avkon.rsg |
|
365 */ |
|
366 IMPORT_C TInt CurrentLayoutResId() const; |
|
367 |
|
368 /** |
|
369 * Status pane drawing commands. |
|
370 */ |
|
371 enum TDrawCmd |
|
372 { |
|
373 /** Do not draw. */ |
|
374 ENoDraw, |
|
375 |
|
376 /** Draw immediately. */ |
|
377 EDrawNow, |
|
378 |
|
379 /** Draw with low priority. */ |
|
380 EDrawDeferred |
|
381 }; |
|
382 |
|
383 /** |
|
384 * Sets the skin background ID of sub-panes which |
|
385 * are in the CBA area. |
|
386 * @internal This method is not exported. |
|
387 * |
|
388 * @param aBgID The skin background ID to be set. |
|
389 * @param aDrawCmd Whether the status pane is drawn |
|
390 * when updating the background context, |
|
391 * (@see @c TDrawCmd). |
|
392 */ |
|
393 void SetCbaAreaBackgroundID( const TAknsItemID& aBgID, |
|
394 CEikStatusPaneBase::TDrawCmd aDrawCmd ); |
|
395 |
|
396 /** |
|
397 * Returns the current skin background ID of the sub-panes |
|
398 * which are in the CBA area. |
|
399 * @internal This method is not exported. |
|
400 * |
|
401 * @return The skin background ID. |
|
402 */ |
|
403 TAknsItemID CbaAreaBackgroundID(); |
|
404 |
|
405 protected: |
|
406 |
|
407 /** |
|
408 * C++ default constructor. |
|
409 * |
|
410 * @param aEikEnv An environment for creating controls and utility |
|
411 * functions for manipulating them. |
|
412 * @param aParent Pointer to the parent window group. |
|
413 */ |
|
414 IMPORT_C CEikStatusPaneBase( CEikonEnv& aEikEnv, RWindowGroup* aParent ); |
|
415 |
|
416 /** |
|
417 * Initializes the status pane with standard values. |
|
418 * |
|
419 * @param aCoreResId ID of the status pane resource. |
|
420 */ |
|
421 IMPORT_C void BaseConstructL( TInt aCoreResId ); |
|
422 |
|
423 /** |
|
424 * Creates a new model for the status pane. |
|
425 * |
|
426 * @param aCoreResId ID of the status pane resource. |
|
427 * |
|
428 * @return Pointer to the new status pane model instance. |
|
429 */ |
|
430 virtual CEikStatusPaneModelBase* CreateModelL( TInt aCoreResId ) const = 0; |
|
431 |
|
432 /** |
|
433 * Creates the sub-panes to the status pane. |
|
434 */ |
|
435 void CreatePanesL(); |
|
436 |
|
437 /** |
|
438 * Creates a sub-pane. |
|
439 * |
|
440 * @param[in] aPaneInit Initial values for the sub-pane. |
|
441 */ |
|
442 void CreatePaneL( const TEikStatusPaneInit& aPaneInit ); |
|
443 |
|
444 /** |
|
445 * Gets a container of a specified sub-pane. |
|
446 * |
|
447 * @param aPaneId The sub-pane ID. |
|
448 * |
|
449 * @return Pointer to the container of the sub-pane with a given ID. |
|
450 */ |
|
451 CEikStatusPaneContainer* Find( TPaneId aPaneId ) const; |
|
452 |
|
453 /** |
|
454 * Can be used to determine whether or not the status pane is on |
|
455 * application side or server side. |
|
456 * |
|
457 * @return @c ETrue if the status pane resides in the application side, |
|
458 * @c EFalse if it's on the server side. |
|
459 */ |
|
460 virtual TBool IsApp() const = 0; |
|
461 |
|
462 /** |
|
463 * Gets the rectangle of the status pane. |
|
464 * |
|
465 * @return The rectangle used by the status pane. |
|
466 */ |
|
467 inline TRect Rect() const; |
|
468 |
|
469 /** |
|
470 * Calls @c CCoeControl's @c DrawNow() or @c DrawDeferred() to draw the |
|
471 * status pane. If @c aDraw is @c ENoDraw status pane is not drawed. |
|
472 * |
|
473 * @param aDraw Status pane drawing command. |
|
474 */ |
|
475 void DoDrawNow( TDrawCmd aDraw ); |
|
476 |
|
477 /** |
|
478 * Gets the status pane clearer. |
|
479 * |
|
480 * @return Pointer to the status pane clearer instance. |
|
481 */ |
|
482 CAknStatuspaneClearer* Clearer(); |
|
483 |
|
484 /** |
|
485 * Disables the status pane clearer. |
|
486 * |
|
487 * @param aDisabled Disabled if @c ETrue. |
|
488 */ |
|
489 IMPORT_C void DisableClearer( TBool aDisabled ); |
|
490 |
|
491 /** |
|
492 * Prepares the status pane for the application exit. |
|
493 * Clears the status pane. |
|
494 */ |
|
495 IMPORT_C void CommonPrepareForAppExit(); |
|
496 |
|
497 private: |
|
498 |
|
499 void DoSwitchLayoutL( TInt aLayoutResourceId, TDrawCmd aDraw ); |
|
500 void ApplyLayoutL( CEikStatusPaneLayout* aLayout, TDrawCmd aDraw ); |
|
501 void SetAllInvisible(); |
|
502 void SetNotNeededInvisible(); |
|
503 |
|
504 public: |
|
505 |
|
506 /** |
|
507 * Notifies the command button area and status pane observer about the |
|
508 * status pane size change. If the status pane is an embedded application, |
|
509 * also this application is notified. |
|
510 */ |
|
511 void ReportSizeChange(); |
|
512 |
|
513 private: |
|
514 |
|
515 class TSetRectAndVisibility : public MEikStatusPaneLayoutTreeVisitor |
|
516 { |
|
517 public: |
|
518 |
|
519 TSetRectAndVisibility( TBool aIsApp, CEikStatusPaneBase* aStatusPane ); |
|
520 void VisitL( CEikStatusPaneLayoutTree* aNode ); |
|
521 |
|
522 private: |
|
523 |
|
524 TBool iIsApp; |
|
525 CEikStatusPaneBase* iStatusPane; |
|
526 }; |
|
527 |
|
528 friend class TSetRectAndVisibility; |
|
529 |
|
530 private: |
|
531 |
|
532 void SetLastUsedResourceId( TInt aResourceId ); |
|
533 TInt LastUsedResourceId(); |
|
534 TInt ReadInitialUsedResourceIdL( TInt aCoreResId ); |
|
535 TInt InitialUsedResourceId(); |
|
536 TRect LargestBoundingRect( TRegion& aWholeRegion, |
|
537 TRegion& aRemovedRegion ) const; |
|
538 |
|
539 protected: |
|
540 |
|
541 /** |
|
542 * Gets the status pane data subscriber. |
|
543 * |
|
544 * @return Pointer to the status pane data subscriber. |
|
545 */ |
|
546 CAknStatusPaneDataSubscriber* DataSubscriber() const; |
|
547 |
|
548 /** |
|
549 * Sets the initial status pane resource ID to an extension class |
|
550 * @c CEikStatusPaneBaseExtension. |
|
551 * |
|
552 * @param aResourceId The initial status pane resource ID. |
|
553 */ |
|
554 void SetInitialUsedResourceId( TInt aResourceId ); |
|
555 |
|
556 /** |
|
557 * Optimizes the status pane region which cleared during |
|
558 * status pane layout change. |
|
559 * |
|
560 * @param aOldResourceId Old status pane resource ID. |
|
561 * @param aNewResourceId New status pane resource ID. |
|
562 * @param[in,out] aRegion Status pane region. |
|
563 * On return contains only |
|
564 * the region that needs to be cleared. |
|
565 */ |
|
566 void OptimizeClearerWindowShape( TInt aOldResourceId, |
|
567 TInt aNewResourceId, |
|
568 TRegion& aRegion ); |
|
569 |
|
570 /** |
|
571 * Sets redraw storing state of the window. |
|
572 * |
|
573 * @param aWindow The window whose redraw storing state is to be set. |
|
574 * @param aOn @c ETrue to turn redraw storing on. |
|
575 */ |
|
576 void SetStoreHandler( RWindow* aWindow, TBool aOn ); |
|
577 |
|
578 protected: |
|
579 |
|
580 /** |
|
581 * An environment for creating controls and utility functions for |
|
582 * manipulating them. |
|
583 */ |
|
584 CEikonEnv& iEikEnv; |
|
585 |
|
586 /** |
|
587 * Status pane model class. <br> |
|
588 * Own. |
|
589 */ |
|
590 CEikStatusPaneModelBase* iModel; |
|
591 |
|
592 /** |
|
593 * Flags for the status pane. |
|
594 */ |
|
595 TInt iFlags; |
|
596 |
|
597 protected: |
|
598 |
|
599 typedef CArrayPtrFlat<CEikStatusPaneContainer> CContainerControls; |
|
600 CContainerControls* iControls; |
|
601 |
|
602 private: |
|
603 |
|
604 MEikStatusPaneObserver* iObserver; |
|
605 RWindowGroup* iParentWindowGroup; |
|
606 CEikStatusPaneBaseExtension* iExtension; |
|
607 }; |
|
608 |
|
609 /** |
|
610 * Application side status pane class. |
|
611 * |
|
612 * @c CEikStatusPane is the interface through which applications use the |
|
613 * status pane. This class synchronises the status pane layout with the |
|
614 * server side status pane object. To do this, the @c ApplyCurrentSettingsL() |
|
615 * method must be called whenever the owner application switches to the |
|
616 * foreground. |
|
617 */ |
|
618 NONSHARABLE_CLASS( CEikStatusPane ) : public CEikStatusPaneBase, |
|
619 public MCoeForegroundObserver |
|
620 { |
|
621 public: |
|
622 |
|
623 /** |
|
624 * Two-phased constructor. |
|
625 * |
|
626 * @param aEikEnv An environment for creating controls |
|
627 * and utility functions for |
|
628 * manipulating them. |
|
629 * @param aParent Pointer to the parent window group. |
|
630 * @param aCoreStatusPaneModelResId Status pane core resource ID. |
|
631 * @param aAppStatusPaneModelResId Resource ID of the application's |
|
632 * status pane. |
|
633 * |
|
634 * @return Pointer to the created @c CEikStatusPane object. |
|
635 */ |
|
636 IMPORT_C static CEikStatusPane* NewL( |
|
637 CEikonEnv& aEikEnv, |
|
638 RWindowGroup* aParent, |
|
639 TInt aCoreStatusPaneModelResId, |
|
640 TInt aAppStatusPaneModelResId = EEikStatusPaneUseDefaults ); |
|
641 |
|
642 /** |
|
643 * Destructor. |
|
644 */ |
|
645 IMPORT_C ~CEikStatusPane(); |
|
646 |
|
647 /** |
|
648 * Synchronises the server status pane layout with the |
|
649 * application status pane. |
|
650 */ |
|
651 IMPORT_C void ApplyCurrentSettingsL(); |
|
652 |
|
653 /** |
|
654 * Prepares the status pane for the application exit. |
|
655 * Clears the status pane. |
|
656 */ |
|
657 IMPORT_C void PrepareForAppExit(); |
|
658 |
|
659 /** |
|
660 * Sets the visiblility of the status pane and its contents. |
|
661 * From @c CEikStatusPaneBase. |
|
662 * |
|
663 * @param aVisible If @c ETrue the status pane and its |
|
664 * contents are set visible. |
|
665 */ |
|
666 IMPORT_C virtual void MakeVisible( TBool aVisible ); |
|
667 |
|
668 /** |
|
669 * Sets the status pane and its contents to dimmed state. |
|
670 * From @c CEikStatusPaneBase. |
|
671 * |
|
672 * @param aDimmed If @c ETrue the status pane and its |
|
673 * contents are set to dimmed state. |
|
674 */ |
|
675 IMPORT_C virtual void SetDimmed( TBool aDimmed ); |
|
676 |
|
677 /** |
|
678 * Not implemented. |
|
679 * From @c CEikStatusPaneBase. |
|
680 * |
|
681 * @param aFaded Not used. |
|
682 */ |
|
683 IMPORT_C virtual void SetFaded( TBool aFaded ); |
|
684 |
|
685 /** |
|
686 * Handles changes in resources which are shared across the environment. |
|
687 * This function responds to the changes in resources by propagating them |
|
688 * to sub-parts of the status pane. |
|
689 * From @c CEikStatusPaneBase. |
|
690 * |
|
691 * @param aType A message type. |
|
692 */ |
|
693 IMPORT_C virtual void HandleResourceChange( TInt aType ); |
|
694 |
|
695 /** |
|
696 * Returns always @c ETrue. |
|
697 * From @c CEikStatusPaneBase. |
|
698 * |
|
699 * @return @c ETrue. |
|
700 */ |
|
701 IMPORT_C virtual TBool OkToChangeStatusPaneNow(); |
|
702 |
|
703 private: |
|
704 |
|
705 /** |
|
706 * Default C++ constructor. |
|
707 * |
|
708 * @param aEikEnv An environment for creating controls |
|
709 * and utility functions for |
|
710 * manipulating them. |
|
711 * @param aParent Pointer to the parent window group. |
|
712 * @param aAppStatusPaneModelResId Resource ID of the application's |
|
713 * status pane. |
|
714 */ |
|
715 CEikStatusPane( CEikonEnv& aEikEnv, |
|
716 RWindowGroup* aParent, |
|
717 TInt aAppStatusPaneModelId ); |
|
718 |
|
719 /** |
|
720 * Second-phase constructor. |
|
721 * |
|
722 * @param aCoreStatusPaneModelResId Status pane core resource ID. |
|
723 */ |
|
724 void ConstructL( TInt aCoreStatusPaneModelResId ); |
|
725 |
|
726 /** |
|
727 * Creates the application side status pane model. |
|
728 * |
|
729 * @param aCoreResId Status pane core resource ID. |
|
730 */ |
|
731 virtual CEikStatusPaneModelBase* CreateModelL( TInt aCoreResId ) const; |
|
732 |
|
733 /** |
|
734 * Can be used to determine whether or not the status pane is on |
|
735 * application side or server side. |
|
736 * |
|
737 * @return @c ETrue |
|
738 */ |
|
739 TBool IsApp() const; |
|
740 |
|
741 /** |
|
742 * Applies the current status pane flags. |
|
743 */ |
|
744 void ApplyCurrentFlags(); |
|
745 |
|
746 /** |
|
747 * Hides all the sub-panes owned by the application |
|
748 * side status pane. |
|
749 */ |
|
750 void HideAppPanes( TBool aHide ); |
|
751 |
|
752 private: // From base class @c MCoeForegroundObserver. |
|
753 |
|
754 /** |
|
755 * Handles foreground gain events. |
|
756 */ |
|
757 void HandleGainingForeground(); |
|
758 |
|
759 /** |
|
760 * Handles foreground lose events. |
|
761 */ |
|
762 void HandleLosingForeground(); |
|
763 |
|
764 private: |
|
765 |
|
766 /** |
|
767 * Reads the initial status pane layout from the status pane resources. |
|
768 * |
|
769 * @param aCoreResId Status pane core resource ID. |
|
770 * @param aAppStatusPaneModelResId Resource ID specified by the |
|
771 * application. |
|
772 */ |
|
773 TInt ReadInitialUsedResourceIdL( TInt aCoreResId, |
|
774 TInt aAppStatusPaneModelResId ); |
|
775 |
|
776 /** |
|
777 * Handles foreground lose events. |
|
778 */ |
|
779 void DoHandleLosingForegroundL(); |
|
780 |
|
781 private: |
|
782 |
|
783 TInt iAppDeclId; |
|
784 |
|
785 /** Formerly TEikStatusPaneSyncDrawer* iSyncDrawer */ |
|
786 TAny* iSpare; |
|
787 |
|
788 /** Formerly iServerSpWgId */ |
|
789 CAknDelayedForegroundObserver* iDelayedForegroundObserver; |
|
790 }; |
|
791 |
|
792 /** |
|
793 * Checks if the pane exists in this status pane. |
|
794 * Note: this will return @c ETrue if the pane can be used, |
|
795 * even if it is not visible. |
|
796 */ |
|
797 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsPresent() const |
|
798 { |
|
799 return iFlags & KStatusPaneCapsPresentBit; |
|
800 } |
|
801 |
|
802 /** |
|
803 * Checks if this pane is owned by application rather than the server. |
|
804 * Applications can only interact directly with application owned panes. |
|
805 */ |
|
806 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsAppOwned() const |
|
807 { |
|
808 return iFlags & KStatusPaneCapsAppOwnedBit; |
|
809 } |
|
810 |
|
811 /** |
|
812 * Checks if this pane is part of the current status pane layout. |
|
813 */ |
|
814 inline TBool CEikStatusPaneBase::TPaneCapabilities::IsInCurrentLayout() const |
|
815 { |
|
816 return iFlags & KStatusPaneCapsInCurrentLayoutBit; |
|
817 } |
|
818 |
|
819 /** |
|
820 * Set the status pane observer. |
|
821 */ |
|
822 inline void CEikStatusPaneBase::SetObserver( MEikStatusPaneObserver* aObserver ) |
|
823 { |
|
824 iObserver = aObserver; |
|
825 } |
|
826 |
|
827 /** |
|
828 * Gets the status pane rectangle. |
|
829 */ |
|
830 inline TRect CEikStatusPaneBase::Rect() const |
|
831 { |
|
832 return iModel->CurrentLayout()->Rect(); |
|
833 } |
|
834 |
|
835 /** |
|
836 * Gets the window group that this status pane belongs to. |
|
837 */ |
|
838 inline RWindowGroup* CEikStatusPaneBase::WindowGroup() const |
|
839 { |
|
840 return iParentWindowGroup; |
|
841 } |
|
842 |
|
843 #endif // __EIKSPANE_H__ |