34
|
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 |
* Application interface to node of layout tree
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef XNNODEAPPIF_H
|
|
20 |
#define XNNODEAPPIF_H
|
|
21 |
|
|
22 |
// System includes
|
|
23 |
#include <coedef.h>
|
|
24 |
#include <e32base.h>
|
|
25 |
#include <w32std.h>
|
|
26 |
#include <coecobs.h>
|
|
27 |
|
|
28 |
// Forward declarations
|
|
29 |
class CXnType;
|
|
30 |
class CXnProperty;
|
|
31 |
class CXnNode;
|
|
32 |
class TXnUiEngineAppIf;
|
|
33 |
class CXnComponent;
|
|
34 |
|
|
35 |
namespace XnComponentInterface
|
|
36 |
{
|
|
37 |
class MXnComponentInterface;
|
|
38 |
}
|
|
39 |
|
|
40 |
// Class declaration
|
|
41 |
/**
|
|
42 |
* Application interface to node of layout tree
|
|
43 |
*
|
|
44 |
* @ingroup group_xnlayoutengine
|
|
45 |
* @lib xn3layoutengine.lib
|
|
46 |
* @since Series 60 3.1
|
|
47 |
*/
|
|
48 |
class CXnNodeAppIf : public CBase
|
|
49 |
{
|
|
50 |
public:
|
|
51 |
/**
|
|
52 |
* C++ default constructor.
|
|
53 |
*/
|
|
54 |
CXnNodeAppIf( CXnNode& aNode );
|
|
55 |
|
|
56 |
public:
|
|
57 |
// New functions
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Get the UI engine
|
|
61 |
*
|
|
62 |
* @since Series 60 3.1
|
|
63 |
* @return UI engine
|
|
64 |
*/
|
|
65 |
IMPORT_C TXnUiEngineAppIf* UiEngineL();
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Set the node's characted data
|
|
69 |
*
|
|
70 |
* @since Series 60 3.1
|
|
71 |
* @param aData Character data
|
|
72 |
*/
|
|
73 |
IMPORT_C void SetPCDataL( const TDesC8& aData );
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Get the node's characted data
|
|
77 |
*
|
|
78 |
* @since Series 60 3.1
|
|
79 |
* @return Character data
|
|
80 |
*/
|
|
81 |
IMPORT_C const TDesC8& GetPCData() const;
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Set a property.
|
|
85 |
*
|
|
86 |
* The list will assume ownership of the property.
|
|
87 |
* If an equal property is already in the list, it will be
|
|
88 |
* replaced with the new property and the old property will be destroyed.
|
|
89 |
* @since Series 60 3.1
|
|
90 |
* @param aProperty Property to set.
|
|
91 |
*/
|
|
92 |
IMPORT_C void SetPropertyL( CXnProperty* aProperty );
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Set an array of properties.
|
|
96 |
*
|
|
97 |
* Improves the performance when many properties need to be
|
|
98 |
* set e.g. in construction phase.
|
|
99 |
* The list will assume ownership of the property.
|
|
100 |
* If an equal property is already in the list, it will be
|
|
101 |
* replaced with the new property and the old property will be destroyed.
|
|
102 |
* @since Series 60 3.1
|
|
103 |
* @param aPropertyArray Properties to set.
|
|
104 |
*/
|
|
105 |
IMPORT_C void SetPropertyArrayL(
|
|
106 |
RPointerArray< CXnProperty >* aPropertyArray );
|
|
107 |
|
|
108 |
/**
|
|
109 |
* Gets a property.
|
|
110 |
*
|
|
111 |
* The list will retain ownership of the property,
|
|
112 |
* the caller must not destroy the property. The returned pointer will
|
|
113 |
* become invalid if the property is replaced in the list by a subsequent
|
|
114 |
* SetL().
|
|
115 |
* @since Series 60 3.1
|
|
116 |
* @param aProperty Property key
|
|
117 |
* @return The property mapped to the key or NULL if not found.
|
|
118 |
*/
|
|
119 |
IMPORT_C CXnProperty* GetPropertyL( CXnProperty& aProperty ) const;
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Gets a property.
|
|
123 |
*
|
|
124 |
* The list will retain ownership of the property,
|
|
125 |
* the caller must not destroy the property. The returned pointer will
|
|
126 |
* become invalid if the property is replaced in the list by a subsequent
|
|
127 |
* SetL().
|
|
128 |
* @since Series 60 3.1
|
|
129 |
* @param aKey Name of the property
|
|
130 |
* @return The property mapped to the key or NULL if not found.
|
|
131 |
*/
|
|
132 |
IMPORT_C CXnProperty* GetPropertyL( const TDesC8& aKey ) const;
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Set a state
|
|
136 |
*
|
|
137 |
* @since Series 60 3.1
|
|
138 |
* @param aState State to set.
|
|
139 |
*/
|
|
140 |
IMPORT_C void SetStateL( const TDesC8& aState );
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Check whether a state is set
|
|
144 |
*
|
|
145 |
* @since Series 60 3.1
|
|
146 |
* @return ETrue if set, EFalse if not
|
|
147 |
*/
|
|
148 |
IMPORT_C TBool IsStateSet( const TDesC8& aState );
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Unset a state
|
|
152 |
*
|
|
153 |
* @since Series 60 3.1
|
|
154 |
* @param aState State to unset.
|
|
155 |
*/
|
|
156 |
IMPORT_C void UnsetStateL( const TDesC8& aState );
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Get node type
|
|
160 |
*
|
|
161 |
* @since Series 60 3.1
|
|
162 |
* @return Node type
|
|
163 |
*/
|
|
164 |
IMPORT_C CXnType* Type();
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Get node's content rect
|
|
168 |
*
|
|
169 |
* @since Series 60 3.1
|
|
170 |
* @return Content rect
|
|
171 |
*/
|
|
172 |
IMPORT_C TRect Rect();
|
|
173 |
|
|
174 |
/**
|
|
175 |
* Get node's border rect
|
|
176 |
*
|
|
177 |
* @since Series 60 3.1
|
|
178 |
* @return Border rect
|
|
179 |
*/
|
|
180 |
IMPORT_C TRect BorderRect();
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Get node's margin rect
|
|
184 |
*
|
|
185 |
* @since Series 60 3.1
|
|
186 |
* @return Margin rect
|
|
187 |
*/
|
|
188 |
IMPORT_C TRect MarginRect();
|
|
189 |
|
|
190 |
/**
|
|
191 |
* Get node's padding rect
|
|
192 |
*
|
|
193 |
* @since Series 60 3.1
|
|
194 |
* @return Padding rect
|
|
195 |
*/
|
|
196 |
IMPORT_C TRect PaddingRect();
|
|
197 |
|
|
198 |
/**
|
|
199 |
* Get the internal node
|
|
200 |
* @since Series 60 3.1
|
|
201 |
* @return Internal node
|
|
202 |
*/
|
|
203 |
CXnNode& Node();
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Create a component interface according to the given type.
|
|
207 |
*
|
|
208 |
* @param aType Type of the interface to create
|
|
209 |
* @return Created interface or NULL if the provided type is not supported.
|
|
210 |
*/
|
|
211 |
IMPORT_C XnComponentInterface::MXnComponentInterface* MakeInterfaceL(
|
|
212 |
const TDesC8& aType );
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Get the child nodes
|
|
216 |
*
|
|
217 |
* @since Series 60 3.1
|
|
218 |
* @return Child nodes
|
|
219 |
*/
|
|
220 |
IMPORT_C RPointerArray< CXnNodeAppIf > ChildrenL();
|
|
221 |
|
|
222 |
/**
|
|
223 |
* Get the parent node
|
|
224 |
*
|
|
225 |
* @since Series 60 3.1
|
|
226 |
* @return parent node
|
|
227 |
*/
|
|
228 |
IMPORT_C CXnNodeAppIf* ParentL() const;
|
|
229 |
|
|
230 |
/**
|
|
231 |
* Get internal dom node type
|
|
232 |
*
|
|
233 |
* @return Reference to node type
|
|
234 |
*/
|
|
235 |
IMPORT_C const TDesC8& InternalDomNodeType() const;
|
|
236 |
|
|
237 |
/**
|
|
238 |
* Shows all tooltip nodes associated to this node
|
|
239 |
*/
|
|
240 |
IMPORT_C void ShowTooltipsL();
|
|
241 |
|
|
242 |
/**
|
|
243 |
* Hides all tooltip nodes associated to this node
|
|
244 |
*/
|
|
245 |
IMPORT_C void HideTooltipsL();
|
|
246 |
|
|
247 |
/**
|
|
248 |
* Get namespace of this node
|
|
249 |
*/
|
|
250 |
IMPORT_C const TDesC8& Namespace();
|
|
251 |
|
|
252 |
/**
|
|
253 |
* Get the component object of the node.
|
|
254 |
*
|
|
255 |
* @since Series 60 5.2
|
|
256 |
* @return component object
|
|
257 |
*/
|
|
258 |
IMPORT_C CXnComponent& Component();
|
|
259 |
|
|
260 |
private:
|
|
261 |
// Data
|
|
262 |
|
|
263 |
/**
|
|
264 |
* Pointer to internal node object.
|
|
265 |
* Not own.
|
|
266 |
*/
|
|
267 |
CXnNode* iNode;
|
|
268 |
};
|
|
269 |
|
|
270 |
#endif
|