|
1 /* |
|
2 * Copyright (c) 2009 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 * widget manager plugin declaration |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __WMPLUGIN_ |
|
20 #define __WMPLUGIN_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <vwsdef.h> |
|
25 |
|
26 #include <hscontentcontrolui.h> |
|
27 #include <hscontentcontroller.h> |
|
28 #include <hscontentinfo.h> |
|
29 |
|
30 class CAknViewAppUi; |
|
31 class CWmResourceLoader; |
|
32 class CWmMainContainerView; |
|
33 class CWmMainContainer; |
|
34 class CWmEffectManager; |
|
35 |
|
36 /** |
|
37 * CWmPlugin |
|
38 */ |
|
39 NONSHARABLE_CLASS( CWmPlugin ) : public CHsContentControlUi |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CWmPlugin* NewL(); |
|
47 |
|
48 /** Destructor */ |
|
49 ~CWmPlugin(); |
|
50 |
|
51 public: // From MHsContentControlUi |
|
52 |
|
53 /** |
|
54 * shows the widget manager UI |
|
55 * |
|
56 * @see MHsContentControlUi::Activate |
|
57 */ |
|
58 void Activate(); |
|
59 |
|
60 /** |
|
61 * Notifies widget list changes |
|
62 * |
|
63 * @see MHsContentControlUi::NotifyWidgetListChanged |
|
64 */ |
|
65 void NotifyWidgetListChanged(); |
|
66 |
|
67 public: // plugin services |
|
68 |
|
69 /** |
|
70 * whether widget manager UI is showing |
|
71 * |
|
72 * @return return ETrue if wm UI is showed |
|
73 */ |
|
74 TBool IsActive(); |
|
75 |
|
76 /** |
|
77 * hides widget manager UI |
|
78 */ |
|
79 void Deactivate(); |
|
80 |
|
81 /** |
|
82 * main view activated. Sets the previous view ID and main container |
|
83 * |
|
84 * @param aPreviousViewId |
|
85 * @param aWmMainContainer |
|
86 */ |
|
87 void MainViewActivated( |
|
88 const TVwsViewId& aPreviousViewId, |
|
89 CWmMainContainer* aWmMainContainer ); |
|
90 |
|
91 /** |
|
92 * main view was deactivated |
|
93 */ |
|
94 void MainViewDeactivated(); |
|
95 |
|
96 /** Postponed command to execute when widgetmanager has deactivated */ |
|
97 enum TCommand |
|
98 { |
|
99 /** no command */ |
|
100 ENone, |
|
101 /** add content to home screen */ |
|
102 EAddToHomescreen |
|
103 }; |
|
104 |
|
105 /** |
|
106 * Sets a postponed command. The postponed command will be executed after |
|
107 * widget manager has been deactivated. |
|
108 * |
|
109 * @param aCommand the command to be executed |
|
110 * @param aContent content parameter related to the command |
|
111 */ |
|
112 void SetPostponedCommandL( |
|
113 TCommand aCommand, CHsContentInfo& aContent ); |
|
114 |
|
115 /** |
|
116 * the CAknViewAppUi reference |
|
117 * |
|
118 * @return returns CAknViewAppUi |
|
119 */ |
|
120 CAknViewAppUi& ViewAppUi(); |
|
121 |
|
122 /** |
|
123 * the resource loader |
|
124 * |
|
125 * @return returns CWmResourceLoader |
|
126 */ |
|
127 CWmResourceLoader& ResourceLoader(); |
|
128 |
|
129 /** |
|
130 * the content controller ref |
|
131 * |
|
132 * @return returns MHsContentController |
|
133 */ |
|
134 MHsContentController& ContentController(); |
|
135 |
|
136 /** |
|
137 * the shared file server reference |
|
138 */ |
|
139 RFs& FileServer(); |
|
140 |
|
141 private: |
|
142 /** constructor */ |
|
143 CWmPlugin(); |
|
144 /** 2nd phase constructor */ |
|
145 void ConstructL(); |
|
146 /** actions that are done when widget manager is closed */ |
|
147 void ExecutePostponedCommandL(); |
|
148 |
|
149 private: // data members |
|
150 |
|
151 /** |
|
152 * the host application view app UI (not owned) |
|
153 */ |
|
154 CAknViewAppUi* iViewAppUi; |
|
155 |
|
156 /** |
|
157 * main container (not owned) |
|
158 */ |
|
159 CWmMainContainer* iWmMainContainer; |
|
160 |
|
161 /** |
|
162 * resource loader |
|
163 */ |
|
164 CWmResourceLoader* iResourceLoader; |
|
165 |
|
166 /** |
|
167 * previous view ID (shown when main view closed) |
|
168 */ |
|
169 TVwsViewId iPreviousViewUid; |
|
170 |
|
171 /** |
|
172 * Takes care of fancy UI effects |
|
173 */ |
|
174 CWmEffectManager* iEffectManager; |
|
175 |
|
176 /** |
|
177 * The file server session |
|
178 */ |
|
179 RFs* iFs; |
|
180 |
|
181 /** |
|
182 * command to be executed when widgetmanager has |
|
183 * been deactivated |
|
184 */ |
|
185 TCommand iPostponedCommand; |
|
186 |
|
187 /** |
|
188 * content info as parameter to iPostponedCommand |
|
189 */ |
|
190 CHsContentInfo* iPostponedContent; |
|
191 |
|
192 }; |
|
193 |
|
194 #endif // __WMPLUGIN_ |
|
195 |