|
1 /* |
|
2 * Copyright (c) 2004-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: Master layout. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNSRLMASTERLAYOUT_H |
|
20 #define AKNSRLMASTERLAYOUT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <AknsItemID.h> |
|
25 #include <CdlEngine.h> |
|
26 #include <CdlTypes.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 namespace AknLayoutScalable_Avkon { class CInstance; } |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Master layout retrieval utility. |
|
35 * |
|
36 * Maps skin item IDs to layout data. CDL instance must be created and active |
|
37 * when this class is used. |
|
38 * |
|
39 * @since 2.8 |
|
40 */ |
|
41 NONSHARABLE_CLASS(CAknsRlMasterLayout) : public CBase, public MCdlChangeObserver |
|
42 { |
|
43 private: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Default constructor is private. |
|
47 * |
|
48 * @since 2.8 |
|
49 */ |
|
50 CAknsRlMasterLayout(); |
|
51 |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Static creator. |
|
56 * |
|
57 * @since 2.8 |
|
58 */ |
|
59 IMPORT_C static CAknsRlMasterLayout* NewL(); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * |
|
64 * @since 2.8 |
|
65 */ |
|
66 void ConstructL(); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 * |
|
71 * @since 2.8 |
|
72 */ |
|
73 virtual ~CAknsRlMasterLayout(); |
|
74 |
|
75 public: // New methods |
|
76 |
|
77 /** |
|
78 * Gets the parent of the given item. |
|
79 * |
|
80 * @param aIID Item ID. |
|
81 * |
|
82 * @return Item ID of the parent. |
|
83 * @c KAknsIIDDefault is returned, if the parent varies or is |
|
84 * unknown. |
|
85 * @c KAknsIIDNone is returned, if the item is known to have no |
|
86 * parent at all. |
|
87 * |
|
88 * @since 2.8 |
|
89 */ |
|
90 IMPORT_C TAknsItemID GetParent( const TAknsItemID& aIID ); |
|
91 |
|
92 /** |
|
93 * Retrieves the layout (in the currently active AknLayout) for the |
|
94 * given skin item. |
|
95 * |
|
96 * @param aIID Item ID. |
|
97 * |
|
98 * @param aParentRect Parent rectangle. |
|
99 * |
|
100 * @param aRect If layout is found, the location (in parent |
|
101 * coordinates) and size of the item are assigned to this rectangle. |
|
102 * |
|
103 * @return @c ETrue if the layout was found, @c EFalse otherwise. |
|
104 * |
|
105 * @since 2.8 |
|
106 */ |
|
107 IMPORT_C TBool GetItemLayout( const TAknsItemID& aIID, |
|
108 const TRect& aParentRect, TRect& aRect ); |
|
109 |
|
110 /** |
|
111 * Retrieves the current layout type. |
|
112 * |
|
113 * @return The type of the currently active layout. |
|
114 * |
|
115 * @since 2.8 |
|
116 */ |
|
117 IMPORT_C TInt CurrentLayoutType(); |
|
118 |
|
119 /** |
|
120 * Retrieves the current layout size |
|
121 * |
|
122 * @return the size of the currently active layout |
|
123 * |
|
124 * @since 3.0 |
|
125 */ |
|
126 IMPORT_C TSize CurrentLayoutSize(); |
|
127 |
|
128 private: // from MCdlChangeObserver |
|
129 void HandleCustomisationChangeL(const CCdlUids& /*aUids*/); |
|
130 void UpdateCachedLayoutData(); |
|
131 |
|
132 private: // Data |
|
133 TInt iGridMode; |
|
134 const AknLayoutScalable_Avkon::CInstance& iAknLayoutScalable_Avkon; |
|
135 TRect iScreenRect; |
|
136 TInt iLayoutId; |
|
137 }; |
|
138 |
|
139 #endif // AKNSRLMASTERLAYOUT_H |
|
140 |
|
141 // End of File |