diff -r 96907930389d -r 12af337248b1 calendarui/globaldata/inc/calencontextimpl.h --- a/calendarui/globaldata/inc/calencontextimpl.h Thu Aug 19 09:53:43 2010 +0300 +++ b/calendarui/globaldata/inc/calencontextimpl.h Tue Aug 31 15:13:43 2010 +0300 @@ -11,12 +11,11 @@ * * Contributors: * -* Description: Implementation of calendar context. +* Description: Implementation of calendar context. * */ - #ifndef CALENCONTEXTIMPL_H #define CALENCONTEXTIMPL_H @@ -24,237 +23,150 @@ class MCalenContextChangeObserver; // INCLUDES -#include -#include // TCalenInstanceId -#include +#include "calencontext.h" +#include "caleninstanceid.h" #include -#include + +#ifdef CALENGLOBALDATA_DLL +#define CALENCONTEXTIMPL_EXPORT Q_DECL_EXPORT +#else +#define CALENCONTEXTIMPL_EXPORT Q_DECL_IMPORT +#endif // CLASS DEFINITIONS /** * The controller handles events from the rest of Calendar and delegates * them to the appropriate place (i.e. the action ui classes). */ -class CCalenContextImpl : public CBase, public MCalenContext +class CalenContextImpl : public MCalenContext { - -public: // Construction and destruction - - /** - * The only reason this should be created outside of this dll is for - * SCalenCommand, which needs a default constructor. Normal usage is - * to use the accessor from the global data. Attempting to call - * "setters" on any context not from the global data will panic. - */ - CCalenContextImpl( MCalenContextChangeObserver* aObserver ); - CCalenContextImpl(); - CCalenContextImpl( const CCalenContextImpl& aContext ); - ~CCalenContextImpl(); + public: // Construction and destruction + /** + * The only reason this should be created outside of this dll is for + * SCalenCommand, which needs a default constructor. Normal usage is + * to use the accessor from the global data. Attempting to call + * "setters" on any context not from the global data will panic. + */ + CALENCONTEXTIMPL_EXPORT CalenContextImpl( MCalenContextChangeObserver* observer ); + CALENCONTEXTIMPL_EXPORT CalenContextImpl(); + CALENCONTEXTIMPL_EXPORT CalenContextImpl( const CalenContextImpl& context ); + CALENCONTEXTIMPL_EXPORT ~CalenContextImpl(); -public: // from MCalenContext - + public: // from MCalenContext // Utils - /** - * Returns the default time for views. (Normally 8am.) This would be - * used for example by the month view, which sets the focus time to - * 8am on a day. Then when opening the week view, a sane time is shown. - */ - TTimeIntervalMinutes DefaultTimeForViews() const; + /** + * Returns the default time for views. (Normally 8am.) This would be + * used for example by the month view, which sets the focus time to + * 8am on a day. Then when opening the week view, a sane time is shown. + */ + int defaultTimeForViewsInMinnutes() const; - /** - * Returns the default TCalTime for views. (Normally 8am today.) This - * would be used for example when a view is the first view loaded in - * Calendar. - */ - TCalTime DefaultCalTimeForViewsL() const; + /** + * Returns the default TCalTime for views. (Normally 8am today.) This + * would be used for example when a view is the first view loaded in + * Calendar. + */ + QDateTime defaultCalTimeForViewsL() const; // Setters - /** - * Sets the date and time currently focused. - * @param aFocusTime The new focus date and time. - * @param aViewId The view id of the currently active view. - */ - void SetFocusDateAndTimeL( const TCalTime& aFocusDateTime, - const TVwsViewId& aViewId ); + /** + * Sets the date and time currently focused. + * @param aFocusTime The new focus date and time. + */ + void setFocusDateAndTime( const QDateTime& focusDateTime); - /** - * Sets the date currently focused. When retrieving the focus - * date and time after calling this function, the time component - * will be set to the default of view. When retrieving the focus - * time only, it will be set to -1. - * @param aFocusDate The new focus date and time. - * @param aViewId The view id of the currently active view. - */ - void SetFocusDateL( const TCalTime& aFocusDate, - const TVwsViewId& aViewId ); + /** + * Sets the date currently focused. When retrieving the focus + * date and time after calling this function, the time component + * will be set to the default of view. When retrieving the focus + * time only, it will be set to -1. + * @param aFocusDate The new focus date and time. + */ + void setFocusDate( const QDateTime& focusDateTime ); - /** - * Sets the id of the instance currently focused. - * @param aInstanceId the id of the focused instance. - * @param aViewId The view id of the currently active view. - */ - void SetInstanceIdL( const TCalenInstanceId& aInstanceId, - const TVwsViewId& aViewId ); + /** + * Sets the id of the instance currently focused. + * @param aInstanceId the id of the focused instance. + */ + void setInstanceId( const TCalenInstanceId& instanceId ); - /** - * Sets the time and instance currently focused. - * @param aFocusTime The new focus time. If no time is focused, set - * the Utc time of this object to be Time::NullTTime. - * @param aInstanceId the id of the focused instance. - * @param aViewId The view id of the currently active view. - */ - void SetFocusDateAndTimeAndInstanceL( const TCalTime& aFocusDateTime, - const TCalenInstanceId& aInstanceId, - const TVwsViewId& aViewId ); + /** + * Sets the time and instance currently focused. + * @param aFocusTime The new focus time. If no time is focused, set + * the Utc time of this object to be Time::NullTTime. + * @param aInstanceId the id of the focused instance. + */ + void setFocusDateAndTimeAndInstance( const QDateTime& focusDateTime, + const TCalenInstanceId& aInstanceId); // Getters - /** - * Gets the date and time currently focused. - * @return The currently focused date and time. When no time is - * focused, the default time on the current date will be returned. - */ - TCalTime FocusDateAndTimeL() const; - - /** - * Gets the time currently focused. - * @return The currently focused time. When no time is - * focused, -1 will be returned. - */ - TTimeIntervalMinutes FocusTime() const; - - /** - * Gets the id of the instance currently focused. - * @return The instance id currently focused. When no instance is focused, - * this will be TCalenInstanceId::NullInstanceIdL() - */ - TCalenInstanceId InstanceId() const; - - /** - * Gets the id of the currently active view. - * @return The view id of the currently active view. - */ - TVwsViewId ViewId() const; - -public: // Multiple Context support + /** + * Gets the date and time currently focused. + * @return The currently focused date and time. When no time is + * focused, the default time on the current date will be returned. + */ + QDateTime focusDateAndTime() const; - /** - * Set multiple context ids - * - * @param aMutlipleContextIds - */ - void SetMutlipleContextIds(RArray& aMutlipleContextIds); - - /** - * Remove multiple context id - * - * @param aInstanceId Instance Id for which context to be removed - */ - void RemoveMultipleContextId(TCalenInstanceId aInstanceId); - - /** - * Resets all the multiple context ids - * - */ - void ResetMultipleContextIds(TInt aDbId=0); + /** + * Gets the time currently focused. + * @return The currently focused time. When no time is + * focused, -1 will be returned. + */ + int focusTime() const; - /** - * Getter for multiple context ids - * - * @return RArray& - */ - RArray& GetMutlipleContextIds(TInt aDbId=0); - - /** - * Returns mutliple context's count - * - * @return - */ - TInt MutlipleContextIdsCount(); - - /** - * Sets the user selected landmark - * @param aLandMark Landmark object - */ - void SetLandMark(CPosLandmark* aLandMark); + /** + * Gets the id of the instance currently focused. + * @return The instance id currently focused. When no instance is focused, + * this will be TCalenInstanceId::NullInstanceIdL() + */ + TCalenInstanceId instanceId() const; - /** - * Returns the user selected landmark - * @return Landmark object - */ - CPosLandmark* GetLandMark(); - - /** - * Resets the landmark - */ - void ResetLandMark(); - - /** - * Allows extending this API without breaking BC. - * - * @param aExtensionUid specifies - * @return extension of the requested type - */ - TAny* CalenContextExtensionL( TUid aExtensionUid ); - - /** - * @brief Get calendar filename - * - * @return TDesC& reference to calendar filename - */ - TDesC& GetCalendarFileNameL() const; - - /** - * @brief Set the calendar filename - * - * @param aName referance to calendar file name - */ - void SetCalendarFileNameL(const TDesC& aName); - - /** - * @brief Resets calendar file name in context - */ - void ResetCalendarFileName(); - /** - * @brief Set calendar file name of Alarm entry in context - */ - void SetCalAlarmEntryFileNameL(const TDesC& aName); - - /** - * @brief Get calendar filename - * - * @return HBufC pointer to calendar filename of Alarm entry - */ - HBufC* GetCalAlarmEntryFileNameL() const; - - /** - * @brief Resets Alarm Entry calendar file name in context - */ - void ResetCalAlarmEntryFileName(); - - /** - * @brief set Alarm Entry LocalUid in context - */ - void SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId); - - /** - * @brief Get Alarm Entry LocalUid from context - */ - TCalLocalUid CalAlarmLocalUidL() const; - -private: // Data - MCalenContextChangeObserver* iObserver; - TCalTime iFocusDate; - TTimeIntervalMinutes iFocusTime; - TCalenInstanceId iInstanceId; - TVwsViewId iViewId; - CPosLandmark* iLandMark; - CCalGeoValue* iGeoValue; - HBufC* iLocation; - // Multiple context ids - RArray iMutlipleContextIds; - HBufC* iCalenFileName; - HBufC* iCalAlarmEntryFileName; - TCalLocalUid iCalAlarmLocalUid; + +public: // Multiple Context support + + /** + * Set multiple context ids + * + * @param aMutlipleContextIds + */ + void setMutlipleContextIds(QList& mutlipleContextIds); + + /** + * Remove multiple context id + * + * @param aInstanceId Instance Id for which context to be removed + */ + void removeMultipleContextId(TCalenInstanceId instanceId); + + /** + * Resets all the multiple context ids + * + */ + void resetMultipleContextIds(int dbId=0); + + /** + * Getter for multiple context ids + * + * @return RArray& + */ + QList& getMutlipleContextIds(int dbId=0); + + /** + * Returns mutliple context's count + * + * @return + */ + int mutlipleContextIdsCount(); + + private: // Data + MCalenContextChangeObserver* mObserver; + QDateTime mFocusDate; + int mFocusTime; + TCalenInstanceId mInstanceId; + int mViewId; + // Multiple context ids + QList mMutlipleContextIds; + }; #endif // CALENCONTEXTIMPL_H