14 * Description: UI controller API |
14 * Description: UI controller API |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef C_AIUICONTROLLER_H |
19 #ifndef _AIUICONTROLLER_H |
20 #define C_AIUICONTROLLER_H |
20 #define _AIUICONTROLLER_H |
21 |
21 |
|
22 // System includes |
22 #include <ecom/ecom.h> |
23 #include <ecom/ecom.h> |
|
24 |
|
25 // User includes |
23 #include "aicontentmodel.h" |
26 #include "aicontentmodel.h" |
24 #include "aifwdefs.h" |
|
25 #include "aiuicontrolleruid.hrh" |
27 #include "aiuicontrolleruid.hrh" |
26 #include "aipluginsettings.h" |
28 #include "aipluginsettings.h" |
27 |
29 |
|
30 // Forward declarations |
28 class MAiContentObserver; |
31 class MAiContentObserver; |
29 class MAiFwEventHandler; |
32 class MAiFwEventHandler; |
30 class MAiUiFrameworkObserver; |
33 class MAiFwStateHandler; |
31 class CCoeEnv; |
|
32 class CAiContentPublisher; |
|
33 class MAiMainUiController; |
34 class MAiMainUiController; |
34 class MAiSecondaryUiController; |
35 class MAiSecondaryUiController; |
|
36 class THsPublisherInfo; |
|
37 class CCoeEnv; |
35 |
38 |
36 /** |
39 /** |
37 * ECom interface UID for CAiUiContoller |
40 * ECom interface UID for CAiUiContoller |
38 */ |
41 */ |
39 const TUid KInterfaceUidUiController = { AI_UID_ECOM_INTERFACE_UICONTROLLER }; |
42 const TUid KInterfaceUidUiController = { AI_UID_ECOM_INTERFACE_UICONTROLLER }; |
44 * @since Series 60 3.2 |
47 * @since Series 60 3.2 |
45 */ |
48 */ |
46 class CAiUiController : public CBase |
49 class CAiUiController : public CBase |
47 { |
50 { |
48 public: |
51 public: |
49 |
52 // Constructors and destructor |
50 // Constructors and destructor |
|
51 |
53 |
52 /** |
54 /** |
53 * Static factory method. |
55 * Static factory method. |
54 * |
56 * |
55 * @since Series 60 3.2 |
57 * @since Series 60 3.2 |
56 * @param ECom implementatoin uid |
58 * @param ECom implementatoin uid |
57 * @return class instance |
59 * @return class instance |
58 */ |
60 */ |
59 inline static CAiUiController* NewL(TUid aImpUid); |
61 inline static CAiUiController* NewL( TUid aImpUid ); |
60 |
62 |
61 /** |
63 /** |
62 * Static factory method. |
64 * Static factory method. |
63 * |
65 * |
64 * @since Series 60 3.2 |
66 * @since Series 60 3.2 |
65 * @param mimetype |
67 * @param mimetype |
66 * @return class instance |
68 * @return class instance |
67 */ |
69 */ |
68 inline static CAiUiController* NewL(const TDesC8& aMime); |
70 inline static CAiUiController* NewL( const TDesC8& aMime ); |
69 |
71 |
70 /** |
72 /** |
71 * Destructor. |
73 * Destructor. |
72 */ |
74 */ |
73 inline virtual ~CAiUiController(); |
75 inline ~CAiUiController(); |
74 |
76 |
75 // New functions |
77 public: |
|
78 // New functions |
76 |
79 |
77 /** |
80 /** |
78 * Instructs this UI controller to load its UI definition. |
81 * Instructs this UI controller to load its UI definition. |
79 * |
82 * |
80 * @since Series 60 3.2 |
83 * @since Series 60 3.2 |
81 */ |
84 */ |
82 virtual void LoadUIDefinitionL() = 0; |
85 virtual void LoadUIDefinitionL() = 0; |
83 |
86 |
84 /** |
87 /** |
85 * Retrieves the Content Publisher Plug-in list defined in this UI |
|
86 * controller's UI model. |
|
87 * |
|
88 * @since Series 60 3.2 |
|
89 */ |
|
90 virtual void GetPluginsL(RAiPublisherInfoArray& aPlugins) = 0; |
|
91 |
|
92 /** |
|
93 * Retrieves plug-in settings specified in this UI controller's UI definition. |
88 * Retrieves plug-in settings specified in this UI controller's UI definition. |
94 * |
89 * |
95 * @param aPubInfo Publisher info of the plug-in for which to |
90 * @param aPublisherInfo Publisher info of the plug-in for which to |
96 * retrieve settings for. |
91 * retrieve settings for. |
97 * @param aSettings array to get settings items to. |
92 * @param aSettings array to get settings items to. |
98 */ |
93 */ |
99 virtual void GetSettingsL(const TAiPublisherInfo& aPubInfo, |
94 virtual void GetSettingsL( |
100 RAiSettingsItemArray& aSettings) = 0; |
95 const THsPublisherInfo& aPublisherInfo, |
|
96 RAiSettingsItemArray& aSettings ) = 0; |
101 |
97 |
102 /** |
98 /** |
103 * Activate UI managed by this UI controller. |
99 * Activate UI managed by this UI controller. |
104 * |
100 * |
105 * @since Series 60 3.2 |
101 * @since Series 60 3.2 |
120 * @since Series 60 3.2 |
116 * @since Series 60 3.2 |
121 * @param aEventHandler Framework event handler for this UI controller. |
117 * @param aEventHandler Framework event handler for this UI controller. |
122 * Set to NULL to disable event callbacks from this |
118 * Set to NULL to disable event callbacks from this |
123 * UI Controller. |
119 * UI Controller. |
124 */ |
120 */ |
125 virtual void SetEventHandler(MAiFwEventHandler& aEventHandler) = 0; |
121 virtual void SetEventHandler( MAiFwEventHandler& aEventHandler ) = 0; |
126 |
122 |
127 /** |
123 /** |
128 * Remove specified plugin from the UI. |
124 * Sets plugin state handler |
129 * |
125 * |
130 * @param aPlugin plugin that is removed. |
126 * @since S60 5.2 |
131 */ |
127 * @param aHandler Plugin State Handler |
132 virtual void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) = 0; |
128 */ |
133 |
129 virtual void SetStateHandler( MAiFwStateHandler& aStateHandler ) = 0; |
|
130 |
134 /** |
131 /** |
135 * Returns the main UI Controller interface, or NULL if this is not the |
132 * Returns the main UI Controller interface, or NULL if this is not the |
136 * main UI controller. |
133 * main UI controller. |
137 */ |
134 */ |
138 virtual MAiMainUiController* MainInterface() = 0; |
135 virtual MAiMainUiController* MainInterface() = 0; |
141 * Returns the secondary UI Controller interface, or NULL if this is not |
138 * Returns the secondary UI Controller interface, or NULL if this is not |
142 * a secondary UI controller. |
139 * a secondary UI controller. |
143 */ |
140 */ |
144 virtual MAiSecondaryUiController* SecondaryInterface() = 0; |
141 virtual MAiSecondaryUiController* SecondaryInterface() = 0; |
145 |
142 |
146 private: // Data |
143 private: |
147 |
144 // data |
148 TUid iDestructKey; // An identifier used during destruction |
145 |
149 |
146 /** An identifier used during destruction */ |
|
147 TUid iDestructKey; |
150 }; |
148 }; |
151 |
149 |
152 inline CAiUiController* CAiUiController::NewL(TUid aImplUid) |
150 // ---------------------------------------------------------------------------- |
153 { |
151 // CAiUiController::NewL |
154 TAny* ptr = REComSession::CreateImplementationL(aImplUid, |
152 // |
155 _FOFF(CAiUiController, iDestructKey)); |
153 // ---------------------------------------------------------------------------- |
156 |
154 // |
157 return reinterpret_cast<CAiUiController*> (ptr); |
155 inline CAiUiController* CAiUiController::NewL( TUid aImplUid ) |
|
156 { |
|
157 TAny* ptr = REComSession::CreateImplementationL( aImplUid, |
|
158 _FOFF( CAiUiController, iDestructKey ) ); |
|
159 |
|
160 return reinterpret_cast< CAiUiController* >( ptr ); |
158 } |
161 } |
159 |
162 |
160 inline CAiUiController* CAiUiController::NewL(const TDesC8& aMime) |
163 // ---------------------------------------------------------------------------- |
|
164 // CAiUiController::NewL |
|
165 // |
|
166 // ---------------------------------------------------------------------------- |
|
167 // |
|
168 inline CAiUiController* CAiUiController::NewL( const TDesC8& aMime ) |
161 { |
169 { |
162 TEComResolverParams params; |
170 TEComResolverParams params; |
163 params.SetDataType(aMime); |
171 params.SetDataType( aMime ); |
164 TAny* ptr = REComSession::CreateImplementationL(KInterfaceUidUiController, |
172 TAny* ptr = REComSession::CreateImplementationL( KInterfaceUidUiController, |
165 _FOFF(CAiUiController, iDestructKey), params); |
173 _FOFF( CAiUiController, iDestructKey ), params ); |
166 return reinterpret_cast<CAiUiController*> (ptr); |
174 |
|
175 return reinterpret_cast< CAiUiController* >( ptr ); |
167 } |
176 } |
168 |
177 |
|
178 // ---------------------------------------------------------------------------- |
|
179 // CAiUiController::~CAiUiController |
|
180 // |
|
181 // ---------------------------------------------------------------------------- |
|
182 // |
169 inline CAiUiController::~CAiUiController() |
183 inline CAiUiController::~CAiUiController() |
170 { |
184 { |
171 REComSession::DestroyedImplementation(iDestructKey); |
185 REComSession::DestroyedImplementation( iDestructKey ); |
172 } |
186 } |
173 |
187 |
174 |
188 |
175 /** |
189 /** |
176 * Main UI Controller interface for Active Idle. |
190 * Main UI Controller interface for Active Idle. |
218 * @since S60 3.2 |
229 * @since S60 3.2 |
219 */ |
230 */ |
220 class MAiSecondaryUiController |
231 class MAiSecondaryUiController |
221 { |
232 { |
222 public: |
233 public: |
|
234 // new functions |
|
235 |
223 /** |
236 /** |
224 * Sets the CONE environment object for this secondary UI controller to use. |
237 * Sets the CONE environment object for this secondary UI controller to use. |
225 * |
238 * |
226 * @param aCoeEnv the CONE environment object to use. |
239 * @param aCoeEnv the CONE environment object to use. |
227 */ |
240 */ |
228 virtual void SetCoeEnv( CCoeEnv& aCoeEnv ) = 0; |
241 virtual void SetCoeEnv( CCoeEnv& aCoeEnv ) = 0; |
229 |
|
230 /** |
|
231 * Returns the UI framework observer of this secondary UI controller. |
|
232 * |
|
233 * @return The UI framework observer, or NULL if observer is not supported. |
|
234 */ |
|
235 virtual MAiUiFrameworkObserver* UiFrameworkObserver() = 0; |
|
236 }; |
242 }; |
237 |
243 |
238 #endif // C_AIUICONTROLLER_H |
244 #endif // _AIUICONTROLLER_H |
239 |
245 |
240 // End of File. |
246 // End of File. |