|
1 /* |
|
2 * Copyright (c) 2006 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: MPX view utility interface definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MMPXVIEWUTILITY_H |
|
21 #define MMPXVIEWUTILITY_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <mpxviewactivationobserver.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MMPXViewPluginManager; |
|
31 class CMPXViewPlugin; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * MPX view utility interface. |
|
38 * |
|
39 * @lib mpxviewutility.lib |
|
40 */ |
|
41 NONSHARABLE_CLASS( MMPXViewUtility ) |
|
42 { |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Retrieve a view utility of this thread. All clients in this thread |
|
47 * shares the same viewutility (singleton). |
|
48 * Call Close() when this object is not needed anymore. |
|
49 * |
|
50 * @since S60 3.2.3 |
|
51 * @return Pointer to view utility. Ownership not transferred. |
|
52 */ |
|
53 IMPORT_C static MMPXViewUtility* UtilityL(); |
|
54 |
|
55 /** |
|
56 * This method must be called when this object can be freed. This object |
|
57 * will be destroyed when no one is using it. |
|
58 * |
|
59 * @since S60 3.2.3 |
|
60 */ |
|
61 virtual void Close() = 0; |
|
62 |
|
63 /** |
|
64 * Activate view by resolving passed uid. |
|
65 * |
|
66 * @since S60 3.2.3 |
|
67 * @param aUid Uid to be resolved. This uid can be plugin implementation |
|
68 * uid, plugin type uid or specific view plugin uid. |
|
69 * @param aParam Parameter passed to the view on activation |
|
70 * @leave KErrNotFound if a matching plugin cannot be found |
|
71 */ |
|
72 virtual void ActivateViewL( |
|
73 const TUid& aUid, |
|
74 const TDesC* aParam = NULL ) = 0; |
|
75 |
|
76 /** |
|
77 * Activate view by resolving passed uids. |
|
78 * |
|
79 * @since S60 3.2.3 |
|
80 * @param aUids List of Uids to be resolved, this uid can be plugin uid, |
|
81 * plugin type uid or specific view plugin uid. |
|
82 * @param aParam Parameter passed to the view on activation |
|
83 * @leave KErrNotFound if a matching plugin cannot be found |
|
84 */ |
|
85 virtual void ActivateViewL( |
|
86 const RArray<TUid>& aUids, |
|
87 const TDesC* aParam = NULL ) = 0; |
|
88 |
|
89 /** |
|
90 * Set view as default view, not bring to foreground. This is only valid |
|
91 * if there are no views previously activated. |
|
92 * |
|
93 * @since S60 3.2.3 |
|
94 * @param aUid Uid of item to be activated. This uid can be plugin implementation |
|
95 * uid, plugin type uid or specific view plugin uid. |
|
96 * @leave Error code KErrAlreadyExist when there are views already |
|
97 * activated |
|
98 * @leave Error code KErrNotSupported for views that doesn't support |
|
99 * default view (such as dialogs) |
|
100 */ |
|
101 virtual void SetAsDefaultViewL( const TUid& aUid ) = 0; |
|
102 |
|
103 /** |
|
104 * Set view as default view, not bring to foreground. This is only valid |
|
105 * if there are no views previously activated. |
|
106 * |
|
107 * @since S60 3.2.3 |
|
108 * @param aUid Uids of item to be activated. This uid can be plugin implementation |
|
109 * uid, plugin type uid or specific view plugin uid. |
|
110 * @leave Error code KErrAlreadyExist when there are views already |
|
111 * activated |
|
112 * @leave Error code KErrNotSupported for views that doesn't support |
|
113 * default view (such as dialogs) |
|
114 */ |
|
115 virtual void SetAsDefaultViewL( const RArray<TUid>& aUids ) = 0; |
|
116 |
|
117 /** |
|
118 * Activate previous view. |
|
119 * |
|
120 * @since S60 3.2.3 |
|
121 * |
|
122 * @leave Error code KErrNotFound if there's no history. |
|
123 */ |
|
124 virtual void ActivatePreviousViewL() = 0; |
|
125 |
|
126 /** |
|
127 * Pre-load view plug-ins that have EMPXPluginFlagPreLoad flag set. |
|
128 * |
|
129 * @since S60 3.2.3 |
|
130 */ |
|
131 virtual void PreLoadViewsL() = 0; |
|
132 |
|
133 /** |
|
134 * Pre-load view plug-ins that have EMPXPluginFlagPreLoad flag and also by resolving passed uid. |
|
135 * |
|
136 * @param aUid Uid of specific application to be resolved. |
|
137 */ |
|
138 virtual void PreLoadViewsL( const TUid& aUid ) = 0; |
|
139 |
|
140 /** |
|
141 * Pre-load view plug-in by resolving passed uid. |
|
142 * |
|
143 * @since S60 3.2.3 |
|
144 * @param aUid Uid to be resolved. This uid can be plugin uid, plugin type |
|
145 * uid or specific view plugin uid. |
|
146 * @leave if no match is found. |
|
147 */ |
|
148 virtual void PreLoadViewL( const TUid& aUid ) = 0; |
|
149 |
|
150 /** |
|
151 * Get a reference to view plugin manager. |
|
152 * |
|
153 * @since S60 3.2.3 |
|
154 * @return Reference to view plugin manager. |
|
155 */ |
|
156 virtual MMPXViewPluginManager& ViewPluginManager() = 0; |
|
157 |
|
158 /** |
|
159 * Constructs default view history. |
|
160 * |
|
161 * @since S60 3.2.3 |
|
162 * @return if defined, the default view UID. KNullUid if not defined |
|
163 */ |
|
164 virtual TUid ConstructDefaultViewHistoryL() = 0; |
|
165 |
|
166 /** |
|
167 * Push default history to view history. The current browse history |
|
168 * is erased and the default browsing path is loaded as the current history. |
|
169 * @since S60 3.2.3 |
|
170 */ |
|
171 virtual void PushDefaultHistoryL() = 0; |
|
172 |
|
173 /** |
|
174 * Gets default view's UID. |
|
175 * |
|
176 * @since S60 3.2.3 |
|
177 * @return if defined, the default view UID. KNullUid if not defined |
|
178 */ |
|
179 virtual TUid DefaultViewUid() = 0; |
|
180 |
|
181 /** |
|
182 * Returns the current history depth. |
|
183 * if depth is greater than 1, the client should call ActivatePreviousViewL |
|
184 * on a back command. |
|
185 * |
|
186 * if depth is 1, the client should exit the app on a back command instead |
|
187 * of calling ActivatePreviousViewL. |
|
188 * |
|
189 * @since S60 3.2.3 |
|
190 * |
|
191 * @return The current browsing history depth. |
|
192 */ |
|
193 virtual TInt ViewHistoryDepth() = 0; |
|
194 |
|
195 /** |
|
196 * Returns the last activated view type. |
|
197 * |
|
198 * @since S60 3.2.3 |
|
199 * @return previous view type if defined. KNullUid if not. |
|
200 */ |
|
201 virtual TUid PreviousViewType() = 0; |
|
202 |
|
203 /** |
|
204 * Returns the view type of the active view. |
|
205 * |
|
206 * @since S60 3.2.3 |
|
207 * @return current view type if defined. KNullUid if not. |
|
208 */ |
|
209 virtual TUid ActiveViewType() = 0; |
|
210 |
|
211 /** |
|
212 * Returns the implementation uid of the active view. |
|
213 * |
|
214 * @since S60 3.2.3 |
|
215 * @return current view implementation id if defined. KNullUid if not. |
|
216 */ |
|
217 virtual TUid ActiveViewImplementationUid() = 0; |
|
218 |
|
219 /** |
|
220 * Add view activation observer. |
|
221 * |
|
222 * @since S60 3.2.3 |
|
223 * @param aObserver Pointer to an observer object |
|
224 */ |
|
225 virtual void AddObserverL( |
|
226 MMPXViewActivationObserver* aObserver ) = 0; |
|
227 |
|
228 /** |
|
229 * Remove view activation observer. |
|
230 * |
|
231 * @since S60 3.2.3 |
|
232 * @param aObserver Pointer to an observer object |
|
233 */ |
|
234 virtual void RemoveObserver( |
|
235 MMPXViewActivationObserver* aObserver ) = 0; |
|
236 }; |
|
237 |
|
238 #endif // MMPXVIEWUTILITY_H |
|
239 |
|
240 // End of File |