34
|
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: Data class to hold application configuration info
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef _XNROOTDATA_H
|
|
20 |
#define _XNROOTDATA_H
|
|
21 |
|
|
22 |
// System includes
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <babitflags.h>
|
|
25 |
|
|
26 |
// User includes
|
|
27 |
#include "xnplugindata.h"
|
|
28 |
|
|
29 |
// Forward declarations
|
|
30 |
class CXnViewManager;
|
|
31 |
class CXnViewData;
|
|
32 |
class CXnEcomHandler;
|
|
33 |
class CXnODTParser;
|
|
34 |
class CXnODT;
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Holds root data in UiEngine
|
|
38 |
*
|
|
39 |
* @ingroup group_xnlayoutengine
|
|
40 |
* @lib xn3layoutengine.lib
|
|
41 |
* @since S60 5.0
|
|
42 |
*/
|
|
43 |
NONSHARABLE_CLASS( CXnRootData ) : public CXnPluginData
|
|
44 |
{
|
|
45 |
public:
|
|
46 |
// Constructors and destructor
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Two-phased constructor.
|
|
50 |
*/
|
|
51 |
static CXnRootData* NewL( CXnViewManager& aManager, TUid aApplicationUid );
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Two-phased constructor. Leaving on stack
|
|
55 |
*/
|
|
56 |
static CXnRootData* NewLC( CXnViewManager& aManager, TUid aApplicationUid );
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Destructor
|
|
60 |
*/
|
|
61 |
~CXnRootData();
|
|
62 |
|
|
63 |
protected:
|
|
64 |
/**
|
|
65 |
* C++ constructor
|
|
66 |
*/
|
|
67 |
CXnRootData( CXnViewManager& aManager, TUid aApplicationUid );
|
|
68 |
|
|
69 |
private:
|
|
70 |
// private constructors
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Leaving constructor
|
|
74 |
*/
|
|
75 |
void ConstructL();
|
|
76 |
|
|
77 |
public:
|
|
78 |
// From CXnPluginData
|
|
79 |
|
|
80 |
/**
|
|
81 |
* @see CXnPluginData
|
|
82 |
*/
|
|
83 |
TInt Load();
|
|
84 |
|
|
85 |
/**
|
|
86 |
* @see CXnPluginData
|
|
87 |
*/
|
|
88 |
void Destroy();
|
|
89 |
|
|
90 |
public:
|
|
91 |
// New functions
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Loads remaining application views
|
|
95 |
*/
|
|
96 |
void LoadRemainingViews();
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Cancels load remaining application views
|
|
100 |
*/
|
|
101 |
void CancelLoadRemainingViews();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Gets application active view data
|
|
105 |
*
|
|
106 |
* @return Active view data
|
|
107 |
*/
|
|
108 |
CXnViewData& ActiveViewData() const;
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Gets previous view data from currently active one
|
|
112 |
*
|
|
113 |
* @return Previous view data
|
|
114 |
*/
|
|
115 |
CXnViewData& PreviousViewData() const;
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Gets next view data from currently active one
|
|
119 |
*
|
|
120 |
* @return Next view data
|
|
121 |
*/
|
|
122 |
CXnViewData& NextViewData() const;
|
|
123 |
|
|
124 |
/**
|
|
125 |
* Sets view data to destroyal list
|
|
126 |
*
|
|
127 |
* @param aViewData View data to destroy
|
|
128 |
*/
|
|
129 |
void DestroyViewData( CXnViewData* aViewData );
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Gets ODT
|
|
133 |
*
|
|
134 |
* @return ODT
|
|
135 |
*/
|
|
136 |
CXnODT* ODT() const;
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Gets root node from ODT
|
|
140 |
*
|
|
141 |
* @return Root node
|
|
142 |
*/
|
|
143 |
CXnNode* RootNode() const;
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Gets ODT Parser
|
|
147 |
*
|
|
148 |
* @return ODT Parser
|
|
149 |
*/
|
|
150 |
CXnODTParser& Parser() const;
|
|
151 |
|
|
152 |
/**
|
|
153 |
* Gets Ecom handler
|
|
154 |
*
|
|
155 |
* @return Ecom handler
|
|
156 |
*/
|
|
157 |
CXnEcomHandler& EcomHandler() const;
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Sets maximum pages allowed
|
|
161 |
*
|
|
162 |
* @param aPages maximum pages
|
|
163 |
*/
|
|
164 |
void SetMaxPages( TInt32 aPages );
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Get maximum pages allowed
|
|
168 |
*
|
|
169 |
* @return number of pages allowed
|
|
170 |
*/
|
|
171 |
TInt32 MaxPages();
|
|
172 |
|
|
173 |
/**
|
|
174 |
* Returns ETrue, if all views are loaded
|
|
175 |
*/
|
|
176 |
TBool AllViewsLoaded() const;
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Returns ETrue, if all views are destoyed
|
|
180 |
*/
|
|
181 |
TBool AllViewsDestroyed() const;
|
|
182 |
|
|
183 |
private:
|
|
184 |
// New functions
|
|
185 |
static TInt RunLoadL( TAny* aAny );
|
|
186 |
static TInt RunDestroyL( TAny *aAny );
|
|
187 |
|
|
188 |
private:
|
|
189 |
// data
|
|
190 |
|
|
191 |
/** Timer for loading views, Owned */
|
|
192 |
CPeriodic* iLoadTimer;
|
|
193 |
/** Timer for deleting views, Owned */
|
|
194 |
CPeriodic* iDestroyTimer;
|
|
195 |
/** Application Uid */
|
|
196 |
TUid iApplicationUid;
|
|
197 |
/** ECom handler, Owned */
|
|
198 |
CXnEcomHandler* iEcomHandler;
|
|
199 |
/** ODT Parser, Owned */
|
|
200 |
CXnODTParser* iParser;
|
|
201 |
/** ODT which describes application configuration, Owned */
|
|
202 |
CXnODT* iODT;
|
|
203 |
/** Array of views waiting destruction */
|
|
204 |
RPointerArray< CXnViewData > iViewsToDestroy;
|
|
205 |
/** Flag to determine remaining view load direction */
|
|
206 |
TBool iLoadForward;
|
|
207 |
/** Maximum of views allowed */
|
|
208 |
TInt32 iMaxPages;
|
|
209 |
/** Load error code */
|
|
210 |
TInt iLoadError;
|
|
211 |
};
|
|
212 |
|
|
213 |
#endif // _XNROOTDATA_H
|