17 |
17 |
18 |
18 |
19 #ifndef C_NATIVEUICONTROLLER_H |
19 #ifndef C_NATIVEUICONTROLLER_H |
20 #define C_NATIVEUICONTROLLER_H |
20 #define C_NATIVEUICONTROLLER_H |
21 |
21 |
22 |
22 // System includes |
23 #include <aisystemuids.hrh> |
23 #include <aisystemuids.hrh> |
24 #include "aiuicontroller.h" |
24 |
25 #include "aiuiframeworkobserver.h" |
25 // User includes |
26 #include "aicontentobserver.h" |
26 #include <aiuicontroller.h> |
27 |
27 #include <aicontentobserver.h> |
28 #include <aiutility.h> |
28 #include <aiutility.h> |
29 |
29 |
30 class MAiPropertyExtension; |
30 // Forward declarations |
31 class MAiPSPropertyObserver; |
31 class MAiPSPropertyObserver; |
|
32 class CHsContentPublisher; |
|
33 class THsPublisherInfo; |
32 |
34 |
33 namespace AiNativeUiController |
35 namespace AiNativeUiController |
34 { |
36 { |
35 |
|
36 class CAiNativeRenderer; |
37 class CAiNativeRenderer; |
37 class CAiStatusPanel; |
38 class CAiStatusPanel; |
38 class CAppUi; |
39 class CAppUi; |
39 class CAiToolbarRenderer; |
|
40 |
40 |
41 const TInt KImplementationUidNativeUiController = AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE; |
41 const TInt KImplementationUidNativeUiController = AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE; |
42 |
42 |
43 const TUid KUidNativeUiController = { KImplementationUidNativeUiController }; |
43 const TUid KUidNativeUiController = { KImplementationUidNativeUiController }; |
44 |
44 |
48 * the MAiContentObserver interface thus handling and forwarding the data coming |
48 * the MAiContentObserver interface thus handling and forwarding the data coming |
49 * from the publishers. |
49 * from the publishers. |
50 * |
50 * |
51 * @since Series 60 3.2 |
51 * @since Series 60 3.2 |
52 */ |
52 */ |
53 class CNativeUiController : public CAiUiController, |
53 NONSHARABLE_CLASS( CNativeUiController ) : public CAiUiController, |
54 public MAiSecondaryUiController, |
54 public MAiSecondaryUiController, public MAiMainUiController, |
55 public MAiMainUiController, |
55 public MAiContentObserver |
56 public MAiUiFrameworkObserver, |
|
57 public MAiContentObserver |
|
58 { |
56 { |
59 public: |
57 public: |
60 |
58 // Constructor and destructor |
61 static CNativeUiController* NewL(); |
59 static CNativeUiController* NewL(); |
62 |
60 |
63 virtual ~CNativeUiController(); |
61 ~CNativeUiController(); |
64 |
62 |
65 // from base class CAiUiController |
63 public: |
66 |
64 // from CAiUiController |
67 void PrepareToExit(); |
65 |
68 |
|
69 void LoadUIDefinitionL(); |
66 void LoadUIDefinitionL(); |
70 |
67 |
71 void GetPluginsL(RAiPublisherInfoArray& aPlugins); |
68 void GetSettingsL( const THsPublisherInfo& aPublisherInfo, |
72 |
69 RAiSettingsItemArray& aSettings ); |
73 void GetSettingsL(const TAiPublisherInfo& aPubInfo, |
|
74 RAiSettingsItemArray& aSettings); |
|
75 |
70 |
76 void ActivateUI(); |
71 void ActivateUI(); |
77 |
72 |
78 MAiContentObserver& GetContentObserver(); |
73 MAiContentObserver& GetContentObserver(); |
79 |
74 |
80 void SetEventHandler(MAiFwEventHandler& aEventHandler); |
75 void SetEventHandler( MAiFwEventHandler& aEventHandler ); |
|
76 |
|
77 void SetStateHandler( MAiFwStateHandler& aStateHandler ); |
81 |
78 |
82 MAiFwEventHandler* FwEventHandler(); |
79 MAiFwEventHandler* FwEventHandler(); |
83 |
80 |
84 void RemovePluginFromUI( MAiPropertyExtension& aPlugin ); |
81 MAiFwStateHandler* FwStateHandler(); |
85 |
82 |
86 MAiMainUiController* MainInterface(); |
83 MAiMainUiController* MainInterface(); |
87 |
84 |
88 MAiSecondaryUiController* SecondaryInterface(); |
85 MAiSecondaryUiController* SecondaryInterface(); |
89 |
86 |
90 void HandleLoadedPlugins(const RAiPublisherInfoArray& /*aRequiredPlugins*/ ) {}; |
87 public: |
91 |
88 // from MAiMainUiController |
92 // from base class MAiMainUiController |
|
93 |
89 |
94 void RunApplicationL(); |
90 void RunApplicationL(); |
95 |
91 |
96 CCoeEnv& CoeEnv(); |
92 CCoeEnv& CoeEnv(); |
97 |
|
98 void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ); |
|
99 |
93 |
100 TBool IsMenuOpen(); |
94 TBool IsMenuOpen(); |
101 |
95 |
102 // from base class CAiSecordaryUiController |
96 public: |
|
97 // from CAiSecordaryUiController |
103 |
98 |
104 void SetCoeEnv( CCoeEnv& aCoeEnv ); |
99 void SetCoeEnv( CCoeEnv& aCoeEnv ); |
105 |
100 |
106 MAiUiFrameworkObserver* UiFrameworkObserver(); |
101 public: |
107 |
102 // from MAiContentObserver |
108 // from base class MAiUiFrameworkObserver |
|
109 |
|
110 void HandleResourceChange( TInt aType ); |
|
111 |
|
112 void HandleForegroundEvent( TBool aForeground ); |
|
113 |
|
114 // from base class MAiContentObserver |
|
115 |
|
116 TInt StartTransaction(TInt aTxId); |
103 TInt StartTransaction(TInt aTxId); |
117 |
104 |
118 TInt Commit(TInt aTxId); |
105 TInt Commit(TInt aTxId); |
119 |
106 |
120 TInt CancelTransaction(TInt aTxId); |
107 TInt CancelTransaction(TInt aTxId); |
121 |
108 |
122 TBool CanPublish(MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex); |
109 TBool CanPublish(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex); |
123 |
110 |
124 TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); |
111 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); |
125 |
112 |
126 TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); |
113 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); |
127 |
114 |
128 TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); |
115 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); |
129 |
116 |
130 TInt Publish(MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); |
117 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); |
131 |
118 |
132 TInt Clean(MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); |
119 TInt Clean(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); |
133 |
120 |
134 TAny* Extension(TUid aUid); |
121 TAny* Extension(TUid aUid); |
135 |
122 |
136 TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; |
123 TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const; |
137 |
124 |
138 TInt SetProperty( MAiPropertyExtension& aPlugin, |
125 TInt SetProperty( CHsContentPublisher& aPlugin, |
139 const TDesC8& aElementId, |
126 const TDesC8& aElementId, |
140 const TDesC8& aPropertyName, |
127 const TDesC8& aPropertyName, |
141 const TDesC8& aPropertyValue ); |
128 const TDesC8& aPropertyValue ); |
142 |
129 |
143 TInt SetProperty( MAiPropertyExtension& aPlugin, |
130 TInt SetProperty( CHsContentPublisher& aPlugin, |
144 const TDesC8& aElementId, |
131 const TDesC8& aElementId, |
145 const TDesC8& aPropertyName, |
132 const TDesC8& aPropertyName, |
146 const TDesC8& aPropertyValue, |
133 const TDesC8& aPropertyValue, |
147 MAiContentObserver::TValueType aValueType); |
134 MAiContentObserver::TValueType aValueType); |
148 |
135 |
149 // new methods |
136 private: |
150 |
137 // constructors |
|
138 |
|
139 /** |
|
140 * C++ default contructor |
|
141 */ |
|
142 CNativeUiController(); |
|
143 |
|
144 public: |
|
145 // new functions |
|
146 |
151 /** |
147 /** |
152 * Set app ui instance to this class. |
148 * Set app ui instance to this class. |
153 * |
149 * |
154 * @since S60 3.2 |
150 * @since S60 3.2 |
155 * @param aAppUi is pointer to app ui. |
151 * @param aAppUi is pointer to app ui. |
156 */ |
152 */ |
157 void SetAppUi( CAppUi* aAppUi ) |
153 void SetAppUi( CAppUi* aAppUi ); |
158 { |
154 |
159 iAppUi = aAppUi; |
155 /** |
160 } |
156 * Promotes this UI controller as main UI controller. |
161 |
157 * |
|
158 * @since S60 3.2 |
|
159 */ |
162 void VariateToMainUiController(); |
160 void VariateToMainUiController(); |
163 |
161 |
|
162 /** |
|
163 * Runs exit timer. |
|
164 * |
|
165 * @since S60 3.2 |
|
166 */ |
164 void Exit(); |
167 void Exit(); |
165 |
168 |
|
169 /** |
|
170 * Preperas to exit |
|
171 * |
|
172 * @since S60 3.2 |
|
173 */ |
|
174 void PrepareToExit(); |
|
175 |
166 private: |
176 private: |
167 |
177 // new functions |
168 CNativeUiController(); |
178 |
169 |
|
170 static CApaApplication* NewApplication(); |
|
171 |
|
172 /** |
179 /** |
173 * Add renderer. |
180 * Add renderer. |
174 * |
181 * |
175 * Ownership transferred. |
182 * Ownership transferred. |
176 * |
183 * |