|
1 /* |
|
2 * Copyright (c) 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: Composer header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __XNCOMPOSER_H__ |
|
20 #define __XNCOMPOSER_H__ |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 // User includes |
|
27 #include "hspswrapper.h" |
|
28 #include "hspssapi.h" |
|
29 |
|
30 // Forward declarations |
|
31 class CXnODT; |
|
32 class CXnDomNode; |
|
33 class CXnViewManager; |
|
34 class CXnRootData; |
|
35 class CXnViewData; |
|
36 class CXnPluginData; |
|
37 |
|
38 using namespace hspswrapper; |
|
39 |
|
40 /** |
|
41 * This class loads views and plugins defined in HSPS, to the DOM tree. |
|
42 * The feature of this class is to load views',and plugin's data from |
|
43 * storage. |
|
44 * |
|
45 * The class supports multiple views. It is mandatory to call one of methods, |
|
46 * described below when a plugin/view is added to the Homscreen, |
|
47 * or the Homescreen is being constructed. |
|
48 * |
|
49 * As the first ComposeInitialViewL function should be run. |
|
50 * It loads the first view and its plugins(via ComposeViewL and |
|
51 * ComposePluginL). ComposeViewL should be called when a view, and its |
|
52 * plugins, is composed. ComposePluginL should be called always when a plugin |
|
53 * is added to the view. |
|
54 * |
|
55 * @ingroup group_xnlayoutengine |
|
56 * Composer Implementation |
|
57 * @lib xn3layoutengine.lib |
|
58 * @since Series 60 5.0 |
|
59 */ |
|
60 NONSHARABLE_CLASS( CXnComposer ) : public CBase |
|
61 { |
|
62 public: |
|
63 // Constructors and destructor |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 * |
|
68 * @param aUiEngineImpl Provides plugin resources store |
|
69 * @return Property list object. |
|
70 */ |
|
71 static CXnComposer* NewL( CHspsWrapper& aWrapper ); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 ~CXnComposer(); |
|
77 |
|
78 protected: |
|
79 |
|
80 /** |
|
81 * C++ default constructor. |
|
82 */ |
|
83 CXnComposer( CHspsWrapper& aWrapper ); |
|
84 |
|
85 /** |
|
86 * Two-phased constructor. |
|
87 * |
|
88 * @param aComparator Propety comparator. |
|
89 */ |
|
90 void ConstructL(); |
|
91 |
|
92 public: |
|
93 // new functions |
|
94 |
|
95 /** |
|
96 * Composes application root configuration. |
|
97 * |
|
98 * @param aRootData Application root data. |
|
99 * @return ODT tree, ownership is granted to caller. NULL if failed. |
|
100 */ |
|
101 CXnODT* ComposeRootL( CXnRootData& aRootData ); |
|
102 |
|
103 /** |
|
104 * Composes a view. |
|
105 * |
|
106 * @param aViewData View data for the composed view. |
|
107 * @return KErrNone if succesful, error otherwise |
|
108 */ |
|
109 TInt ComposeViewL( CXnViewData& aViewData ); |
|
110 |
|
111 /** |
|
112 * Composes a widget. |
|
113 * |
|
114 * @param aPluginData Plugin data for the composed widget. |
|
115 * @return KErrNone if succesful, error otherwise |
|
116 */ |
|
117 TInt ComposeWidgetL( CXnPluginData& aPluginData ); |
|
118 |
|
119 private: |
|
120 // new functions |
|
121 |
|
122 CXnDomNode* GetOdtL( const CObjectMap& aObject, |
|
123 CXnPluginData& aPluginData ); |
|
124 |
|
125 /** |
|
126 * Finds an object from the provided array. |
|
127 * |
|
128 * @param aResourceObjects An array of objects. |
|
129 * @param aTag A tag of an object to be found. |
|
130 * @return Object instance if succesful, NULL otherwise |
|
131 */ |
|
132 const CObjectMap* FindObject( |
|
133 RPointerArray<CObjectMap>& aResourceObjects, |
|
134 const TDesC8& aTag ) const; |
|
135 |
|
136 private: |
|
137 // Data |
|
138 |
|
139 /** |
|
140 * HSPS Wrapper, not owned |
|
141 */ |
|
142 CHspsWrapper& iWrapper; |
|
143 |
|
144 /* |
|
145 * ODT, not owned |
|
146 */ |
|
147 CXnODT* iODT; |
|
148 |
|
149 /** |
|
150 * Handle to file server session, owned |
|
151 */ |
|
152 RFs iFs; |
|
153 }; |
|
154 |
|
155 #endif // __XNCOMPOSER_H__ |