|
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: Class that provides centralized access for UI classes |
|
15 * to logic handling |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_CVIMPSTUIVIEWMANAGER_H |
|
21 #define C_CVIMPSTUIVIEWMANAGER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <e32const.h> |
|
26 #include "mvimpstengine.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MxSPViewInfo; |
|
30 class CVIMPSTUIExtensionViewInfo; |
|
31 class CEikonEnv; |
|
32 class CVIMPSTUiExtensionFactory; |
|
33 class CVIMPSTUIExtensionService; |
|
34 class CVIMPSTUIMenuExtension; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * |
|
40 * This class provides access to logic handling behind UI. |
|
41 * |
|
42 * @lib vimpstui.lib |
|
43 * @since S60 5.0 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CVIMPSTUIViewManager ) : public CBase |
|
46 { |
|
47 public: // Constructor and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * |
|
52 * @param aServiceName, service name. |
|
53 * @param aExtensionFactory, extension factory |
|
54 */ |
|
55 static CVIMPSTUIViewManager* NewL( |
|
56 const TDesC& aServiceName, |
|
57 CVIMPSTUiExtensionFactory& aExtensionFactory ); |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 * |
|
62 * @param aServiceName, service name. |
|
63 * @param aExtensionFactory, extension factory |
|
64 */ |
|
65 static CVIMPSTUIViewManager* NewLC( |
|
66 const TDesC& aServiceName, |
|
67 CVIMPSTUiExtensionFactory& aExtensionFactory ); |
|
68 |
|
69 /** |
|
70 * Standard C++ destructor |
|
71 */ |
|
72 ~CVIMPSTUIViewManager(); |
|
73 |
|
74 |
|
75 public: |
|
76 |
|
77 /** |
|
78 * Adds new client to use engine |
|
79 * |
|
80 * @param aServiceId, service id of the client |
|
81 * @param aEngine, reference to engine. |
|
82 * @param aTabbedViewId, tabbed view id for this service |
|
83 * @param aSearchViewId, details view id for this service |
|
84 */ |
|
85 void AddNewClientL( |
|
86 TUint aServiceId, |
|
87 MVIMPSTEngine& aEngine, |
|
88 TInt aTabbedViewId, |
|
89 TInt aSearchViewId, |
|
90 TInt aBlockedViewId , |
|
91 CVIMPSTUIMenuExtension& aMenuExtension); |
|
92 |
|
93 |
|
94 |
|
95 /** |
|
96 * Returns reference to shared eik env instance. |
|
97 * |
|
98 * @since S60 5.0 |
|
99 * @return CEikonEnv&, eik env reference |
|
100 */ |
|
101 CEikonEnv& EikEnv(); |
|
102 |
|
103 |
|
104 /** |
|
105 * Returns view info count. |
|
106 * |
|
107 * @since S60 5.0 |
|
108 * @return Count of view info items |
|
109 */ |
|
110 TInt ViewInfoCount() const; |
|
111 |
|
112 /** |
|
113 * Returns specific view info object |
|
114 * |
|
115 * @since S60 5.0 |
|
116 * @param aIndex, index of view info object. |
|
117 * @return View info object, ownerhsip is not passed. |
|
118 */ |
|
119 const MxSPViewInfo* ViewInfo( TInt aIndex ) const; |
|
120 |
|
121 /** |
|
122 * Returns service count |
|
123 * |
|
124 * @since S60 5.0 |
|
125 * @return TInt, service count |
|
126 */ |
|
127 TInt ServiceCount() const; |
|
128 |
|
129 CVIMPSTUIExtensionService& Service( TInt aIndex ) const ; |
|
130 |
|
131 MVIMPSTEngine& Engine( TInt aIndex ) const; |
|
132 |
|
133 private: |
|
134 |
|
135 |
|
136 /** |
|
137 * Resolves service data object by service id. If service object |
|
138 * can not be found, leaves with KErrNotFound; |
|
139 * |
|
140 * @since S60 5.0 |
|
141 * @param aServiceId, service id |
|
142 * @return CVIMPSTUIExtensionService, reference to service |
|
143 */ |
|
144 CVIMPSTUIExtensionService& ResolveServiceL( |
|
145 TUint aServiceId ); |
|
146 |
|
147 |
|
148 private: // Implementation |
|
149 |
|
150 /** |
|
151 * Standard C++ constructor |
|
152 * @param aServiceName, service name. |
|
153 * @param aExtensionFactory, extension factory |
|
154 */ |
|
155 CVIMPSTUIViewManager( |
|
156 const TDesC& aServiceName, |
|
157 CVIMPSTUiExtensionFactory& aExtensionFactory ); |
|
158 |
|
159 /** |
|
160 * Performs the 2nd phase of construction. |
|
161 */ |
|
162 void ConstructL(); |
|
163 |
|
164 private: // Data |
|
165 |
|
166 // Service provider settings handler |
|
167 const TDesC& iServiceName; |
|
168 |
|
169 // Not own, shared eik env instance |
|
170 CEikonEnv* iEikEnv; |
|
171 |
|
172 // Own, services |
|
173 RPointerArray<CVIMPSTUIExtensionService> iServices; |
|
174 |
|
175 // Own, Array of view infos to be informed to xSP Extension Manager |
|
176 RPointerArray<CVIMPSTUIExtensionViewInfo> iViewInfos; |
|
177 |
|
178 // Extension factory |
|
179 CVIMPSTUiExtensionFactory& iExtensionFactory; |
|
180 |
|
181 |
|
182 |
|
183 }; |
|
184 |
|
185 #endif // C_CVIMPSTUIVIEWMANAGER_H |
|
186 |
|
187 // End of file |