23 #include <e32base.h> // CAsyncCallBack |
23 #include <e32base.h> // CAsyncCallBack |
24 #include <vwsdef.h> // TVwsViewId |
24 #include <vwsdef.h> // TVwsViewId |
25 #include <apadef.h> // TApaCommand |
25 #include <apadef.h> // TApaCommand |
26 #include <qglobal.h> // Q_DECL_EXPORT macro |
26 #include <qglobal.h> // Q_DECL_EXPORT macro |
27 #include <agendautil.h> |
27 #include <agendautil.h> |
|
28 #include <qobject> |
28 #include "hb_calencommands.hrh" // Calendar commands |
29 #include "hb_calencommands.hrh" // Calendar commands |
29 #include "calennotificationhandler.h" // TCalenNotification |
30 #include "calennotificationhandler.h" // TCalenNotification |
30 #include "calenservices.h" |
31 #include "calenservices.h" |
31 #include "calenservicesfactory.h" // MCalenServicesFactory |
32 #include "calenservicesfactory.h" // MCalenServicesFactory |
32 |
33 |
56 |
57 |
57 /** |
58 /** |
58 * The controller handles events from the rest of Calendar and delegates |
59 * The controller handles events from the rest of Calendar and delegates |
59 * them to the appropriate place (i.e. the action ui classes). |
60 * them to the appropriate place (i.e. the action ui classes). |
60 */ |
61 */ |
61 class CALENCONTROLLER_EXPORT CCalenController : public MCalenServicesFactory |
62 class CALENCONTROLLER_EXPORT CCalenController : public QObject, public MCalenServicesFactory |
62 { |
63 { |
63 |
64 Q_OBJECT |
|
65 |
64 public: // Construction and destruction |
66 public: // Construction and destruction |
65 /** |
67 /** |
66 * C++ constructor |
68 * C++ constructor |
67 */ |
69 */ |
68 CCalenController(bool isFromServiceFrmwrk); |
70 CCalenController(); |
69 |
71 |
70 /** |
72 /** |
71 * Constructs CCalenController with existing CAknViewAppUi. If the |
73 * Second phase contruction for controller |
72 * controller has been previously initialized with the same CAknViewAppUi, |
74 */ |
73 * the existing instance will be returned. |
75 void constructController(); |
74 * @param aAppUi Reference to CAknViewAppUi |
76 |
75 * @return CCalenController pointer |
77 /** |
76 */ |
78 * Constructs CCalenController with existing CAknViewAppUi. If the |
77 static CCalenController* InstanceL(); |
79 * controller has been previously initialized with the same CAknViewAppUi, |
78 |
80 * the existing instance will be returned. |
79 /** |
81 * @param aAppUi Reference to CAknViewAppUi |
80 * CCalenController is a reference counting singleton. Call Release() |
82 * @return CCalenController pointer |
81 * when you are done with it, it will clean itself when it needs to |
83 */ |
82 */ |
84 static CCalenController* InstanceL(); |
83 void Release(); |
85 |
|
86 |
|
87 /** |
|
88 * Releases all plugins, should only be called when |
|
89 * the application is exiting. |
|
90 */ |
|
91 void ReleaseCustomisations(); |
|
92 |
|
93 /** |
|
94 * CCalenController is a reference counting singleton. Call Release() |
|
95 * when you are done with it, it will clean itself when it needs to |
|
96 */ |
|
97 void Release(); |
84 |
98 |
85 /** |
99 /** |
86 * destructor |
100 * destructor |
87 */ |
101 */ |
88 ~CCalenController(); |
102 ~CCalenController(); |
203 * Get customisationmanager |
217 * Get customisationmanager |
204 * @return reference to CCalenCustomisationManager |
218 * @return reference to CCalenCustomisationManager |
205 */ |
219 */ |
206 CCalenCustomisationManager& CustomisationManager(); |
220 CCalenCustomisationManager& CustomisationManager(); |
207 |
221 |
|
222 /** |
|
223 * Filters the events eg. Locale/language change events |
|
224 * @param event |
|
225 */ |
|
226 bool eventFilter(QObject *object, QEvent *event); |
|
227 |
208 private: // Construction and destruction |
228 private: // Construction and destruction |
209 |
229 |
210 /** |
230 /** |
211 * Sets the default context for today |
231 * Sets the default context for today |
212 */ |
232 */ |
220 private: // Data |
240 private: // Data |
221 CalenViewManager* iViewManager;// Activate / deactivate views |
241 CalenViewManager* iViewManager;// Activate / deactivate views |
222 CalenContextImpl* mContext; |
242 CalenContextImpl* mContext; |
223 AgendaUtil *mAgendaUtil; // Agenda interface provider |
243 AgendaUtil *mAgendaUtil; // Agenda interface provider |
224 CalenServicesImpl* iServices; // Services. |
244 CalenServicesImpl* iServices; // Services. |
225 HbMainWindow* iMainWindow; |
|
226 CalenNotifier* iNotifier; // Broadcasts calendar events |
245 CalenNotifier* iNotifier; // Broadcasts calendar events |
227 CCalenStateMachine* iStateMachine; |
246 CCalenStateMachine* iStateMachine; |
228 CCalenActionUi* iActionUi; // Default internal command handling |
247 CCalenActionUi* iActionUi; // Default internal command handling |
229 // Manages any customisation plugins |
248 // Manages any customisation plugins |
230 CCalenCustomisationManager* iCustomisationManager; |
249 CCalenCustomisationManager* iCustomisationManager; |