|
1 /* |
|
2 * Copyright (c) 2002-2004 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 * Layout calculation and UI rendering mechanism. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef XNUIENGINEAPPIF_H |
|
20 #define XNUIENGINEAPPIF_H |
|
21 |
|
22 // System inlcudes |
|
23 #include <e32base.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CXnUiEngine; |
|
27 class CXnNodeAppIf; |
|
28 class CXnDomStringPool; |
|
29 class RFile; |
|
30 |
|
31 // Class declaration |
|
32 /** |
|
33 * Layout engine. |
|
34 * |
|
35 * @ingroup group_xnlayoutengine |
|
36 * @lib xn3layoutengine.lib |
|
37 * @since Series 60 3.1 |
|
38 */ |
|
39 class TXnUiEngineAppIf |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * C++ default constructor. |
|
44 */ |
|
45 TXnUiEngineAppIf( CXnUiEngine& aUiEngine ); |
|
46 |
|
47 public: |
|
48 // New functions |
|
49 |
|
50 /** |
|
51 * Calculates the layout of the UI |
|
52 * |
|
53 * @since Series 60 3.1 |
|
54 * @param aNode Starting point for the layout |
|
55 * @exception KXnErrLoadLayoutFileFailed Loading the layout file failed. |
|
56 */ |
|
57 IMPORT_C void RenderUIL( CXnNodeAppIf* aNode = NULL ); |
|
58 |
|
59 /** |
|
60 * Gets the root node of the UI. Ownership is not transferred. |
|
61 * |
|
62 * @since Series 60 3.1 |
|
63 * @return Node |
|
64 */ |
|
65 IMPORT_C CXnNodeAppIf& RootNodeL(); |
|
66 |
|
67 /** |
|
68 * Find a node by its id. Ownership is not transferred. |
|
69 * |
|
70 * @since Series 60 3.1 |
|
71 * @param aNodeId Area id |
|
72 * @param aNamespace Namespace |
|
73 * @return Node with the given id |
|
74 */ |
|
75 IMPORT_C CXnNodeAppIf* FindNodeByIdL( |
|
76 const TDesC& aNodeId, |
|
77 const TDesC& aNamespace = KNullDesC ); |
|
78 |
|
79 /** |
|
80 * Find a node by its id. Ownership is not transferred. |
|
81 * |
|
82 * @since Series 60 3.1 |
|
83 * @param aNodeId Area id |
|
84 * @param aNamespace Namespace |
|
85 * @return Node with the given id |
|
86 */ |
|
87 IMPORT_C CXnNodeAppIf* FindNodeByIdL( |
|
88 const TDesC8& aNodeId, |
|
89 const TDesC8& aNamespace = KNullDesC8 ); |
|
90 |
|
91 /** |
|
92 * Find nodes by class. Ownership of the array is transferred, ownership of |
|
93 * the nodes is not transferred. |
|
94 * |
|
95 * @since Series 60 3.1 |
|
96 * @param aClassId Class id |
|
97 * @return Nodes belonging to the class |
|
98 */ |
|
99 IMPORT_C RPointerArray< CXnNodeAppIf > FindNodeByClassL( |
|
100 const TDesC& aClassId, |
|
101 const TDesC& aNamespace = KNullDesC ); |
|
102 |
|
103 /** |
|
104 * Find nodes by class. Ownership of the array is transferred, ownership of |
|
105 * the nodes is not transferred. |
|
106 * |
|
107 * @since Series 60 3.1 |
|
108 * @param aClassId Class id |
|
109 * @return Nodes belonging to the class |
|
110 */ |
|
111 IMPORT_C RPointerArray< CXnNodeAppIf > FindNodeByClassL( |
|
112 const TDesC8& aClassId, |
|
113 const TDesC8& aNamespace = KNullDesC8 ); |
|
114 |
|
115 /** |
|
116 * Find content source nodes. Ownership of the array is transferred, |
|
117 * ownership of the nodes is not transferred. |
|
118 * |
|
119 * @since S60 5.0 |
|
120 * @param aNamespace namespace where to find content source nodes |
|
121 * @return Content source nodes from the namespace |
|
122 */ |
|
123 IMPORT_C RPointerArray< CXnNodeAppIf > FindContentSourceNodesL( |
|
124 const TDesC8& aNamespace ); |
|
125 |
|
126 /** |
|
127 * Get the string pool |
|
128 * |
|
129 * @since Series 60 3.1 |
|
130 * @return String pool |
|
131 */ |
|
132 IMPORT_C CXnDomStringPool& StringPool(); |
|
133 |
|
134 /** |
|
135 * Refresh current menu |
|
136 * |
|
137 * @since Series 60 3.1 |
|
138 */ |
|
139 IMPORT_C void RefreshMenuL(); |
|
140 |
|
141 /** |
|
142 * Activate a view |
|
143 * |
|
144 * @since Series 60 3.1 |
|
145 * @param aViewNode View node |
|
146 */ |
|
147 IMPORT_C void ActivateViewL( CXnNodeAppIf& aViewNode ); |
|
148 |
|
149 /** |
|
150 * Returns the active view |
|
151 * |
|
152 * @since Series 60 3.1 |
|
153 * @return The active view node |
|
154 */ |
|
155 IMPORT_C CXnNodeAppIf* ActiveView(); |
|
156 |
|
157 /** |
|
158 * Checks whether the menu is displaying. |
|
159 * |
|
160 * @since Series 60 3.2 |
|
161 * @return ETrue if menu is displaying. |
|
162 */ |
|
163 IMPORT_C TBool IsMenuDisplaying(); |
|
164 |
|
165 /** |
|
166 * Populate given array with plugin nodes. |
|
167 * |
|
168 * @since Series 60 5.0 |
|
169 * @param aArray Array to populate |
|
170 * @return Number of added plugin nodes |
|
171 */ |
|
172 IMPORT_C TInt GetPluginNodeArrayL( |
|
173 RPointerArray< CXnNodeAppIf >& aArray ); |
|
174 |
|
175 /** |
|
176 * Gets the currently focused node |
|
177 * |
|
178 * @since Series 60 5.0 |
|
179 * @return Pointer to focused node, NULL if no focus |
|
180 */ |
|
181 IMPORT_C CXnNodeAppIf* FocusedNode(); |
|
182 |
|
183 /** |
|
184 * Checks if the UI is in Edit mode. |
|
185 * |
|
186 * @since Series 60 5.0 |
|
187 * @return ETrue if the current mode is edit, otherwise EFalse. |
|
188 */ |
|
189 IMPORT_C TBool IsEditMode(); |
|
190 |
|
191 /** |
|
192 * Changes internal ui engine pointer |
|
193 * |
|
194 * @since Series 60 5.0 |
|
195 */ |
|
196 IMPORT_C void SetUiEngine( CXnUiEngine* aUiEngine ); |
|
197 |
|
198 /** |
|
199 * Gets theme resource file |
|
200 * |
|
201 * @since S60 5.1 |
|
202 * @param aPath path from which file is found |
|
203 * @param aFile file to which resource is set |
|
204 * @return errorcode |
|
205 */ |
|
206 IMPORT_C TInt GetThemeResource( const TDesC& aPath, RFile& aFile ); |
|
207 |
|
208 /** |
|
209 * Gets widgets visibilty state |
|
210 * |
|
211 * @since Series 60 5.0 |
|
212 * @return ETrue if widgets visible, EFalse otherwise |
|
213 */ |
|
214 IMPORT_C TBool WidgetsVisible() const; |
|
215 |
|
216 private: |
|
217 // Data |
|
218 |
|
219 /** |
|
220 * The layout calculation and ui rendering implementation. |
|
221 * Not own. |
|
222 */ |
|
223 CXnUiEngine* iUiEngine; |
|
224 }; |
|
225 |
|
226 #endif |