|
1 /* |
|
2 * Copyright (c) 1997-1999 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #if !defined(__EIKSPMOD_H__) |
|
20 #define __EIKSPMOD_H__ |
|
21 |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 |
|
26 #if !defined(__EIKON_HRH__) |
|
27 #include <uikon.hrh> |
|
28 #endif |
|
29 |
|
30 #if !defined(__EIKSRVC_H__) |
|
31 #include <eiksrvc.h> |
|
32 #endif |
|
33 |
|
34 |
|
35 class TResourceReader; |
|
36 class CEikStatusPaneLayoutTree; |
|
37 class CEikonEnv; |
|
38 class CAknSgcClient; |
|
39 class CEikStatusPaneLayout; |
|
40 namespace AknLayout { class CInstance; } |
|
41 namespace AknLayoutScalable_Avkon { class CInstance; } |
|
42 |
|
43 // Extra bit flags not defined in hrh file. |
|
44 const TInt KEikStatusPaneDirectionBit = 0x04; |
|
45 const TInt KEikStatusPaneHiddenBit = 0x08; |
|
46 const TInt KEikStatusPaneInitInitializedBit = 0x80000000; |
|
47 |
|
48 |
|
49 typedef TUid TPaneId; |
|
50 |
|
51 /** |
|
52 * |
|
53 * This class stores the details about status pane sub pane |
|
54 * ownership and initial contents. |
|
55 * |
|
56 */ |
|
57 class TEikStatusPaneInit |
|
58 { |
|
59 public: |
|
60 /** |
|
61 * Default constructor. |
|
62 */ |
|
63 TEikStatusPaneInit(); |
|
64 |
|
65 /** |
|
66 * Copy constructor. |
|
67 */ |
|
68 TEikStatusPaneInit(const TEikStatusPaneInit& aCopy); |
|
69 |
|
70 /** |
|
71 * Operator overload. |
|
72 */ |
|
73 TEikStatusPaneInit& operator=(const TEikStatusPaneInit& aCopy); |
|
74 |
|
75 /** |
|
76 * Gets pane id. |
|
77 * @return id of the pane. |
|
78 */ |
|
79 inline TPaneId Id() const; |
|
80 |
|
81 /** |
|
82 * Loads deafault values of the pane from given resource. |
|
83 * Resource reader should point to an entry from the arrays of |
|
84 * SPANE_PANE structures found in the STATUS_PANE_SYSTEM_MODEL |
|
85 * and STATUS_PANE_APP_MODEL resource structures. |
|
86 * |
|
87 * @param @aResource Resource reader. |
|
88 */ |
|
89 void LoadDefaults(TResourceReader& aResource); |
|
90 |
|
91 /** |
|
92 * Gets flag that indicates if the sub pane is owned by the |
|
93 * application or not. |
|
94 * @return ETrue if pane is application owned, otherwise EFalse. |
|
95 */ |
|
96 inline TBool AppOwned() const; |
|
97 |
|
98 /** |
|
99 * Returns control type id of the pane. |
|
100 * @return Id of the control inside the pane. |
|
101 */ |
|
102 inline TInt ControlTypeId() const; |
|
103 |
|
104 /** |
|
105 * Returns resource id of the control in the pane. |
|
106 * @return Control resource id. |
|
107 */ |
|
108 inline TInt ControlResourceId() const; |
|
109 |
|
110 /** |
|
111 * Sets hidden flag. |
|
112 */ |
|
113 inline void SetHidden(); |
|
114 |
|
115 /** |
|
116 * Clears hidden flag. |
|
117 */ |
|
118 inline void ClearHidden(); |
|
119 |
|
120 /** |
|
121 * Gets hidden flag. |
|
122 * @return ETrue if the pane is hidden. |
|
123 */ |
|
124 inline TBool IsHidden() const; |
|
125 |
|
126 private: |
|
127 /** |
|
128 * Gets initialized flag. |
|
129 * @return ETrue if the pane is initialized. |
|
130 */ |
|
131 inline TBool Initialized(); |
|
132 |
|
133 /** |
|
134 * Sets initialized flag. |
|
135 */ |
|
136 inline void SetInitialized(); |
|
137 |
|
138 private: |
|
139 TPaneId iId; |
|
140 TInt iControlId; |
|
141 TInt iControlResource; |
|
142 TInt iFlags; |
|
143 }; |
|
144 |
|
145 |
|
146 /** |
|
147 * |
|
148 * This class stores array of TEikStatusPaneInit instances. |
|
149 * |
|
150 */ |
|
151 NONSHARABLE_CLASS(CEikStatusPaneSetInit) : public CArrayFixFlat<TEikStatusPaneInit> |
|
152 { |
|
153 public: |
|
154 |
|
155 /** |
|
156 * Two phase constructor. |
|
157 */ |
|
158 static CEikStatusPaneSetInit* NewL(); |
|
159 |
|
160 /** |
|
161 * Destructor. |
|
162 */ |
|
163 ~CEikStatusPaneSetInit(); |
|
164 |
|
165 /** |
|
166 * Loads deafault values of the panes from given resource. |
|
167 * Values are read from SPANE_PANE structure found in the |
|
168 * STATUS_PANE_SYSTEM_MODEL and STATUS_PANE_APP_MODEL resource |
|
169 * structures |
|
170 * @param @aResource Resource reader. |
|
171 */ |
|
172 void LoadDefaultsL(TResourceReader& aResource); |
|
173 |
|
174 /** |
|
175 * Finds the pane init with a given id. If a pane init |
|
176 * is not found, method leaves with code KErrNotFound. |
|
177 * @return The pane init instance with given id. |
|
178 */ |
|
179 TEikStatusPaneInit& FindL(const TPaneId& aPaneId); |
|
180 |
|
181 private: |
|
182 |
|
183 /** |
|
184 * Private constructor. |
|
185 */ |
|
186 CEikStatusPaneSetInit(); |
|
187 }; |
|
188 |
|
189 |
|
190 /** |
|
191 * |
|
192 * This abstract class is used for checking pane layout validity. |
|
193 * |
|
194 */ |
|
195 class MEikStatusPaneLayoutTreeVisitor |
|
196 { |
|
197 public: |
|
198 /** |
|
199 * Virtual function of which implementation should be provided |
|
200 * by the classes that implement the layout check visitor design |
|
201 * pattern. |
|
202 * @param aNode A layout node to be visited. |
|
203 */ |
|
204 virtual void VisitL(CEikStatusPaneLayoutTree* aNode) = 0; |
|
205 }; |
|
206 |
|
207 |
|
208 |
|
209 /** |
|
210 * |
|
211 * This class calculates and stores the screen area available |
|
212 * for each layout tree. |
|
213 * |
|
214 */ |
|
215 NONSHARABLE_CLASS(CEikStatusPaneLayoutTree) : public CBase |
|
216 { |
|
217 public: |
|
218 enum TDirection |
|
219 { |
|
220 /** Horizontal direction */ |
|
221 EHorizontal, |
|
222 /** Vertical direction */ |
|
223 EVertical |
|
224 }; |
|
225 |
|
226 public: |
|
227 /** |
|
228 * Destructor. |
|
229 */ |
|
230 ~CEikStatusPaneLayoutTree(); |
|
231 |
|
232 /** |
|
233 * Two phase constructor. |
|
234 * @param aLayout Layout data |
|
235 * @param aResource Resource of layout tree. |
|
236 * @param aDefaultDirection Default direction of the layout tree. |
|
237 */ |
|
238 static CEikStatusPaneLayoutTree* NewL(CEikStatusPaneLayout* aLayout, TResourceReader& aResource, TDirection aDefaultDirection = EHorizontal); |
|
239 |
|
240 /** |
|
241 * Finds the layout tree with a given pane id. |
|
242 * @param aPaneId A id of the pane. |
|
243 * @return If layout tree was found, a pointer to layout tree |
|
244 * with given id. Otherwise NULL is returned. |
|
245 */ |
|
246 CEikStatusPaneLayoutTree* Find(const TPaneId& aPaneId); |
|
247 |
|
248 /** |
|
249 * Calls given visitor objects VisitL, method. Additionally |
|
250 * calls AcceptL -method of each sub pane layouts inside this layout tree. |
|
251 * @param aVisitor A visitor object to be visited. |
|
252 */ |
|
253 void AcceptL(MEikStatusPaneLayoutTreeVisitor* aVisitor); |
|
254 |
|
255 /** |
|
256 * Gets pane id. |
|
257 * @return id of the pane. |
|
258 */ |
|
259 inline TPaneId Id() const; |
|
260 |
|
261 /** |
|
262 * Gets rectagle of the layout tree. |
|
263 * @return Rectangle of the layout tree. |
|
264 */ |
|
265 inline TRect Rect() const; |
|
266 |
|
267 /** |
|
268 * This method maps given layout resource id and subpane UID to correct |
|
269 * layout lines in the AknLayout system. |
|
270 * |
|
271 * @since 2.8 |
|
272 * @param aLayoutResourceId Id of a statuspane layout. |
|
273 * @param aPaneId Uid of a statuspane subpane. |
|
274 * @return A rectangle which specifies the given subpane size |
|
275 * and position in the given layout. |
|
276 * |
|
277 */ |
|
278 TRect AknLayoutRect(TInt aLayoutResourceId, TPaneId aPaneId); |
|
279 |
|
280 private: |
|
281 |
|
282 /** |
|
283 * Private constructor. |
|
284 * @param aLayout Layout data |
|
285 * @param aDefaultDirection Default direction of the layout tree. |
|
286 */ |
|
287 CEikStatusPaneLayoutTree(CEikStatusPaneLayout* aLayout, TDirection aDefaultDirection); |
|
288 |
|
289 /** |
|
290 * Private 2nd phase constructor. |
|
291 * @param aResource Resource of layout tree. |
|
292 */ |
|
293 void ConstructL(TResourceReader& aResource); |
|
294 |
|
295 /** |
|
296 * Sets rectagle of the layout tree. |
|
297 * @param aRect Rectangle of the layout tree. |
|
298 */ |
|
299 void SetRect(const TRect& aRect); |
|
300 |
|
301 /** |
|
302 * Gets direction of the layout tree. |
|
303 * @return Direction of the layout tree. |
|
304 */ |
|
305 inline TDirection Direction(); |
|
306 |
|
307 /** |
|
308 * Sets direction of the layout tree. |
|
309 * @param aDirection Direction of the layout tree. |
|
310 */ |
|
311 void SetDirection(TDirection aDirection); |
|
312 |
|
313 /** |
|
314 * Gets size of the layout tree. |
|
315 * @return size of the layout tree. |
|
316 */ |
|
317 inline TInt Size(); |
|
318 |
|
319 /** |
|
320 * Gets stretchable flag of the layout tree. |
|
321 * @return Stretchable flag of the layout tree. |
|
322 */ |
|
323 inline TBool Stretchable(); |
|
324 |
|
325 /** |
|
326 * Sets stretchable flag of the layout tree. |
|
327 * @param Stretchable flag of the layout tree. |
|
328 */ |
|
329 void SetStretchable(TBool aStretchable); |
|
330 |
|
331 /** |
|
332 * Sets the layout of the sub panes inside layout tree according to |
|
333 * layout tree attributes read from the resource structures. |
|
334 */ |
|
335 void Layout(); |
|
336 |
|
337 /** |
|
338 * This methods purpose is eqvivalent of the Layout() method, but the difference |
|
339 * is that this method uses AknLayout system instead of the statuspane |
|
340 * resource definitions for determining the positions and sizes of the subpanes. |
|
341 * |
|
342 * If AknLayoutUsed flag has not been set then this method defaults to the behaviour |
|
343 * of the Layout() -method. |
|
344 * |
|
345 * @since 2.8 |
|
346 * @param aLayoutResourceId Id of the statuspane layout which is to be laid out. |
|
347 * |
|
348 */ |
|
349 void Layout(TInt aLayoutResourceId); |
|
350 |
|
351 /** |
|
352 * This method sets flag which tells wheter AknLayout system is |
|
353 * used or not for layout. |
|
354 * |
|
355 * @since 2.8 |
|
356 * @param aAknLayoutUsed ETrue if AknLayout is to be used. EFalse otherwise. |
|
357 * |
|
358 */ |
|
359 void SetAknLayoutUsed(TBool aAknLayoutUsed); |
|
360 |
|
361 /** |
|
362 * This method gets flag which tells wheter AknLayout system is |
|
363 * used or not for layout. |
|
364 * |
|
365 * @since 2.8 |
|
366 * @return ETrue if AknLayout is to be used. EFalse otherwise. |
|
367 * |
|
368 */ |
|
369 TBool AknLayoutUsed(); |
|
370 |
|
371 private: |
|
372 TPaneId iId; |
|
373 TInt iFlags; |
|
374 TRect iRect; |
|
375 TInt iSize; |
|
376 |
|
377 typedef CArrayPtrFlat<CEikStatusPaneLayoutTree> CSubPaneArray; |
|
378 CSubPaneArray* iSubPanes; |
|
379 |
|
380 CEikStatusPaneLayout* iLayout; |
|
381 |
|
382 private: |
|
383 friend class CEikStatusPaneLayout; |
|
384 }; |
|
385 |
|
386 |
|
387 /** |
|
388 * |
|
389 * This class calculates and stores the screen area available |
|
390 * for each sub pane layout. |
|
391 * |
|
392 */ |
|
393 NONSHARABLE_CLASS(CEikStatusPaneLayout) : public CBase |
|
394 { |
|
395 public: |
|
396 /** |
|
397 * Two phase constructor. |
|
398 * @param aResource Resource of sub pane layout. |
|
399 * @param aScreenRect Screen rectangle. |
|
400 */ |
|
401 static CEikStatusPaneLayout* NewL(TResourceReader& aResource, const TRect& aScreenRect); |
|
402 |
|
403 /** |
|
404 * Two phase constructor. |
|
405 * @param aResource Resource of sub pane layout. |
|
406 * @param aScreenRect Screen rectangle. |
|
407 * @param aLayoutId Id of the status pane layout. |
|
408 */ |
|
409 static CEikStatusPaneLayout* NewL(TResourceReader& aResource, const TRect& aScreenRect, TInt aLayoutId); |
|
410 |
|
411 /** |
|
412 * Destructor |
|
413 */ |
|
414 ~CEikStatusPaneLayout(); |
|
415 |
|
416 /** |
|
417 * Finds the pane init with a given id. If a pane init |
|
418 * is not found NULL pointer is returned. |
|
419 * @return The layout tree instance with given id. |
|
420 */ |
|
421 inline CEikStatusPaneLayoutTree* Find(const TPaneId& aPaneId) const; |
|
422 |
|
423 /** |
|
424 * Calls given visitor objects VisitL, method. |
|
425 * @param aVisitor A visitor object to be visited. |
|
426 */ |
|
427 inline void AcceptL(MEikStatusPaneLayoutTreeVisitor* aVisitor); |
|
428 |
|
429 /** |
|
430 * Gets rectagle of the sub pane layout. |
|
431 * @return Rectangle of the sub pane layout. |
|
432 */ |
|
433 inline TRect Rect() const; |
|
434 |
|
435 /** |
|
436 * Re-reads layout data from AknLayout system. The data may have to be refreshed when e.g. |
|
437 * screen resolution, orientation or language variant layout is changed on the fly. |
|
438 * |
|
439 * @since 2.8 |
|
440 * @param aLayoutResourceId Id of the statuspane layout which data is to be refreshed. |
|
441 * |
|
442 */ |
|
443 void AknLayoutRefresh(TInt aLayoutResourceId); |
|
444 |
|
445 /** |
|
446 * This method tells if this layout is using AknLayout system for placing and sizing |
|
447 * the statuspane subpanes. |
|
448 * |
|
449 * @since 2.8 |
|
450 * @return ETrue if this layout has been initailized to use AknLayout. EFalse if the default |
|
451 * statuspane layout system is in use. |
|
452 * |
|
453 */ |
|
454 TBool AknLayoutUsed(); |
|
455 |
|
456 /** |
|
457 * This method maps given layout resource id and subpane UID to correct |
|
458 * layout lines in the AknLayout system. |
|
459 * |
|
460 * @since 3.1 |
|
461 * @param aLayoutResourceId Id of a statuspane layout. |
|
462 * @param aPaneId Uid of a statuspane subpane. |
|
463 * @return A rectangle which specifies the given subpane size |
|
464 * and position in the given layout. |
|
465 * |
|
466 */ |
|
467 TRect AknLayoutRect(TInt aLayoutResourceId, TPaneId aPaneId); |
|
468 |
|
469 private: |
|
470 |
|
471 /** |
|
472 * Constructor. |
|
473 */ |
|
474 CEikStatusPaneLayout(); |
|
475 |
|
476 /** |
|
477 * 2nd phase constructor. |
|
478 */ |
|
479 void ConstructL(TResourceReader& aResource, const TRect& aScreenRect, TInt aLayoutId); |
|
480 |
|
481 private: |
|
482 CEikStatusPaneLayoutTree* iRoot; |
|
483 |
|
484 private: |
|
485 |
|
486 /** |
|
487 * Updates layout data. |
|
488 * @param aLayoutResId Status pane layout resource id. |
|
489 */ |
|
490 void UpdateLayoutData(TInt aLayoutResId); |
|
491 |
|
492 private: // layout data for all nodes in CEikStatusPaneLayoutTree |
|
493 friend class CEikStatusPaneLayoutTree; |
|
494 const AknLayout::CInstance& iAknLayout; |
|
495 const AknLayoutScalable_Avkon::CInstance& iAknLayoutScalable_Avkon; |
|
496 TRect iScreenRect; |
|
497 TRect iMainPaneRect; |
|
498 TRect iUsualStatusPaneRect; |
|
499 TRect iApplicationWindowRect; |
|
500 TRect iStaconLayout1Rect; |
|
501 TRect iStaconLayout2Rect; |
|
502 TRect iSmallStatusPaneRect; |
|
503 }; |
|
504 |
|
505 |
|
506 /** |
|
507 * |
|
508 * Base class for status pane model. |
|
509 * |
|
510 */ |
|
511 class CEikStatusPaneModelBase : public CBase |
|
512 { |
|
513 public: |
|
514 |
|
515 /** |
|
516 * Destructor. |
|
517 */ |
|
518 IMPORT_C ~CEikStatusPaneModelBase(); |
|
519 |
|
520 /** |
|
521 * Gets the pane inits of the status pane. |
|
522 * @return Pane inits. |
|
523 */ |
|
524 inline CEikStatusPaneSetInit* PaneInits() const; |
|
525 |
|
526 /** |
|
527 * Sets the status pane layout |
|
528 * @param aLayoutResId Resource id of the status pane layout. |
|
529 * @param aChangeStatusPaneNow A flag to indicate immediate status pane layout change. |
|
530 */ |
|
531 IMPORT_C virtual void SetLayoutL(TInt aLayoutResId, TBool aChangeStatusPaneNow = ETrue); |
|
532 |
|
533 /** |
|
534 * Gets the current layout. |
|
535 * @return The current layout. |
|
536 */ |
|
537 inline CEikStatusPaneLayout* CurrentLayout() const; |
|
538 |
|
539 /** |
|
540 * Gets the current layout resource id. |
|
541 * @return The current layout resource id. |
|
542 */ |
|
543 IMPORT_C TInt CurrentLayoutResId() const; |
|
544 |
|
545 /** |
|
546 * Re-reads layout data for all existing layouts from AknLayout system. The data |
|
547 * may have to be refreshed when e.g. screen resolution, orientation or language |
|
548 * variant layout is changed on the fly. |
|
549 * |
|
550 * @since 2.8 |
|
551 * |
|
552 */ |
|
553 void AknLayoutRefresh(); |
|
554 |
|
555 /** |
|
556 * This method tells if given layout is using AknLayout system for placing and sizing |
|
557 * the statuspane subpanes. |
|
558 * |
|
559 * @since 2.8 |
|
560 * @param aLayoutId Layout which layout type is wanted to be known. |
|
561 * @return ETrue if given layout has been initailized to use AknLayout. EFalse if the default |
|
562 * statuspane layout system is in use. |
|
563 * |
|
564 */ |
|
565 TBool AknLayoutUsed(TInt aLayoutId); |
|
566 |
|
567 protected: |
|
568 |
|
569 /** |
|
570 * Internal class to CEikStatusPaneModel, |
|
571 * which ties layout resource IDs to layout structures. |
|
572 */ |
|
573 NONSHARABLE_CLASS(CIdLayoutPair) : public CBase |
|
574 { |
|
575 public: |
|
576 /** |
|
577 * Constructor. |
|
578 * @param aResId Resource id |
|
579 * @param aLayout Sub pane layout |
|
580 */ |
|
581 CIdLayoutPair(TInt aResId, CEikStatusPaneLayout* aLayout); |
|
582 /** |
|
583 * Destructor. |
|
584 */ |
|
585 ~CIdLayoutPair(); |
|
586 public: |
|
587 TInt iResId; |
|
588 CEikStatusPaneLayout* iLayout; |
|
589 }; |
|
590 typedef CArrayPtrFlat<CIdLayoutPair> CLayoutIdSet; |
|
591 typedef CArrayFixFlat<TInt> CIdSet; |
|
592 |
|
593 protected: |
|
594 |
|
595 /** |
|
596 * Constructor. |
|
597 * @param aEikEnv An environment for creating controls. |
|
598 */ |
|
599 IMPORT_C CEikStatusPaneModelBase(CEikonEnv& aEikEnv); |
|
600 |
|
601 /** |
|
602 * Base constructor for 2nd phase construction. |
|
603 * @param aCoreResId Status pane core resource id. |
|
604 */ |
|
605 IMPORT_C void BaseConstructL(TInt aCoreResId); |
|
606 |
|
607 /** |
|
608 * Loads given layout from resource. |
|
609 * @param aLayoutResId Layout resource id. |
|
610 */ |
|
611 IMPORT_C CEikStatusPaneLayout* LoadLayoutL(TInt aLayoutResId); |
|
612 |
|
613 /** |
|
614 * Returns set of legal layout ids. |
|
615 * @return Set of allowed status pane layout ids. |
|
616 */ |
|
617 inline CIdSet* LegalIds() const; |
|
618 |
|
619 /** |
|
620 * Checks if given layout id is allowed. |
|
621 * @param aLayoutResId Layout id to be checked. |
|
622 * @return ETrue if given layout id is allowed. |
|
623 */ |
|
624 TBool IsLegalId(TInt aLayoutResId) const; |
|
625 |
|
626 private: |
|
627 /** |
|
628 * Gets given layout. |
|
629 * @param aLayoutResId Layout resource id. |
|
630 */ |
|
631 CEikStatusPaneLayout* Layout(TInt aLayoutResId); |
|
632 |
|
633 /** |
|
634 * Checks given layout. |
|
635 * @param aLayout Layout to be checked. |
|
636 */ |
|
637 void CheckLayoutL(CEikStatusPaneLayout* aLayout); |
|
638 |
|
639 private: |
|
640 IMPORT_C virtual void Reserved_1(); |
|
641 |
|
642 private: |
|
643 NONSHARABLE_CLASS(TLayoutChecker) : public MEikStatusPaneLayoutTreeVisitor |
|
644 { |
|
645 public: |
|
646 TLayoutChecker(CEikStatusPaneSetInit* aPanes); |
|
647 void VisitL(CEikStatusPaneLayoutTree* aNode); |
|
648 private: |
|
649 CEikStatusPaneSetInit* iPanes; |
|
650 }; |
|
651 |
|
652 protected: |
|
653 CLayoutIdSet* iLayouts; |
|
654 TInt iCurrentResId; |
|
655 CEikonEnv& iEikEnv; |
|
656 |
|
657 private: |
|
658 CEikStatusPaneSetInit* iPanes; |
|
659 CEikStatusPaneLayout* iCurrentLayout; |
|
660 CIdSet* iLegalIds; |
|
661 }; |
|
662 |
|
663 |
|
664 /** |
|
665 * |
|
666 * Status pane model for application status pane. |
|
667 * |
|
668 */ |
|
669 NONSHARABLE_CLASS(CEikAppStatusPaneModel) : public CEikStatusPaneModelBase |
|
670 { |
|
671 public: |
|
672 /** |
|
673 * Two phase constructor. |
|
674 * |
|
675 * @param aEikEnv An environment for creating controls. |
|
676 * @param aCoreResId Status pane core resource id |
|
677 * @param aAppResId Application status pane resource id |
|
678 * @param aChangeStatusPaneNow A flag to indicate immediate status pane layout change. |
|
679 * @return Constructed instance. |
|
680 */ |
|
681 static CEikAppStatusPaneModel* NewL(CEikonEnv& aEikEnv, /*REikSrvSession,*/ TInt aCoreResId, TInt aAppResId = EEikStatusPaneUseDefaults, TBool aChangeStatusPaneNow = ETrue); |
|
682 |
|
683 /** |
|
684 * Destructor. |
|
685 */ |
|
686 ~CEikAppStatusPaneModel(); |
|
687 |
|
688 /** |
|
689 * Takes current layout into use. |
|
690 */ |
|
691 void ApplyCurrentLayoutL(); |
|
692 |
|
693 public: |
|
694 /** |
|
695 * from CEikStatusPaneModelBase |
|
696 */ |
|
697 void SetLayoutL(TInt aLayoutResId, TBool aChangeStatusPaneNow = ETrue); |
|
698 public: |
|
699 /** |
|
700 * from CEikStatusPaneModelBase |
|
701 */ |
|
702 void SetLayoutL(TInt aLayoutResId, TBool aChangeStatusPaneNow, TBool aNotfiyServerSide); |
|
703 |
|
704 private: |
|
705 CEikAppStatusPaneModel(CEikonEnv& aEikEnv); |
|
706 void ConstructL(TInt aCoreResId, TInt aAppResId, TBool aChangeStatusPaneNow = ETrue); |
|
707 }; |
|
708 |
|
709 |
|
710 inline TPaneId TEikStatusPaneInit::Id() const { return iId; } |
|
711 inline TBool TEikStatusPaneInit::AppOwned() const { return iFlags & EEikStatusPaneAppOwned; } |
|
712 inline TInt TEikStatusPaneInit::ControlTypeId() const { return iControlId; } |
|
713 inline TInt TEikStatusPaneInit::ControlResourceId() const { return iControlResource; } |
|
714 inline void TEikStatusPaneInit::SetHidden() {iFlags|=KEikStatusPaneHiddenBit;} |
|
715 inline void TEikStatusPaneInit::ClearHidden() {iFlags&=~KEikStatusPaneHiddenBit;} |
|
716 inline TBool TEikStatusPaneInit::IsHidden() const {return iFlags&KEikStatusPaneHiddenBit;} |
|
717 |
|
718 inline CEikStatusPaneLayoutTree* CEikStatusPaneLayout::Find(const TPaneId& aPaneId) const { return iRoot->Find(aPaneId); } |
|
719 inline void CEikStatusPaneLayout::AcceptL(MEikStatusPaneLayoutTreeVisitor* aVisitor) { iRoot->AcceptL(aVisitor); } |
|
720 inline TRect CEikStatusPaneLayout::Rect() const { return iRoot->Rect(); } |
|
721 |
|
722 inline TPaneId CEikStatusPaneLayoutTree::Id() const { return iId; } |
|
723 inline TRect CEikStatusPaneLayoutTree::Rect() const { return iRect; } |
|
724 |
|
725 |
|
726 inline CEikStatusPaneSetInit* CEikStatusPaneModelBase::PaneInits() const { return iPanes; } |
|
727 inline CEikStatusPaneLayout* CEikStatusPaneModelBase::CurrentLayout() const { return iCurrentLayout; } |
|
728 inline CEikStatusPaneModelBase::CIdSet* CEikStatusPaneModelBase::LegalIds() const { return iLegalIds; } |
|
729 |
|
730 #endif |