83
|
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 |
* Returns the active view
|
|
143 |
*
|
|
144 |
* @since Series 60 3.1
|
|
145 |
* @return The active view node
|
|
146 |
*/
|
|
147 |
IMPORT_C CXnNodeAppIf* ActiveView();
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Checks whether the menu is displaying.
|
|
151 |
*
|
|
152 |
* @since Series 60 3.2
|
|
153 |
* @return ETrue if menu is displaying.
|
|
154 |
*/
|
|
155 |
IMPORT_C TBool IsMenuDisplaying();
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Populate given array with plugin nodes.
|
|
159 |
*
|
|
160 |
* @since Series 60 5.0
|
|
161 |
* @param aArray Array to populate
|
|
162 |
* @return Number of added plugin nodes
|
|
163 |
*/
|
|
164 |
IMPORT_C TInt GetPluginNodeArrayL(
|
|
165 |
RPointerArray< CXnNodeAppIf >& aArray );
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Gets the currently focused node
|
|
169 |
*
|
|
170 |
* @since Series 60 5.0
|
|
171 |
* @return Pointer to focused node, NULL if no focus
|
|
172 |
*/
|
|
173 |
IMPORT_C CXnNodeAppIf* FocusedNode();
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Checks if the UI is in Edit mode.
|
|
177 |
*
|
|
178 |
* @since Series 60 5.0
|
|
179 |
* @return ETrue if the current mode is edit, otherwise EFalse.
|
|
180 |
*/
|
|
181 |
IMPORT_C TBool IsEditMode();
|
|
182 |
|
|
183 |
/**
|
|
184 |
* Changes internal ui engine pointer
|
|
185 |
*
|
|
186 |
* @since Series 60 5.0
|
|
187 |
*/
|
|
188 |
IMPORT_C void SetUiEngine( CXnUiEngine* aUiEngine );
|
|
189 |
|
|
190 |
/**
|
|
191 |
* Gets theme resource file
|
|
192 |
*
|
|
193 |
* @since S60 5.1
|
|
194 |
* @param aPath path from which file is found
|
|
195 |
* @param aFile file to which resource is set
|
|
196 |
* @return errorcode
|
|
197 |
*/
|
|
198 |
IMPORT_C TInt GetThemeResource( const TDesC& aPath, RFile& aFile );
|
|
199 |
|
|
200 |
/**
|
|
201 |
* Gets widgets visibilty state
|
|
202 |
*
|
|
203 |
* @since Series 60 5.0
|
|
204 |
* @return ETrue if widgets visible, EFalse otherwise
|
|
205 |
*/
|
|
206 |
IMPORT_C TBool WidgetsVisible() const;
|
|
207 |
|
|
208 |
private:
|
|
209 |
// Data
|
|
210 |
|
|
211 |
/**
|
|
212 |
* The layout calculation and ui rendering implementation.
|
|
213 |
* Not own.
|
|
214 |
*/
|
|
215 |
CXnUiEngine* iUiEngine;
|
|
216 |
};
|
|
217 |
|
|
218 |
#endif
|