diff -r 12af337248b1 -r bd7edf625bdd calendarui/controller/inc/calenservicesimpl.h --- a/calendarui/controller/inc/calenservicesimpl.h Tue Aug 31 15:13:43 2010 +0300 +++ b/calendarui/controller/inc/calenservicesimpl.h Wed Sep 01 12:32:31 2010 +0100 @@ -19,183 +19,258 @@ #define CALENSERVICESIMPL_H #include - -#include "calennotificationhandler.h" // TCalenNotification -#include "calenservices.h" +#include +#include +#include // Forward declarations +class CCalenGlobalData; // Calendar-wide accessors class CCalenController; // Calendar controller -class HbMainWindow; -class HbWidget; -class QString; -class HbMenu; +class CCalenIcons; +class CGulIcon; +class CCalenAttachmentModel; +class CCalCalendarInfo; +class MCalenPreview; /** * Calendar Services External API implementation. */ -class CalenServicesImpl : public MCalenServices +NONSHARABLE_CLASS( CCalenServicesImpl ) : public CBase, + public MCalenServices { - - public: // Construction and destruction. - /** - * Two phased constructor. Use this in preference to the C++ - * constructor where possible. - * @param aCommandRangeStart start of the command range - * @param aCommandRangeEnd end of command range - */ - static CalenServicesImpl* NewL( TInt aCommandRangeStart, - TInt aCommandRangeEnd ); - /** - * Two phased constructor. Use this in preference to the C++ - * constructor where possible. - */ - static CalenServicesImpl* NewL(); - - /** - * Completes construction of this object. - */ - void ConstructL(); +public: // Construction and destruction. + /** + * Two phased constructor. Use this in preference to the C++ + * constructor where possible. + * @param aCommandRangeStart start of the command range + * @param aCommandRangeEnd end of command range + */ + static CCalenServicesImpl* NewL( TInt aCommandRangeStart, + TInt aCommandRangeEnd ); + + /** + * Two phased constructor. Use this in preference to the C++ + * constructor where possible. + */ + static CCalenServicesImpl* NewL(); + + /** + * Completes construction of this object. + */ + void ConstructL(); - /** - * Performs cleanup of this object. - */ - void Release(); + /** + * Performs cleanup of this object. + */ + void Release(); + +public: // Functions from base classes. + /** + * Retrieve the calendar session currently in use by Calendar + * @return CCalSession& currently used by Calendar + */ + CCalSession& SessionL(); + + /** + * Retrieve the calendar session currently in use by Calendar + * @return CCalSession& currently used by Calendar + */ + CCalSession& SessionL( const TDesC& aCalendar ); + + /** + * Retrieve the calendar entry view currently in use by Calendar + * @return CCalEntryView* currently used by Calendar + */ + CCalEntryView* EntryViewL(); - public: // Functions from base classes. - - /** - * Get MainWindow - * @return reference to HbMainWindow - */ - HbMainWindow& MainWindow(); - - /** - * Retrieve the calendar session currently in use by Calendar - * @return CCalSession& currently used by Calendar - */ - CCalSession& SessionL(); + + /** + * Retrieve the calendar entry view currently in use by Calendar + * @return CCalEntryView* currently used by Calendar + */ + CCalEntryView* EntryViewL(const TCalCollectionId aCollectionId ); + + + /** + * Retrieve the calendar instance view currently in use by Calendar + * @return CCalInstanceView* currently used by Calendar + */ + CCalInstanceView* InstanceViewL(); - /** - * Retrieve the calendar entry view currently in use by Calendar - * @return CCalEntryView* currently used by Calendar - */ - CCalEntryView* EntryViewL(); + /** + * Retrieve the calendar instance view currently in use by Calendar + * @return CCalInstanceView* currently used by Calendar + */ + CCalInstanceView* InstanceViewL( + const RArray& aCollectionIds ); + + /** + * Retrieve the InterimUtils + * @return CCalenInterimUtils2& + */ + CCalenInterimUtils2& InterimUtilsL(); - /** - * Retrieve the calendar instance view currently in use by Calendar - * @return CCalInstanceView* currently used by Calendar - */ - CCalInstanceView* InstanceViewL(); - + TBool QueueKeyEvent( const TKeyEvent& aEvent, TEventCode aType ); + TBool GetQueuedKeyEvent( TKeyEvent& aEvent, TEventCode& aType ); + void ResetKeyEventQueue(); + /** + * Get calendar icon of specific type + * @return CGulIcon* + */ + CGulIcon* GetIconL( MCalenServices::TCalenIcons aIndex, const TInt aViewId = 0 ); - - /** - * Register for notifications of Calendar events - * @param aHandler the MCalenNotificationHandler to notify - * @param aNotification single notification to be notified about - */ - virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, - TCalenNotification aNotification ); - - /** - * Register for notifications of Calendar events - * @param aHandler the MCalenNotificationHandler to notify - * @param aNotifications array of notifications to be notified about - */ - virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, - RArray& aNotifications ); + /** + * Register for notifications of Calendar events + * @param aHandler the MCalenNotificationHandler to notify + * @param aNotification single notification to be notified about + */ + virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, + TCalenNotification aNotification ); + + /** + * Register for notifications of Calendar events + * @param aHandler the MCalenNotificationHandler to notify + * @param aNotifications array of notifications to be notified about + */ + virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, + RArray& aNotifications ); - /** - * Cancel notifications of Calendar events - * @param aHandler the MCalenNotificationHandler to stop notifying - */ - void CancelNotifications( MCalenNotificationHandler* aHandler ); + /** + * Cancel notifications of Calendar events + * @param aHandler the MCalenNotificationHandler to stop notifying + */ + void CancelNotifications( MCalenNotificationHandler* aHandler ); + + /** + * Issue a command to be handled by Calendar or a customization + * All commands will be handled asynchronously. Calendar may reject + * @param aCommand the command to be handled + * @return ETrue, if Calendar will attempt to handle the command + * @return EFalse, if Calendar will not attempt to handle the command + */ + TBool IssueCommandL( TInt aCommand ); - - /** - * Issue a notification to Calendar, which will be broadcast - * synchronously to all registered notification handlers. - * Only one notification may be issued at once. - * @param aNotification the notification to broadcast - */ - void IssueNotificationL( TCalenNotification aNotification ); - - /** - * Request activation of a specific view - * @param aViewId The view to be activated - */ - void RequestActivationL( const TVwsViewId& aViewId ); + /** + * Issue a notification to Calendar, which will be broadcast + * synchronously to all registered notification handlers. + * Only one notification may be issued at once. + * @param aNotification the notification to broadcast + */ + void IssueNotificationL( TCalenNotification aNotification ); + + /** + * Returns the context. This includes information such + * as the currently focused date/instance. + */ + MCalenContext& Context(); + + /** + * Request activation of a specific view + * @param aViewId The view to be activated + */ + void RequestActivationL( const TVwsViewId& aViewId ); + + /** + * Notify Calendar that a specific view has been activated. + * Custom views must call this on activation + * @param aViewId The view that was activated + */ + void ActivationNotificationL( const TVwsViewId& aViewId ); + + /** + * Offers the menu pane for population, interested parties can + * add or remove menu items + * @param aMenuPane meu pane to be populated + * @param aResourceId resource id of menu pane + */ + void OfferMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + /** + * Gets the command range that has been allocated to this MCalenServices + * instance + * + * @param aCommandRangeStart start of command range + * @param aCommandRangeEnd end of command range + */ + void GetCommandRange( TInt& aCommandRangeStart, + TInt& aCommandRangeEnd ) const; + + /** + * Offers a TRect to customisations for the creation of + * a control to be displayed in the infobar + * @return info bar control + */ + CCoeControl* Infobar( const TRect& aRect ); + + /** + * Customisation creates the text for display in infobar + * @return infobar Text + */ + const TDesC& Infobar( ); - /** - * Notify Calendar that a specific view has been activated. - * Custom views must call this on activation - * @param aViewId The view that was activated - */ - void ActivationNotificationL( const TVwsViewId& aViewId ); - - - /** - * Issue a command to be handled by Calendar or a customization - * All commands will be handled asynchronously. Calendar may reject - * @param aCommand the command to be handled - * @return ETrue, if Calendar will attempt to handle the command - * @return EFalse, if Calendar will not attempt to handle the command - */ - TBool IssueCommandL( TInt aCommand); - - /** - * Returns the context. This includes information such - * as the currently focused date/instance. - */ - MCalenContext& Context(); - /** - * a control to be displayed in the infobar - * @return info bar control - */ - HbWidget* Infobar(); - /** - * Returns info bar text - */ - QString* InfobarTextL(); - - /** - * Gets the command range that has been allocated to this MCalenServices - * instance - * - * @param aCommandRangeStart start of command range - * @param aCommandRangeEnd end of command range - */ - void GetCommandRange( TInt& aCommandRangeStart, - TInt& aCommandRangeEnd ) const; - - /** - * Offer the menu to Plugins to customisation - * @param aMenu Where the customisation apply to - */ - void OfferMenu(HbMenu* aHbMenu); - - /** - * returns the interface to the agenda database - * @return reference to agendainterface - */ - AgendaUtil* agendaInterface(); - - /** - * returns the first view with which calendar has been launched - * @return view Id - */ - int getFirstView(); - - private: - /** - * C++ constructor. - */ - CalenServicesImpl( TInt aCommandRangeStart, - TInt aCommandRangeEnd ); + MCalenPreview* CustomPreviewPaneL( TRect& aRect ); + /** + * Offers a TRect to available customisations for the creation of a + * control to be displayed in the preview pane + * @return preview pane control + */ + CCoeControl* PreviewPane( TRect& aRect ); + + /** + * Get a pointer to the Calendar toolbar, or NULL if none is available. + * Ownership is not transferred. + * @return Calendar toolbar if available + */ + MCalenToolbar* ToolbarOrNull(); + + /** + * Get Missed alarm store + * @return reference to Missed alarm store + */ + CMissedAlarmStore* MissedAlarmStore(); + + /** + * Get missed alarms list + * @return an array of missed alarms + */ + void GetMissedAlarmsList(RArray& aMissedAlarmList); + + /** + * Get attachment model + * @return CCalenAttachmentModel* pointer to CCalenAttachmentModel + */ + CCalenAttachmentModel* GetAttachmentData(); + + /** + * @brief Get all available calendar info + * + * @param returns the list of available calendar info iterating + * through all calendars + */ + void GetAllCalendarInfoL( + RPointerArray& aCalendarInfoList ); + + /** + * @brief get calendar file name for the collection id + * + * @param aCalendarFile reference to the calendar file name + * @param aCollectionId collection id of the session for + * which calendar file name is required + */ + const TDesC& GetCalFileNameForCollectionId(const TCalCollectionId aCollectionId); + +private: + /** + * C++ constructor. + */ + CCalenServicesImpl( TInt aCommandRangeStart, + TInt aCommandRangeEnd ); private: // Data + CCalenGlobalData* iGlobalData; CCalenController* iController; + TInt iCommandRangeStart; // start of the valid command range TInt iCommandRangeEnd; // end of the valid command range };