/** * @file XTPCalendarView.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ #if !defined(_XTPCALENDARVIEW_H__) # define _XTPCALENDARVIEW_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCalendarControl; class CXTPCalendarPaintManager; class CXTPCalendarTheme; class CXTPCalendarViewDay; class CXTPCalendarViewEvent; class CXTPCalendarViewEvents; class CXTPCalendarEvent; class CXTPCalendarEvents; class CXTPCalendarViewPart; class CXTPCalendarResources; class CXTPCalendarData; class CXTPCalendarOptions; struct XTP_CALENDAR_HITTESTINFO; typedef DWORD XTP_NOTIFY_CODE; XTP_DEFINE_SMART_PTR_INTERNAL(CXTPCalendarEvent) XTP_DEFINE_SMART_PTR_INTERNAL(CXTPCalendarEvents) XTP_DEFINE_SMART_PTR_INTERNAL(CXTPCalendarViewEvent) XTP_DEFINE_SMART_PTR_INTERNAL(CXTPCalendarViewEvents) //////////////////////////////////////////////////////////////////////////// /** * @details * Timeout before appearing in the event subject editor window. */ # define XTP_CALENDAR_START_EDIT_SUBJECT_TIMEOUT_MS 400 /** * @details * Calendar events clipboard format name. */ static const LPCTSTR XTPCALENDARCTRL_CF_EVENT = _T("XTPCalendar_CF_Event"); enum XTPEnumCalendarUpdateResult { xtpCalendar_Skip = 0, xtpCalendar_Redraw = 1, xtpCalendar_Populate = 2 }; //=========================================================================== // use project settings to define _TRACE_EDITING_ON # ifdef _TRACE_EDITING_ON # define TRACE_MOUSE TRACE # define TRACE_KEYBOARD TRACE # define TRACE_DRAGGING TRACE # define TRACE_EDIT_SUBJECT TRACE # else # define TRACE_MOUSE # define TRACE_KEYBOARD # define TRACE_DRAGGING # define TRACE_EDIT_SUBJECT # endif //=========================================================================== /** * @brief * This class helps to handle Windows messages (WM_*) processing portion * of the Calendar control views. * * @details * All calendar views are derived from this class. When a message is * handled by main Calendar control window (CXTPCalendarControl class), * it is then forwarded down to views by hierarchy. * control -> day/week/month -> single day -> resource group -> event */ class _XTP_EXT_CLASS CXTPCalendarWMHandler : public CXTPCmdTarget { DECLARE_DYNAMIC(CXTPCalendarWMHandler) typedef CXTPCmdTarget TBase; public: /** * @brief * Default object constructor. */ CXTPCalendarWMHandler(); /** * @brief * This member function is used to obtain the number of * CXTPCalendarWMHandler elements in the descendant handlers collection. * * @details * Call this method to retrieve the number of elements in the array. * Because indexes are zero-based, the size is 1 greater than * the largest index. * * This number shows a count of single day views for a day/week/month * view, a number of resource groups for a single day view, a number * of event views for a resource group view, and so on. * * @return A count of descendant handlers. * * @see CXTPCalendarWMHandler overview */ virtual int GetChildHandlersCount() const; /** * @brief * Call this method to get a handler object at the specified numeric * index. * * @param nIndex An integer index that is greater than or equal to 0 * and less than the value returned by GetChildHandlersCount. * * @details * Returns the array element at the specified index. * * @return The pointer to the CXTPCalendarWMHandler element currently at this * index. */ virtual CXTPCalendarWMHandler* GetChildHandlerAt(int nIndex) const; /** * @brief * This member function is used to process left mouse button down events. * * @param nFlags An int that indicates whether various virtual keys are down. * @param point A CPoint object that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarView when the user * presses the left mouse button. */ virtual BOOL OnLButtonDown(UINT nFlags, CPoint point); /** * @brief * This member function is used to process left mouse button up events. * * @param nFlags An int that indicates whether various virtual keys are down. * @param point A CPoint object that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarView when the user * releases the left mouse button. */ virtual BOOL OnLButtonUp(UINT nFlags, CPoint point); /** * @brief * This member function is used to process left mouse button * double click events. * * @param nFlags An int that indicates whether various virtual keys are down. * @param point A CPoint object that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @details * This method is called by the CalendarView when the user * double clicks the left mouse button. * @return TRUE if the message is handled properly, FALSE otherwise. */ virtual BOOL OnLButtonDblClk(UINT nFlags, CPoint point); /** * @brief * This member function is used to process mouse movement events. * * @param nFlags A UINT that indicates whether various virtual keys are down. * @param point A CPoint object that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @details * This method is called by the CalendarView when the user * moves the mouse cursor or stylus. */ virtual void OnMouseMove(UINT nFlags, CPoint point); /** * @brief * This member function is used to process keyboard events. * * @param nChar A UINT that contains the character code value of the key. * @param nRepCnt A UINT that is used to count the number of times the * keystroke is repeated as a result of the user holding * down the key. * @param nFlags A UINT that contains the Scan code, key-transition code, * previous key state, and the context code. * * @details * This method is called by the CalendarControl when a keystroke * translates to a nonsystem character. */ virtual void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * This member function is used to process key-down keyboard events. * * @param nChar A UINT that specifies the virtual key code of the given key. * @param nRepCnt A UINT that specifies the number of times the keystroke * is repeated as a result of the user holding down the key. * @param nFlags A UINT that specifies the scan code, key-transition code, * previous key state, and the context code. * * @details * This method is called by the CalendarView when the user * presses keys on the keyboard. */ virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * This member function is used to process key-up keyboard events. * * @param nChar A UINT that specifies the virtual key code of the given key. * @param nRepCnt A UINT that specifies the number of times the keystroke * is repeated as a result of the user holding down the key. * @param nFlags A UINT that specifies the scan code, key-transition code, * previous key state, and the context code. * * @details * This method is called by the CalendarView when the user * releases keys on the keyboard. */ virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * This member function is used to process key-up keyboard events. * * @param nChar A UINT that specifies the virtual key code of the given key. * @param nRepCnt A UINT that specifies the number of times the keystroke * is repeated as a result of the user holding down the key. * @param nFlags A UINT that specifies the scan code, key-transition code, * previous key state, and the context code. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarView when the user * presses keys on the keyboard. */ virtual BOOL OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * The framework calls this member function after each interval * specified in the SetTimer member function. * * @param uTimerID A UINT that is used to specify the identifier * of the timer. * * @return TRUE if the message is handled properly, FALSE otherwise. */ virtual BOOL OnTimer(UINT_PTR uTimerID); /** * @brief * This method is called by framework after default message processing. * * @param message Specifies the message to be sent. * @param wParam Specifies additional message-dependent information. * @param lParam Specifies additional message-dependent information. * @param pResult The return value of WindowProc. Depends on the message; may be NULL. * * @return TRUE if the message is handled properly, FALSE otherwise. */ virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); /** * @brief * This member function is used to perform additional adjustments * in some kinds of views. * * @details * Call this member function to perform additional adjustments after * all adjustment activities are completed. */ virtual void OnPostAdjustLayout(); /** * @brief * This member function is called by the framework before destroying * the view. */ virtual void OnBeforeDestroy(); virtual void OnFinalRelease(); }; /** * @brief * This class represents the view portion of the Calendar control. * * @details * It represents a specific view of the Control's associated events * data and provides basic functionality on the data using user * input through the keyboard and mouse. * * The following predefined view implementations are available * for the Calendar control: * * * - Day and work week views : using CXTPCalendarDayView class. * - Week view : using CXTPCalendarWeekView class. * - Month view : using CXTPCalendarMonthView class. * * * Furthermore, any type of user-defined view can also be implemented as * a descendant of the CXTPCalendarView class. * * A typical Calendar View model consists of a collection of * corresponding ViewDay's, which realizes the contents on a square * of one day. ViewDay in its turn contains a collection of ViewEvent's * for the particular day, each of them represents a view of an * CXTPCalendarEvent object. * * @see CXTPCalendarDayView * @see CXTPCalendarWeekView * @see CXTPCalendarMonthView * @see CXTPCalendarViewDay * @see CXTPCalendarViewEvent */ class _XTP_EXT_CLASS CXTPCalendarView : public CXTPCalendarWMHandler { friend class CXTPCalendarControl; friend class CXTPCalendarViewDay; friend class CXTPCalendarViewEvent; friend class CXTPCalendarResource; friend class CXTPCalendarTheme; friend class CXTPCalendarDayViewGroup; DECLARE_DYNAMIC(CXTPCalendarView) typedef CXTPCalendarWMHandler TBase; private: CUIntArray m_DiscreteSelection; public: /** * @brief * This member function is used to get the number of selected events. * * @return A UINT that contains the number of selected events. */ UINT GetDiscreteSelectionCount() const; /** * @brief * This member function gets a selected event by using its event ordinal number. * * @param id event ordinal number. * * @return COleDateTime selected event. */ COleDateTime GetDiscreteSelectionValue(UINT id) const; /** * @brief * This member function adds an event to the selection by using its event ordinal number. * * @param id event ordinal number. * * @return TRUE if successful, otherwise FALSE. */ BOOL AddToDiscreteSelection(UINT id); /** * @brief * This member function checks if an event is in the selection. * * @param id event ordinal number. * * @return BOOL flag (TRUE if present in selection, FALSE otherwise). */ BOOL IsInDiscreteSelection(UINT id) const; /** * @brief * This member function is used to Clear Discrete Selection. */ void ClearDiscreteSelection(); /** * @brief * Default object constructor. * * @param pCalendarControl - A Pointer to a CXTPCalendarControl object. * * @see ~CXTPCalendarEvent() */ CXTPCalendarView(CXTPCalendarControl* pCalendarControl); /** * @brief * Default class destructor. * * @details * Handles member items deallocation. */ virtual ~CXTPCalendarView(); /** * @brief * Call this member function to obtain the view type flag. * * @details * This is a pure virtual function. This function must be defined * in the derived class. * * @return A XTPCalendarViewType view type flag. * * @see XTPCalendarViewType */ virtual XTPCalendarViewType GetViewType() const = 0; /** * @brief * This member function is used to populate the view with data * for all items contained in the view. */ virtual void Populate(); /** * @brief * This member function is used to adjust the view's layout * depending on the window client size and calls AdjustLayout() * for all sub-items. * * @param pDC Pointer to a valid device context. * @param rcView A CRect that contains the coordinates * for drawing the view. * @param bCallPostAdjustLayout A BOOL. This is a flag that is used to * call for additional adjustments. If TRUE, * then additional adjustments are performed * for multi-day events. If FALSE, then no * additional adjustments are made. * * @details * Call Populate() prior adjusting layout. * AdjustLayout2 is called by calendar control instead of AdjustLayout * when theme is set. */ virtual void AdjustLayout(CDC* pDC, const CRect& rcView, BOOL bCallPostAdjustLayout = TRUE); /** * @brief * This member function is used to adjust the view's layout * depending on the window client size and calls AdjustLayout() * for all sub-items. * * @param pDC Pointer to a valid device context. * @param rcView A CRect that contains the coordinates * for drawing the view. * @param bCallPostAdjustLayout A BOOL. This is a flag that is used to * call for additional adjustments. If TRUE, * then additional adjustments are performed * for multi-day events. If FALSE, then no * additional adjustments are made. * * @details * Call Populate() prior adjusting layout. * AdjustLayout2 is called by calendar control instead of AdjustLayout * when theme is set. */ virtual void AdjustLayout2(CDC* pDC, const CRect& rcView, BOOL bCallPostAdjustLayout = TRUE); /** * @brief * This member function is used to perform the redrawing of the * control's layout. * * @details * Call AdjystLayout() prior to redrawing the control. */ virtual void RedrawControl(); /** * @brief * This member function is used to show the specified day in the * calendar view. * * @param date A COleDateTime object that contains the date to show. * @param bSelect TRUE to select the specified day after showing, * FALSE otherwise. TRUE is the default value. * * @details * Call this member function to show only the specified day in the * calendar view. */ virtual void ShowDay(const COleDateTime& date, BOOL bSelect = TRUE) = 0; /** * @brief * Scroll vertically. * * @param nPos An int that contains the position value. * @param nPos_raw An int that contains the raw position value. * * @details * This member function is used to vertical scroll the contents * of the view. */ virtual void ScrollV(int nPos, int nPos_raw) { UNREFERENCED_PARAMETER(nPos); UNREFERENCED_PARAMETER(nPos_raw); } /** * @brief * Scroll horizontally. * * @param nPos An int that contains the position value. * @param nPos_raw An int that contains the raw position value. * * @details * This member function is used to horizontal scroll the contents * of the view. */ virtual void ScrollH(int nPos, int nPos_raw) { UNREFERENCED_PARAMETER(nPos); UNREFERENCED_PARAMETER(nPos_raw); } /** * @brief * This member function is used to force scroll to the end of the scroll range. * * @param nBar standard 0 - 1 values (for vertical or horizontal scrollbar). */ virtual void OnScrollEnd(int nBar) { UNREFERENCED_PARAMETER(nBar); } /** * @brief * This member function is used to retrieve the information about * a scroll bar state. * * @param pSI A SCROLLINFO pointer that contains information about the * current state of the scroll bar. * * @return A BOOL. The base class definition always returns FALSE. * The derived class definition should return TRUE if the function * is successful. Returns FALSE otherwise. */ virtual BOOL GetScrollBarInfoV(SCROLLINFO* pSI) const { UNREFERENCED_PARAMETER(pSI); return FALSE; } /** * @brief * This member function is used to retrieve the information about * a scroll bar state. * * @param pSI A SCROLLINFO pointer that contains information about the * current state of the scroll bar. * @param pnScrollStep A pointer to int to receive scroll step. Can be NULL. * * @return A BOOL. The base class definition always returns FALSE. * The derived class definition should return TRUE if the function * is successful. Return FALSE otherwise. */ virtual BOOL GetScrollBarInfoH(SCROLLINFO* pSI, int* pnScrollStep = NULL) const { UNREFERENCED_PARAMETER(pSI); UNREFERENCED_PARAMETER(pnScrollStep); return FALSE; } /** * @brief * This member function performs all of the drawing logic of the * calendar view. * * @param pDC Pointer to a valid device context. */ virtual void OnDraw(CDC* pDC); /** * @brief * This member function is used to draw the view content using the * specified device context. * * @param pDC A pointer to a valid device context. * * @details * Call AdjustLayout() before calling Draw(). * Draw2 is called from OnDraw instead of Draw when theme * is set. * * @see OnDraw * @see AdjustLayout */ virtual void Draw(CDC* pDC) { UNREFERENCED_PARAMETER(pDC); } /** * @brief * This member function is used to draw the view content using the * specified device context. * * @param pDC A pointer to a valid device context. * * @details * Call AdjustLayout() before calling Draw(). * Draw2 is called from OnDraw instead of Draw when theme * is set. * * @see OnDraw * @see AdjustLayout */ virtual void Draw2(CDC* pDC) { UNREFERENCED_PARAMETER(pDC); // Draw(pDC); } /** * @brief * This member function is used to process left mouse button events. * * @param nFlags A UINT that is used to indicates whether various virtual * keys are down. * @param point A CPoint that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarControl when the user * presses the left mouse button. */ virtual BOOL OnLButtonDown(UINT nFlags, CPoint point); /** * @brief * This member function is used to process left mouse button events. * * @param nFlags A UINT that is used to indicate whether various virtual keys are down. * @param point A CPoint that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarControl when the user * releases the left mouse button. */ virtual BOOL OnLButtonUp(UINT nFlags, CPoint point); /** * @brief * This member function is used to process mouse movement events. * * @param nFlags A UINT that is used to indicate whether various virtual * keys are down. * @param point A CPoint that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @details * This method is called by the CalendarControl when the user * moves the mouse cursor or stylus. */ virtual void OnMouseMove(UINT nFlags, CPoint point); /** * @brief * This member function is used to process mouse double-click events. * * @param nFlags A UINT that is used to indicate whether various virtual * keys are down. * @param point A CPoint that specifies the x- and y- coordinates of the cursor. * These coordinates are always relative to the * upper-left corner of the window. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarControl when the user * presses, releases, and then presses the left mouse button again * within the system's double-click time limit. */ virtual BOOL OnLButtonDblClk(UINT nFlags, CPoint point); /** * @brief * This member function is used to process keyboard events. * * @param nChar A UINT that contains the character code value of the key. * @param nRepCnt A UINT that is used to count the number of times the * keystroke is repeated as a result of the user holding * down the key. * @param nFlags A UINT that contains the Scan code, key-transition code, * previous key state, and the context code. * * @details * This method is called by the CalendarControl when a keystroke * translates to a nonsystem character. */ virtual void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * This member function is used to processes keyboard events. * * @param nChar A UINT that is used to identify the virtual key code * of the given key. * @param nRepCnt A UINT that is used to count the number of times the * keystroke is repeated as a result of the user holding * down the key. * @param nFlags A UINT that contains the Scan code, key-transition code, * previous key state, and the context code. * * @details * This method is called by the CalendarControl when the user * presses keys on the keyboard. */ virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * This member function is used to process system keyboard events. * * @param nChar A UINT that specifies the virtual key code of the given key. * @param nRepCnt A UINT that contains the number of times the keystroke is * repeated as a result of the user holding down the key. * @param nFlags A UINT that contains the scan code, key-transition code, * previous key state, and the context code. * * @return TRUE if the message is handled properly, FALSE otherwise. * * @details * This method is called by the CalendarControl when the user * presses keys on the keyboard. */ virtual BOOL OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); /** * @brief * Call this member function to obtain the view's bounding rectangle. * * @return A CRect object that contains the view's bounding rectangle coordinates. */ CRect GetViewRect() const; /** * @brief * This member function is used to obtain the number of * CXTPCalendarWMHandler elements in the descendant handlers collection. * * @details * Call this method to retrieve the number of elements in the array. * Because indexes are zero-based, the size is 1 greater than * the largest index. * * @return A count of descendant handlers. * * @see CXTPCalendarWMHandler overview */ virtual int GetChildHandlersCount() const; /** * @brief * Call this method to get a handler object at the specified numeric * index. * * @param nIndex An integer index that is greater than or equal to 0 * and less than the value returned by GetChildHandlersCount. * * @details * Returns the array element at the specified index. * * @return The pointer to the CXTPCalendarWMHandler element currently at this * index. */ virtual CXTPCalendarWMHandler* GetChildHandlerAt(int nIndex) const; /** * @brief * Call this member function to obtain the number of "day views" * in the view collection. * * @details * This is a pure virtual function. This function must be defined * in the derived class. * * @return An int that contains the the number of "day views" in the view * collection. */ virtual int GetViewDayCount() const; /** * @brief * Call this member function to obtain the date of the day view by * the day's index. * * @param nIndex An int that contains the day view index in the view collection. * * @details * Indexed number starts from 0 and cannot be negative. * This is a pure virtual function. This function must be defined * in the derived class. * * @return A COleDateTime object that contains the day view date and time. * * @see GetViewDayCount() */ virtual COleDateTime GetViewDayDate(int nIndex) const = 0; /** * @brief * Call this member function to obtain the CXTPCalendarViewDay object * by the day's index. * * @param nIndex An int that is used as the day view index in the view collection. * * @details * Index numbers start with 0 and cannot be negative. * This is a pure virtual function. This function must be defined * in the derived class. * * @return A pointer to a CXTPCalendarViewDay object. * * @see GetViewDayCount() */ virtual CXTPCalendarViewDay* GetViewDay_(int nIndex) const; /** * @brief * Call this member function to obtain the CXTPCalendarViewDay object * by the day's index. * * @param dtDay A day date to find. * * @details * Index numbers start with 0 and cannot be negative. * This is a pure virtual function. This function must be defined * in the derived class. * * @return A pointer to a CXTPCalendarViewDay object. * * @see GetViewDayCount() */ virtual CXTPCalendarViewDay* _GetViewDay(const COleDateTime& dtDay) const; /** * @brief * This member function is used to determines which view item, * if any, is at a specified position index, and returns additional * information in the XTP_CALENDAR_HITTESTINFO argument. * * @param pt A CPoint that contains the coordinates of the point to test. * @param pHitTest A pointer a XTP_CALENDAR_HITTESTINFO structure. * * @details * This is a pure virtual function. This function must be defined * in the derived class. * * @return A BOOL. TRUE if the item is found. FALSE otherwise. * * @see XTP_CALENDAR_HITTESTINFO */ virtual BOOL HitTest(CPoint pt, XTP_CALENDAR_HITTESTINFO* pHitTest) const; /** * @brief * This member function is used to determine which view item, * if any, is at a specified position index, and returns additional * info in an XTP_CALENDAR_HITTESTINFO object. * * @param pt A CPoint object that contains the coordinates of the * point to test. * @param pHitTest A pointer to the template parameter XTP_CALENDAR_HITTESTINFO * object that contains information on the point * to test. * * @return TRUE if item found; FALSE otherwise. */ virtual BOOL HitTestEx(CPoint pt, XTP_CALENDAR_HITTESTINFO* pHitTest) const; /** * @brief * Call this member function to determine the current dragging mode. * * @return An XTPCalendarDraggingModeFlag object that contains the current * dragging mode. * * @see XTPCalendarDraggingMode */ virtual XTPCalendarDraggingMode GetDraggingMode() const; /** * @brief * Call this member function to obtain the PaintManager object. * * @return A pointer to the CXTPCalendarPaintManager object. * * @see CXTPCalendarPaintManager * @see GetTheme */ virtual CXTPCalendarPaintManager* GetPaintManager() const; /** * @brief * This member function obtains a pointer to the associated theme * object. * * @details * It calls the CXTPCalendarControl::GetTheme() method. * * @return A CXTPCalendarTheme pointer to the associated theme object or NULL. * * @see CXTPCalendarControl::GetTheme * @see GetPaintManager */ virtual CXTPCalendarTheme* GetTheme() const; /** * @brief * Call this member function to obtain a pointer to the Calendar * Control object. * * @return A pointer to the CXTPCalendarControl object. * * @see CXTPCalendarControl */ CXTPCalendarControl* GetCalendarControl() const; /** * @brief * Call this member function to get direct access to calendar options * data. * * @details * This member function wraps the CXTPCalendarData::GetCalendarOptions() * method. If you read or change returned structure members, then * no additional checks are made and no notifications are sent. * The preferred way is to use CXTPCalendarControl options methods * like GetWorkWeekMask(), SetWorkWeekMask(), GetFirstDayOfWeek(), * SetFirstDayOfWeek(), ... etc. * * @return A pointer to the calendar options data class CXTPCalendarOptions. * * @see CXTPCalendarOptions * @see CXTPCalendarData::GetCalendarOptions() */ CXTPCalendarOptions* GetCalendarOptions() const; /** * @brief * Call this member function to obtain a pointer to the associated * Calendar Resources collection object. * * @return A pointer to the CXTPCalendarResources collection object. * * @see CXTPCalendarResources overview * @see CXTPCalendarResource overview */ virtual CXTPCalendarResources* GetResources() const; /** * @brief * This member function sets the new Resources collection for the view. * * @param pResources A pointer to the CXTPCalendarResources collection object. * * @details * Call this member function to programmatically set the new * Resources collection for the view. */ virtual void SetResources(CXTPCalendarResources* pResources); /** * @brief * Call this member function to un-select all of the events of the * current view. */ virtual void UnselectAllEvents(); /** * @brief * This member function is used to select or un-select the provided event. * * @param pEvent A pointer to the CXTPCalendarEvent object. * @param bSelect A BOOL. If TRUE, then select the event. * If FALSE, then un-select the event. * * @details * This method doesn't redraw control's window in order to avoid * blinking when executed in groups (like selecting a number of events). * So far, you'll have to call Calendar.RedrawControl after that. * * @see SelectViewEvent() * @see CXTPCalendarEvent */ virtual void SelectEvent(CXTPCalendarEvent* pEvent, BOOL bSelect = TRUE); /** * @brief * This member function is used to select or un-select the provided event. * * @param pViewEvent A pointer to the CXTPCalendarViewEvent object. * @param bSelect A BOOL. If TRUE, then select the event. * If FALSE, then un-select the event. * * @details * This method doesn't redraw control's window in order to avoid * blinking when executed in groups (like selecting a number of events). * So far, you'll have to call Calendar.RedrawControl after that. * * @see SelectEvent() * @see CXTPCalendarViewEvent */ void SelectViewEvent(CXTPCalendarViewEvent* pViewEvent, BOOL bSelect = TRUE); /** * @brief * This member function is used to select or un-select the provided * day, including all of the day's events. * * @param pDay A pointer to a CXTPCalendarViewDay object. * @param nGroupIndex A group index to select. * * @see CXTPCalendarViewDay * @see SelectDay(COleDateTime dtSelDay, BOOL bSelect) */ virtual void SelectDay(CXTPCalendarViewDay* pDay, int nGroupIndex = 0); /** * @brief * Call this member function to obtain a pointer to a selected * event's views. * * @details * This method may return a few event views instances for one event. * (multi-day events have a separate view event object for each day). * * @return A pointer to a CXTPCalendarViewEvents object that contains the * selected event's views. * * @see CXTPCalendarViewEvents * @see CXTPCalendarViewDay * @see SelectDay(COleDateTime dtSelDay, BOOL bSelect) * @see GetSelectedEvents() */ virtual CXTPCalendarViewEvents* GetSelectedViewEvents() const; /** * @brief * Call this member function to obtain a pointer to a selected * event's views collection. * * @details * This method returns one event view instance for one event. * (multi-day events have a separate view event object for each day). * * @return A smart pointer to a CXTPCalendarEvents object that contains the * selected events. * * @see GetSelectedViewEvents() * @see CXTPCalendarViewEvents */ virtual CXTPCalendarViewEventsPtr GetSelectedEvents() const; /** * @brief * This member function is used to obtain the last selected event view. * * @return A pointer to the last selected event view or NULL. * * @see CXTPCalendarViewEvent * @see GetSelectedViewEvents() */ CXTPCalendarViewEvent* GetLastSelectedViewEvent() const; /** * @brief * Call this member function to determine if any view event is selected. * * @return TRUE if any view event is selected, FALSE otherwise. * * @see GetSelectedViewEvents */ virtual BOOL HasSelectedViewEvent() const; /** * @brief * This member function is used to determine if just one event is selected. * * @return TRUE - if only one event is selected, * FALSE - if no events are selected or if more than one event is selected. * * @see GetSelectedViewEvents() * @see SelectViewEvent() * @see SelectEvent() */ BOOL IsSingleEventSelected() const; /** * @brief * This member function is used to obtain the last selected day index. * * @return Index of the last selected day or -1. * * @see GetLastSelectedDate() */ int FindLastSelectedDay() const; /** * @brief * This member function is used to obtain the last selected day date. * * @return Date of the last selected day or the middle view day date. * * @see FindLastSelectedDay() * @see GetSelection() * @see SetSelection() */ COleDateTime GetLastSelectedDate() const; /** * @brief * This member function is used to obtain the view's selection. * * @param pBegin A pointer to the COleDateTime object * that contains the beginning of the selection. * @param pEnd A pointer to the COleDateTime object * that contains the ending of the selection. * @param pbAllDayEvent A pointer to the BOOL variable * that contains the AllDayEvent attribute of * the selection (used in the day view only). * @param pnGroupIndex A pointer to int to receive group index. * @param pspSelectionResolution A pointer to the COleDateTimeSpan * object that contains the selection unit * length. (i.e. 1 day, 1 Hour, ... 5 min) * * @details * Call this member function to fill the provided COleDateTime * objects with the values of the selection beginning, ending, * and selection unit length. * * @return * A BOOL. TRUE if the selection is returned successfully. * FALSE otherwise. */ virtual BOOL GetSelection(COleDateTime* pBegin = NULL, COleDateTime* pEnd = NULL, BOOL* pbAllDayEvent = NULL, int* pnGroupIndex = NULL, COleDateTimeSpan* pspSelectionResolution = NULL) const; /** * @brief * This member function sets the new selection for the view. * * @param dtBegin Selection beginning time. * @param dtEnd Selection ending time. * @param bAllDayEvent Selection AllDayEvent attribute (used in the day view only). * @param nGroupIndex A group index. * * @details * Call this member function to programmatically set the new * selection beginning and ending for the view. */ void SetSelection(const COleDateTime& dtBegin, const COleDateTime& dtEnd, BOOL bAllDayEvent = FALSE, int nGroupIndex = 0); /** * @brief * This member function resets the current selection - set it empty. * * @details * Call this member function to programmatically clear the current * selection. */ void ResetSelection(); /** * @brief * This member function is used to determine if a date time value * is contained inside the selection. * * @param date A COleDateTime object that contains a date time value. * @param nGroupIndex A group index or -1 for any group. * @param pbAllDaySelection A pointer to BOOL to receive is selection All Day. * * @return TRUE - If date is contained inside the selection. * FALSE otherwise. */ BOOL SelectionContains(COleDateTime date, int nGroupIndex = -1, BOOL* pbAllDaySelection = NULL); /** * @brief * This member function is used to select or un-select the day * identified by the provided date. * * @param dtSelDay A COleDateTime object that contains a date time value. * @param nGroupIndex A group index to select. * * @see CXTPCalendarViewDay * @see SelectDay */ virtual void SelectDay(COleDateTime dtSelDay, int nGroupIndex = 0); /** * @brief * Call this member function to determine the row height required * to display the event. * * @return An int that contains the height of the row required to display a * single event. */ virtual int GetRowHeight() const; /** * @brief * Call this member function to get the collection of the day's * events. * * @param pRC A pointer to calendar resource object. * @param dtDay A COleDateTime object that contains the day's date. * * @return A pointer to a CXTPCalendarEvents object that contains the * collection of the day's events. * * @see CXTPCalendarEvents */ virtual CXTPCalendarEventsPtr RetrieveDayEvents(CXTPCalendarResource* pRC, COleDateTime dtDay); /** * @brief * Call this member function to determine if the subject is in an * editable mode. * * @return A BOOL. TRUE if the subject is ready for editing. FALSE otherwise. */ virtual BOOL IsEditingSubject() const; /** * @brief * Call this member function to obtain the bounding rectangle of * the subject editor. * * @return A CRect object that contains the current coordinates of the * subject editor. */ virtual CRect GetSubjectEditorRect() const; /** * @brief * Call this member function to obtain the bounding rectangle of * the tooltip space (currently this is only "click to add new appointment"). * Tooltip rectangle is calculated basing on the current mouse position * * @param ptHit CPoint& of mouse position. * @param hitInfo XTP_CALENDAR_HITTESTINFO. * * @return A CRect object with relative coordinates of the tooltip. */ virtual CRect GetTooltipRect(const CPoint& ptHit, const XTP_CALENDAR_HITTESTINFO& hitInfo) const; /** * @brief * This member function is used to show/hide a ToolTip rectangle. * * @param bShow TRUE to show a tooltip, FALSE to hide it. */ virtual void ShowToolTip(BOOL bShow = TRUE); /** * @brief * This member function is used to obtain the timeout value for * displaying a tooltip. * * @return A UINT that contains the timeout value in milliseconds. */ virtual UINT GetShowToolTipTimeOut() const; /** * @brief * Call this member function to set the new subject text for the * editing event. * * @param strNewSubject New subject value. */ virtual void OnUpdateEditingSubject(CString strNewSubject); /** * @brief * Call this member function to determine if you can perform an * undo operation for the subject editor. * * @return A BOOL. TRUE if there is the possibility to perform an undo * operation. FALSE otherwise. */ virtual BOOL CanUndo() const; /** * @brief * Call this member function to determine if a redo operation is * possible for the subject editor. * * @return A BOOL. TRUE if it is possible to perform a redo operation on * the subject-editor. FALSE otherwise. */ virtual BOOL CanRedo() const; /** * @brief * This member function is used to perform an Undo operation. * * @return A BOOL. TRUE if the undo operation is successful. FALSE otherwise. */ virtual BOOL Undo(); /** * @brief * This member function is used to perform a Redo operation. * * @return A BOOL. TRUE if the redo operation is successful. FALSE otherwise. */ virtual BOOL Redo(); /** * @brief * This member function is used to erase the undo buffer. */ virtual void EmptyUndoBuffer(); /** * @brief * This member function is used to format the time using the provided * format. * * @param dtTime Date-time value to format time part. * * @return A CString object containing the formatted time string. */ virtual CString FormatEventTime(COleDateTime dtTime) const; /** * @brief * This member function is used to set custom time format for view. * Events will use this format to show their times. * * @param strFormat format string specification. * h Hours with no leading zero for single-digit hours; 12-hour clock * hh Hours with leading zero for single-digit hours; 12-hour clock * H Hours with no leading zero for single-digit hours; 24-hour clock * HH Hours with leading zero for single-digit hours; 24-hour clock * m Minutes with no leading zero for single-digit minutes * mm Minutes with leading zero for single-digit minutes * s Seconds with no leading zero for single-digit seconds * ss Seconds with leading zero for single-digit seconds * t One character time marker string, such as A or P * tt Multi-character time marker string, such as AM or PM */ void SetCustomTimeFormat(const CString& strFormat); /** * @brief * Reset custom time format to default. */ void ResetCustomTimeFormat(); /** * @brief * Call this member function to determine the current format string. * * @return A CString object that contains the format string. */ virtual CString GetDayHeaderFormat() const; /** * @brief * Call this member function to set the day header format. * * @param sFmt A CString object that contains the format string. */ virtual void SetDayHeaderFormat(LPCTSTR sFmt); /** * @brief * Call this member function to determine if it is possible to * perform a Cut operation. * * @details * This member function is used to determine the possibility of * performing a Cut operation in the subject editor. * * @return A BOOL. TRUE if the cut operation is possible. FALSE otherwise. */ virtual BOOL CanCut() const; /** * @brief * Call this member function to determine if it is possible to * perform a Copy operation. * * @details * This member function is used to determine the possibility of * performing a Copy operation in the subject editor. * * @return A BOOL. TRUE if the copy operation is possible. FALSE otherwise. */ virtual BOOL CanCopy() const; /** * @brief * Call this member function to determine if it is possible to * perform a Paste operation. * * @details * This member function is used to determine the possibility of * performing a Paste operation in the subject editor. * * @return A BOOL. TRUE if the paste operation is possible. FALSE otherwise. */ virtual BOOL CanPaste() const; /** * @brief * This member function is used to perform a Cut operation. * * @details * Call this member function to perform a Cut operation in the subject * editor's window. * * @return A BOOL. TRUE if the cut operation is successful. FALSE otherwise. */ virtual BOOL Cut(); /** * @brief * This member function is used to perform a Copy operation. * * @details * Call this member function to perform a Copy operation in the * subject editor's window. * * @return A BOOL. TRUE if the copy operation is successful. FALSE otherwise. */ virtual BOOL Copy(); /** * @brief * This member function is used to perform a Paste operation. * * @details * Call this member function to perform a Paste operation in the * subject editor's window. * * @return A BOOL. TRUE if the paste operation is successful. FALSE otherwise. */ virtual BOOL Paste(); /** * @brief * This member function is used to obtain the event object before * the start of the event editing (dragging). * * @return A pointer to a CXTPCalendarEvent object before the start the * event editing or NULL. */ virtual CXTPCalendarEvent* GetDraggingEventOrig() const; /** * @brief * This member function is used to obtain the event object that * is currently being edited. (i.e. dragging) * * @return A pointer to a CXTPCalendarEvent object or NULL. */ virtual CXTPCalendarEvent* GetDraggingEventNew() const; /** * @brief * This member function is used to prepare the event to event editing * (dragging) operation. * * @return A BOOL. TRUE if the event editing is successful. FALSE otherwise. * * @param pEventOrig Pointer to an initial event for the dragging. */ virtual BOOL SetDraggingEvent(CXTPCalendarEvent* pEventOrig); /** * @brief * This member function is used to commit the event editing * (dragging) operation. * * @return A BOOL. TRUE if the event editing is successful. FALSE otherwise. */ virtual BOOL CommitDraggingEvent(); /** * @brief * This member function is used to cancel the event editing * (dragging) operation. */ virtual void CancelDraggingEvent(); /** * @brief * This member function is used to start the event editing (dragging). * * @param point A CPoint that contains the mouse position with the * coordinates to start the event editing (dragging). * @param pHitTest A pointer to an XTP_CALENDAR_HITTESTINFO struct that * contains the HitTest results from a specified point. */ virtual void OnStartDragging(CPoint point, XTP_CALENDAR_HITTESTINFO* pHitTest); /** * @brief * This member function is used to perform the event editing * (dragging) operation step. * * @param point A CPoint that contains the mouse position coordinates. * @param pHitTest A pointer to an XTP_CALENDAR_HITTESTINFO struct that * contains the HitTest results from the specified point. * * @return TRUE if the operation is successful, FALSE otherwise. */ virtual BOOL OnDragging(CPoint point, XTP_CALENDAR_HITTESTINFO* pHitTest); /** * @brief * This member function is used to finish the event editing * (dragging) operation. * * @param point A CPoint that contains the mouse position coordinates. * @param pHitInfo A pointer to an XTP_CALENDAR_HITTESTINFO struct that contains * the HitTest results from the specified point. * * @return TRUE if the operation is successful, FALSE otherwise. */ virtual BOOL OnEndDragging(CPoint point, XTP_CALENDAR_HITTESTINFO* pHitInfo); /** * @brief * This member function is used to start the event subject editing. * * @param pViewEvent A pointer to a CXTPCalendarViewEvent event view * that is used to edit the subject. */ virtual void StartEditSubject(CXTPCalendarViewEvent* pViewEvent); /** * @brief * This member function is used to finish the event subject editing. * * @param eAction An XTPCalendarEndEditSubjectAction object that * contains the value to commit or cancel the operation. * See enum XTPCalendarEndEditSubjectAction. * @param bUpdateControl A BOOL. If TRUE, then redraw the control immediately, * otherwise perform only the specified action * without redrawing. */ virtual void EndEditSubject(XTPCalendarEndEditSubjectAction eAction, BOOL bUpdateControl = TRUE); /** * @brief * This member function is used to obtain the time value after * a mouse click event in the subject editing window. * * @return A UINT that contains the timeout value in milliseconds before * the start event subject editing. */ virtual UINT GetStartEditSubjectTimeOut() const; /** * @brief * This member function is used to create a new event and start * subject editing. * * @param pcszInitialSubject A pointer to the string which contains the initial * subject value for the new event (generally initial * char). */ virtual void StartEditNewEventInplace(LPCTSTR pcszInitialSubject); /** * @brief * This member function is used to obtain the event view object * for the specified event and day. * * @param pEvent A CXTPCalendarEvent object that contains the value * to search for. * @param dtDay A COleDateTime object that contains the day that * corresponds to the event object. * * @return A CXTPCalendarViewEvent object that contains the view object or NULL. */ virtual CXTPCalendarViewEvent* FindViewEvent(CXTPCalendarEvent* pEvent, COleDateTime dtDay) const; virtual CXTPCalendarViewEvent* FindViewEventByGroup(CXTPCalendarEvent* pEvent, COleDateTime dtDay, int nScheduleID) const; /** * @brief * This member function is used to obtain the next event view * object used for editing events by pressing the TAB key. * * @param dtMinStart A COleDateTime object that contains the first * date and time to start the search. * @param bReverse If TRUE the reverse order is used, otherwise normal is used. * @param pAfterEvent A CXTPCalendarEvent object that contains the * last event object to search for. * * @return A CXTPCalendarViewEvent object that contains the view object or NULL. * * @see GetNextTimeEditByTAB * @see UpdateNextTimeEditByTAB */ virtual CXTPCalendarViewEvent* FindEventToEditByTAB(COleDateTime dtMinStart, BOOL bReverse, CXTPCalendarEvent* pAfterEvent = NULL); /** * @brief * This member function is used to obtain the next date and time * to start the find event view for editing events using the TAB key. * * @return A COleDateTime object that contains the next date and time. * * @see FindEventToEditByTAB * @see UpdateNextTimeEditByTAB */ virtual COleDateTime GetNextTimeEditByTAB() const; /** * @brief * This member function is used to set the next date and time to * start the find event view for editing events using the TAB key. * * @param dtNext A COleDateTime object that contains the next date and * time to start the find event view. * @param bReverse If TRUE the reverse order is used, otherwise normal is used. * @param bReset If TRUE the next time is set to the start (or end) * iteration position. * * @see GetNextTimeEditByTAB * @see FindEventToEditByTAB */ virtual void UpdateNextTimeEditByTAB(COleDateTime dtNext, BOOL bReverse, BOOL bReset = FALSE); /** * @brief * This member function is used to process the days selection that * are selected with the mouse. * * @param pInfo A pointer to a XTP_CALENDAR_HITTESTINFO struct that contains * HitTest information about the current mouse position. * @param nFlags A UINT that contains the current state of the additional * mouse and keyboard buttons. Like MK_SHIFT, ... * * @see SelectDays */ virtual void ProcessDaySelection(XTP_CALENDAR_HITTESTINFO* pInfo, UINT nFlags); /** * @brief * This member function is used to change the days selection depending * on the previous state of the selection. * * @param dtNewSel A COleDateTime object that contains the day date where * the selection has moved. */ virtual void SelectDays(COleDateTime dtNewSel); /** * @brief * This member function is used to process events that are selected * with the mouse. * * @param pInfo A pointer to an XTP_CALENDAR_HITTESTINFO struct that contains * HitTest information about current mouse position. * @param nFlags A UINT that contains the current state of the additional * mouse and keyboard buttons. Like MK_SHIFT, ... */ virtual void ProcessEventSelection(XTP_CALENDAR_HITTESTINFO* pInfo, UINT nFlags); /** * @brief * This member function(s) is used to disable or enable vertical or * horizontal scrolling of the view (by date or time). * * @param bEnable Set TRUE to enable scrolling, FALSE to disable. * * @details * Vertical and horizontal scrolling are enabled by default. */ virtual void EnableVScroll(BOOL bEnable = TRUE); /** * @brief * This member function(s) is used to disable or enable vertical or * horizontal scrolling of the view (by date or time). * * @param bEnable Set TRUE to enable scrolling, FALSE to disable. * * @details * Vertical and horizontal scrolling are enabled by default. */ virtual void EnableHScroll(BOOL bEnable = TRUE); /** * @brief * This member function(s) is used to obtain the status of the vertical or * horizontal scrolling features of the view (by date or time). * * @return TRUE if scrolling enabled, FALSE otherwise. */ virtual BOOL IsHScrollEnabled() const; /** * @brief * This member function(s) is used to obtain the status of the vertical or * horizontal scrolling features of the view (by date or time). * * @return TRUE if scrolling enabled, FALSE otherwise. */ virtual BOOL IsVScrollEnabled() const; /** * @brief * This member function(s) is used to set the date format string for the * day view. * * @param pcszCustomFormat Date format string. * * @details * Long, Middle, Short and Shortest format strings are used for * different header widths. Calendar control selects the longest format * which can be drawn for active day header width. * By default these format strings are built using locale settings * and SetDayHeaderFormatXXX methods should be used to customize * default settings. */ virtual void SetDayHeaderFormatLong(LPCTSTR pcszCustomFormat); /** * @brief * This member function(s) is used to set the date format string for the * day view. * * @param pcszCustomFormat Date format string. * * @details * Long, Middle, Short and Shortest format strings are used for * different header widths. Calendar control selects the longest format * which can be drawn for active day header width. * By default these format strings are built using locale settings * and SetDayHeaderFormatXXX methods should be used to customize * default settings. */ virtual void SetDayHeaderFormatMiddle(LPCTSTR pcszCustomFormat); /** * @brief * This member function(s) is used to set the date format string for the * day view. * * @param pcszCustomFormat Date format string. * * @details * Long, Middle, Short and Shortest format strings are used for * different header widths. Calendar control selects the longest format * which can be drawn for active day header width. * By default these format strings are built using locale settings * and SetDayHeaderFormatXXX methods should be used to customize * default settings. */ virtual void SetDayHeaderFormatShort(LPCTSTR pcszCustomFormat); /** * @brief * This member function(s) is used to set the date format string for the * day view. * * @param pcszCustomFormat Date format string. * * @details * Long, Middle, Short and Shortest format strings are used for * different header widths. Calendar control selects the longest format * which can be drawn for active day header width. * By default these format strings are built using locale settings * and SetDayHeaderFormatXXX methods should be used to customize * default settings. */ virtual void SetDayHeaderFormatShortest(LPCTSTR pcszCustomFormat); /** * @brief * Call this member function to determine if Today is visible. * * @return A BOOL. TRUE if Today is visible, FALSE otherwise. */ virtual BOOL IsTodayVisible() const; /** * @brief * This member function is called by the calendar framework to retrieve * an event time string of maximum length (to reserve space). * * @return A maximum time string. */ virtual CString GetItemTextEventTimeMax() const; /** * @brief * This member function creates the day header format string. * * @param pDC Pointer to a valid device context. * @param nWidth An int that contains the day header width in pixels. * @param pTextFont A pointer to a CFont object that is * used to calculate the text dimensions. * * @details * Call this member function to create a day header format * string based on the current locale. */ virtual void CalculateHeaderFormat(CDC* pDC, int nWidth, CFont* pTextFont); COleDateTime GetDateTimeDay(const COleDateTime& dt, BOOL bWholeDayEvent) const; protected: /** * @brief * This member function is used to create a timer event. * * @param uTimeOut_ms A UINT that contains the duration of the timer * event in milliseconds. * * @return A UINT that contains the identifier of the timer. */ virtual UINT SetTimer(UINT uTimeOut_ms); /** * @brief * This member function is used to destroy a timer event. * * @param uTimerID A UINT that is used to specify the identifier of the timer. */ virtual void KillTimer(UINT uTimerID); /** * @brief * The framework calls this member function after each interval * specified in the SetTimer member function. * * @param uTimerID A UINT that is used to specify the identifier * of the timer. * @return TRUE if the message is handled properly, FALSE otherwise. */ virtual BOOL OnTimer(UINT_PTR uTimerID); /* * @brief * This member function is used to perform additional adjustments * in some kinds of views. * * @details * Call this member function to perform additional adjustments after * all adjustment activities are completed. */ // virtual void OnPostAdjustLayout(); /** * @brief * This member function is called by the framework before destroying * the view. */ virtual void OnBeforeDestroy(); /** * @brief * This member function is called by the framework view when it is activated * or deactivated. * * @param bActivate Indicates whether the view is being activated or * deactivated. * @param pActivateView Points to the view object that is being activated. * @param pInactiveView Points to the view object that is being deactivated. * * @details * Override this member function to handle activated/deactivated * events. * * @see CXTPCalendarControl::SwitchActiveView(XTPCalendarViewType eView) * @see CXTPCalendarControl::SetActiveView(CXTPCalendarView* pView) */ virtual void OnActivateView(BOOL bActivate, CXTPCalendarView* pActivateView, CXTPCalendarView* pInactiveView); /** * @brief * This member function is used to send a notification from the * parent Calendar control. * * @param EventCode An XTP_NOTIFY_CODE that contains the specific * code of the event. * @param wParam A DWORD that contains the first custom parameter. * Depends on the event type. See specific event description * for details. * @param lParam A DWORD that contains the second custom parameter. * Depends on the event type. See specific event description * for details. * * @details * This member function is called internally from inside the * class when a notification is sent to all listeners. * * @see XTP_NOTIFY_CODE */ virtual void SendNotification(XTP_NOTIFY_CODE EventCode, WPARAM wParam = 0, LPARAM lParam = 0); /** * @brief * This member function is used to create the time format string. * * @details * Call this member function to create the time format string * based on the current locale. */ virtual void _CalculateEventTimeFormat(); /** * @brief * This function is used to calculate the max width of the date * used in the specified format string. * * @param pDC Pointer to a valid device context. * @param strFormat A CString that contains the date format string. * @param bMonth A BOOL. If TRUE, then calculate the max width for * all the months in a year, otherwise calculate the * max width for all week days. * * @details * Use this member function to calculate the header format width. * * @return A CString containing the name of the month or the name of the * day of the week that has the maximum width. */ virtual CString _GetMaxWidthFormat(CDC* pDC, CString strFormat, BOOL bMonth) const; /** * @brief * This member function is used to calculate, in pixels, the max * date width for the specified format string. * * @param pDC A pointer to a valid device context. * @param strFormat A CString that contains the date format string. * * @details * Use this member function to calculate the maximum width of the * date string. * * @return An int that contains the maximum date width, in pixels. */ virtual int _GetMaxWidth(CDC* pDC, CString strFormat) const; /** * @brief * This member function is used to remove the year part from the * specified format string. * * @param strFormat [IN/OUT] A CString object that contains the date * format string reference. * * @details * This member function is used to calculate the header format. */ virtual void _RemoveYearPart(CString& strFormat); /** * @brief * This member function is used to build day header date format * default strings. * * @details * This member function read locale settings and fill * m_strDayHeaderFormatDefaultXXX members. * * @see CalculateHeaderFormat() * @see m_strDayHeaderFormatDefaultLong * @see m_strDayHeaderFormatDefaultMiddle * @see m_strDayHeaderFormatDefaultShort * @see m_strDayHeaderFormatDefaultShortest */ virtual void _ReadDefaultHeaderFormats(); /** * @brief * This member function gets a custom or default day header date format * string. * * @param nLevel Format width level: * 0 - Long, * 1 - Middle, * 2 - Short, * 3 - Shortest. * * @details * Returns m_strDayHeaderFormatXXX member value if is not empty, * otherwise m_strDayHeaderFormatDefaultXXX member value is returned. * * @return Active header date format string for the specified width level. * * @see m_strDayHeaderFormatDefaultLong * @see m_strDayHeaderFormatDefaultMiddle * @see m_strDayHeaderFormatDefaultShort * @see m_strDayHeaderFormatDefaultShortest * @see m_strDayHeaderFormatLong * @see m_strDayHeaderFormatMiddle * @see m_strDayHeaderFormatShort * @see m_strDayHeaderFormatShortest */ virtual CString _GetDayHeaderFormat(int nLevel) const; /** * @brief * This member function is used to determine if the specified * editing operation command is possible for the event subject * editor window. * * @param idEditCmd A UINT that contains the editing operation command ID: * ID_EDIT_UNDO, ID_EDIT_CUT, ID_EDIT_COPY, or ID_EDIT_PASTE. * * @details * This function works correctly even when there is no subject editing mode. * * @return A BOOL. TRUE - if the subject editing mode and specified editing * operation are possible. FALSE otherwise. */ virtual BOOL _CanSubjectEditor(UINT idEditCmd) const; /** * @brief * This member function is used to obtain a pointer to the event * subject editor window. * * @details * Works correctly even when not using a subject editing mode. * * @return Pointer to the CWnd or NULL. */ virtual CWnd* _GetSubjectEditorWnd() const; /** * @brief * This member function is used to copy selected events and CXTPCalendarEvent objects, * to a COleDataSource object. * * @param dwCopyFlags A DWORD that contains a set of flags from the enum * XTPCalendarClipboardCopyFlags or user-defined * values. * * @details * COleDataSource->SetClipboard method must be called to place * data into the clipboard. Keep in mind - SetClipboard calls * InternalRelease. * * @return If there are selected events, then the function returns a pointer * to a new COleDataSource object. If there are no selected events, * then the function returns NULL. * * @see _ReadEventsFromClipboard * @see XTPCalendarClipboardCopyFlags * @see XTPCALENDARCTRL_CF_EVENT * @see COleDataSource */ virtual COleDataSource* _CopySelectedEvents(DWORD dwCopyFlags = 0); /** * @brief * This member function is used to read events and CXTPCalendarEvent * objects, from a COleDataSource object. * * @param pData A COleDataObject pointer to the data object. * @param pdwCopyFlags A pointer to a DWORD that contains the CopyFlags. * These flags are set in the _CopySelectedEvents call. * The flag values are from the XTPCalendarClipboardCopyFlags * enum or are user-defined values. * * @details * COleDataSource->AttachClipboard method must be called to * retrieve data from the clipboard. * * @return A pointer to a CXTPCalendarEvents object. NULL - If there are no events * in the clipboard. Otherwise, a pointer to a new CXTPCalendarEvents objects * collection. * * @see _CopySelectedEvents * @see XTPCalendarClipboardCopyFlags * @see XTPCALENDARCTRL_CF_EVENT * @see COleDataSource */ virtual CXTPCalendarEventsPtr _ReadEventsFromClipboard(COleDataObject* pData, DWORD* pdwCopyFlags = NULL); /** * @brief * This member function is used to obtain the minimum event duration * visible in the current view. * * @return A COleDateTimeSpan object that contains the minimum duration * of the event. */ virtual COleDateTimeSpan GetEventDurationMin() const; /** * @brief * This member function is used to perform an undo/redo operation * for the specified event. * * @param pEvent A pointer to a CXTPCalendarEvent object that contains * the undo/redo action. * * @return A BOOL. TRUE if the undo operation is successful. FALSE otherwise. * * @see Undo * @see Redo * @see m_UndoBuffer * @see m_eUndoMode * @see XTPCalendarUndoMode */ virtual BOOL _Undo(CXTPCalendarEvent* pEvent = NULL); void _ReSelectSelectEvents(); /** * @brief * This member function handles the changing of an event in the associated * data provider. It performs all the necessary validation of this * action and returns an update result. * * @param nfCode Notification code of the data provider update operation. * @param pEvent A pointer to a CXTPCalendarEvent object that was changed. * * @return A code of the update action to be performed in the view. * * @see XTP_NOTIFY_CODE overview * @see XTPEnumCalendarUpdateResult overview */ virtual XTPEnumCalendarUpdateResult OnEventChanged_InDataProvider(XTP_NOTIFY_CODE nfCode, CXTPCalendarEvent* pEvent); protected: /** * @brief * This helper class implements Undo/Redo events editing * functionality. */ class CUndoBuffer; /** * @brief * This method is used to determine Copy or Move dragging mode. * * @param eDragMode A value from enum XTPCalendarDraggingMode. * * @return TRUE if eDragMode == xtpCalendaDragModeCopy or eDragMode == xtpCalendaDragModeMove. */ BOOL _IsDragModeCopyMove(int eDragMode) const; /** * @brief * This method is used to determine if specified editing operation is * disabled. * * @param eOperation A value from enum XTPCalendarEditOperation. * @param pEventView A pointer to event view. * * @return TRUE if specified editing operation is disabled, otherwise FALSE. * * @see XTP_NC_CALENDAR_IS_EVENT_EDIT_OPERATION_DISABLED * @see XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION * @see XTPCalendarEditOperation */ BOOL IsEditOperationDisabledNotify(XTPCalendarEditOperation eOperation, CXTPCalendarViewEvent* pEventView) const; /** * @brief * This method is used to customize or disable specified editing * operation. * * @param eOperation A value from enum XTPCalendarEditOperation. * @param pEventView A pointer to event view. * * @return TRUE if specified editing operation is disabled or handled, * otherwise FALSE. * * @see XTP_NC_CALENDAR_IS_EVENT_EDIT_OPERATION_DISABLED * @see XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION * @see XTPCalendarEditOperation */ BOOL OnBeforeEditOperationNotify(XTPCalendarEditOperation eOperation, CXTPCalendarViewEvent* pEventView); /** * @brief * This method is used to customize or disable specified editing * operation. * * @param eOperation A value from enum XTPCalendarEditOperation. * @param pEventViews A pointer to event views. * * @return TRUE if specified editing operation is disabled or handled, * otherwise FALSE. * * @see XTP_NC_CALENDAR_IS_EVENT_EDIT_OPERATION_DISABLED * @see XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION * @see XTPCalendarEditOperation */ BOOL OnBeforeEditOperationNotify(XTPCalendarEditOperation eOperation, CXTPCalendarViewEvents* pEventViews); /** * @brief * This method is used to customize or disable paste editing * operation. * * @param pEvent A pointer to an event prepared for paste. * @param bPasteWillChangeExistingEvent If this parameter is TRUE, the new * event will not be added. Instead, just * the existing event will be updated. * Used for creating recurrence event * exceptions by cut operation. * * @return TRUE if paste editing operation disabled or handled, * otherwise FALSE. * * @see XTP_NC_CALENDAR_IS_EVENT_EDIT_OPERATION_DISABLED * @see XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION * @see XTPCalendarEditOperation */ BOOL OnBeforePasteNotify(CXTPCalendarEvent* pEvent, BOOL bPasteWillChangeExistingEvent); /** * @brief * This method is used to customize or disable xtpCalendarEO_InPlaceCreateEvent * editing operation. * * @param pcszInitialSubject A pointer to the string which contains the initial * subject value for the new event (generally initial * char). * * @return TRUE if In-place create event editing operation is disabled or handled, * otherwise FALSE. * * @see XTP_NC_CALENDAR_IS_EVENT_EDIT_OPERATION_DISABLED * @see XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION * @see XTPCalendarEditOperation */ BOOL OnInPlaceCreateEvent(LPCTSTR pcszInitialSubject); /** * @brief * Class CSelectionChangedContext is used to avoid multiple sending of * an XTP_NC_CALENDAR_SELECTION_CHANGED notification for one selection * changing operation. */ class _XTP_EXT_CLASS CSelectionChangedContext { public: /** * @brief * Constructs a CSelectionChangedContext object. * * @param pView Pointer to parent CXTPCalendarView object. * @param eSelType Value from enum XTPCalendarSelectionChanged. * Changed selection type. * * @details * eSelType = xtpCalendarSelectionUnknown only lock sending notifications. * * @see XTP_NC_CALENDAR_SELECTION_CHANGED */ CSelectionChangedContext(CXTPCalendarView* pView, int eSelType = xtpCalendarSelectionUnknown); /** * @brief * Destroys a CSelectionChangedContext object and send notification(s) * if this is last locker object. */ virtual ~CSelectionChangedContext(); private: CXTPCalendarView* m_pView; int m_eSelType; }; protected: /** * @brief * This class defines an internal structure used as a counter on * selection changes, which is needed to redraw a view when * necessary. */ class CSelectionChanged_ContextData { public: /** * @brief * Default object constructor. */ CSelectionChanged_ContextData(); int m_nLockCount; /**< Selection change notification global Lock counter.*/ int m_nLockCount_Day; /**< Days selection change notification Lock counter.*/ int m_nLockCount_Event; /**< Events selection change notification Lock counter.*/ BOOL m_bRequest_Day; /**< Days selection change send notification request.*/ BOOL m_bRequest_Event; /**< Events selection change send notification request.*/ }; CSelectionChanged_ContextData m_cntSelChanged; /**< Counter on selection changes,*/ /**< is needed to redraw a view when necessary.*/ friend class CSelectionChangedContext; friend class CXTPCalendarViewSelection; protected: int m_eUndoMode; /**< Undo mode, see XTPCalendarUndoMode.*/ BOOL m_bResetUndoBuffer; /**< Clean undo buffer before add next undo action.*/ CUndoBuffer* m_pPrevUndoBuffer; /**< Undo buffer data after last undo buffer clean.*/ CUndoBuffer* m_pUndoBuffer; /**< Undo buffer object.*/ private: BOOL _EditOperationNotify(XTP_NOTIFY_CODE ncEvent, XTPCalendarEditOperation eOperation, CXTPCalendarViewEvent* pEventView, CXTPCalendarViewEvents* pEventViews = NULL) const; XTPCalendarDraggingMode _GetDraggingMode(XTP_CALENDAR_HITTESTINFO* pHitTest) const; XTPCalendarEditOperation _DragMod2Operation(int eDragMode); virtual CXTPCalendarData* _GetDataProviderBySelection(UINT* puScheduleID = NULL); virtual CXTPCalendarData* _GetDataProviderByConnStr(LPCTSTR pcszConnStr, BOOL bCompareNoCase = TRUE); virtual BOOL _IsScheduleVisible(CXTPCalendarData* pDataProvider, UINT uScheduleID); protected: XTP_VIEW_LAYOUT& GetLayout_(); const XTP_VIEW_LAYOUT& GetLayout_() const; virtual BOOL IsUseCellAlignedDraggingInTimeArea() const; protected: XTP_VIEW_LAYOUT m_Layout; /**< Layout data.*/ /** * @details * This helper struct is used to group information which is * necessary to format Start/End events times. * * @see FormatEventTime * @see _CalculateEventTimeFormat. */ struct SEventTimeFormatInfo { CString strFormat; /**< Time format string. */ CString strAM; /**< AM symbol. */ CString strPM; /**< PM symbol. */ BOOL b24_HFormat; /**< Is 24 hours time format.*/ BOOL isCustom; /** * @brief * Default object constructor. */ SEventTimeFormatInfo() { b24_HFormat = FALSE; isCustom = FALSE; } }; SEventTimeFormatInfo m_EventTimeFormat; /**< Information used to format events times.*/ CString m_strHeaderFormat; /**< Day header active date format string.*/ CString m_strDayHeaderFormatLong; /**< Day header Long date format custom string. */ CString m_strDayHeaderFormatMiddle; /**< Day header Middle date format custom string. */ CString m_strDayHeaderFormatShort; /**< Day header Short date format custom string. */ CString m_strDayHeaderFormatShortest; /**< Day header Shortest date format custom string.*/ CString m_strDayHeaderFormatDefaultLong; /**< Day header Long date format default string. */ CString m_strDayHeaderFormatDefaultMiddle; /**< Day header Middle date format default string. */ CString m_strDayHeaderFormatDefaultShort; /**< Day header Short date format default string. */ CString m_strDayHeaderFormatDefaultShortest; /**< Day header Shortest date format default string.*/ CRect m_rcView; /**< Client rect.*/ CRect m_rcTooltip; /**< Last shown tooltip rect (while GetTooltipRect returns calculated currently required tooltip rect)*/ protected: CXTPCalendarEventPtr m_ptrDraggingEventOrig; /**< Event object before start event editing.*/ CXTPCalendarEventPtr m_ptrDraggingEventNew; /**< Editing event object.*/ COleDateTimeSpan m_spDraggingStartOffset; /**< Start dragging operation offset from the beginning of the event.*/ CPoint m_ptStartDragging; /**< Request to start dragging operation from this point.*/ XTPCalendarDraggingMode m_eDraggingMode; /**< Editing event mode.*/ BOOL m_bStartedClickInside; /**< Is OnLButtonDown was inside view rect.*/ CXTPCalendarViewEventPtr m_ptrEditingViewEvent; /**< Currently editing subject event view or event view requested to edit subject by timeout.*/ CXTPCalendarViewEvent* m_pLastEvent; /**< Last selected event.*/ UINT m_nTimerID_StartEditSubject; /**< Timer ID of edit event subject request.*/ UINT m_nTimerID_ShowToolTip; /**< Timer ID of start show tooltip request.*/ CXTPCalendarControl* m_pControl; /**< Pointer to the owner control object.*/ CXTPCalendarViewEvents* m_pSelectedEvents; /**< Selected Events;*/ XTP_CALENDAR_HITTESTINFO m_LastHitInfo; /**< Last HitInfo data. It is used in CXTPCalendarView::OnMouseMove() for processing selecting, dragging and other operations.*/ UINT m_nKeyStateTimerID; /**< Timer ID to check Keys state (like Control).*/ XTP_CALENDAR_VIEWSELECTION m_selectedBlock; /**< Current selection.*/ BOOL m_bScrollV_Disabled; /**< Is vertical scrolling disabled for a view.*/ BOOL m_bScrollH_Disabled; /**< Is horizontal scrolling disabled for a view.*/ CXTPCalendarResources* m_pResources; /**< Resources array*/ CPoint m_ptLBtnUpMousePos; CPoint m_ptLBtnDownMousePos; protected: mutable CXTPCalendarPtrCollectionT m_arDays; /**< Stores the view day collection.*/ # ifdef _XTP_ACTIVEX DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPCalendarView); protected: void OleResetSelection(); void OleSetSelection(DATE Begin, DATE End, BOOL bAllDay); BOOL OleGetSelection(DATE* pBegin, DATE* pEnd, VARIANT_BOOL* pvbAllDay); BOOL OleGetSelectionV(VARIANT* pBegin, VARIANT* pEnd, VARIANT* pvbAllDay); LPDISPATCH OleSelection(); LPDISPATCH OleHitTest(); LPDISPATCH OleHitTestEx(long X, long Y); void OleShowDay(DATE dt, const VARIANT& Select); int OleGetItemCount(); LPDISPATCH OleGetItem(long nIndex); LPDISPATCH OleGetSelectedEvents(); void OleSelectViewEvent(LPDISPATCH pViewEventDisp, BOOL bSelect); void OleUnselectAllEvents(); void OleEnableVScroll(BOOL bEnable); void OleEnableHScroll(BOOL bEnable); LPDISPATCH OleGetMultipleResources(); void OleSetMultipleResources(LPDISPATCH pDispResources); BOOL OleCanStartEdit(); DECLARE_ENUM_VARIANT(CXTPCalendarView) private: CXTPCalendarViewSelection* m_pSelOleWrapper; # endif }; /** * @brief * This template class represents a view portion of the Calendar control. * * @details * It represents a specific view of the Control's associated events * data and provides basic functionality on this data using user * input through the keyboard and the mouse. * It is used as a part of the calendar control framework to build the * View layer of View->DayView->ViewEvent * typed objects hierarchy. * These are the template parameters: * _TViewDay - Type of View Day objects stored in View. * _TViewEvent - Type of View Event objects stored in View Day. * * You must provide all of the above parameters. * * These are the predefined view implementations available * for the Calendar control: * * * Day and work week views - Using the CXTPCalendarDayView class. * * Week view - Using the CXTPCalendarWeekView class. * * Month view - Using the CXTPCalendarMonthView class. * * Furthermore, any type of user-defined view may also be implemented as * a descendant of the CXTPCalendarView class. * * A typical Calendar View model consists of a collection of * corresponding ViewDay's, which realizes the contents on a square * of one day. ViewDay in turn contains a collection of ViewEvent's * for the particular day, each of them represents a view of an * CXTPCalendarEvent object. * * @see CXTPCalendarDayView * @see CXTPCalendarWeekView * @see CXTPCalendarMonthView * @see CXTPCalendarViewDay * @see CXTPCalendarViewEvent */ template class CXTPCalendarViewT : public CXTPCalendarView { public: /** * @brief * Default object constructor. * * @param pCalendarControl A pointer to a CXTPCalendarControlT object. * @param nViewType An XTPCalendarViewType object that contains the * view type identifier. * * @see XTPCalendarViewType * @see ~CXTPCalendarEventT() */ CXTPCalendarViewT(CXTPCalendarControl* pCalendarControl, XTPCalendarViewType nViewType) : CXTPCalendarView(pCalendarControl) { m_nViewType = nViewType; } /** * @brief * Default class destructor. * * @details * Handles member item deallocation. */ virtual ~CXTPCalendarViewT(){}; /** * @brief * Call this member function to obtain the view type flag. * * @return An XTPCalendarViewType object that contains the view type flag. * * @see XTPCalendarViewType */ virtual XTPCalendarViewType GetViewType() const { return m_nViewType; } /** * @brief * Call this member function to obtain a _TViewDay object corresponding * with the day's index. * * @param nIndex An int that contains the day view index in the view collection. * * @return If the day's index is valid, then the function returns a pointer to a * _TViewDay object that corresponds with the day's index. Otherwise, * the function returns NULL. * * @details * Index numbers start with 0 and cannot be negative. * * @see GetViewDayCount() */ virtual _TViewDay* GetViewDay(int nIndex) const { return (_TViewDay*)GetViewDay_(nIndex); } private: XTPCalendarViewType m_nViewType; }; AFX_INLINE CXTPCalendarControl* CXTPCalendarView::GetCalendarControl() const { return this ? m_pControl : NULL; } AFX_INLINE CRect CXTPCalendarView::GetViewRect() const { return m_rcView; } AFX_INLINE XTPCalendarDraggingMode CXTPCalendarView::GetDraggingMode() const { return m_eDraggingMode; } AFX_INLINE int CXTPCalendarView::GetRowHeight() const { return m_Layout.m_nRowHeight; } AFX_INLINE UINT CXTPCalendarView::GetStartEditSubjectTimeOut() const { return XTP_CALENDAR_START_EDIT_SUBJECT_TIMEOUT_MS; } AFX_INLINE BOOL CXTPCalendarView::IsEditingSubject() const { return !!m_ptrEditingViewEvent; } AFX_INLINE CString CXTPCalendarView::GetDayHeaderFormat() const { return m_strHeaderFormat; } AFX_INLINE void CXTPCalendarView::SetDayHeaderFormat(LPCTSTR sFmt) { m_strHeaderFormat = sFmt; } AFX_INLINE BOOL CXTPCalendarView::_IsDragModeCopyMove(int eDragMode) const { return eDragMode == xtpCalendaDragModeCopy || eDragMode == xtpCalendaDragModeMove; } AFX_INLINE XTPCalendarEditOperation CXTPCalendarView::_DragMod2Operation(int eDragMode) { return (XTPCalendarEditOperation)eDragMode; } AFX_INLINE void CXTPCalendarView::EnableVScroll(BOOL bEnable) { m_bScrollV_Disabled = !bEnable; } AFX_INLINE void CXTPCalendarView::EnableHScroll(BOOL bEnable) { m_bScrollH_Disabled = !bEnable; } AFX_INLINE BOOL CXTPCalendarView::IsHScrollEnabled() const { return !m_bScrollH_Disabled; } AFX_INLINE BOOL CXTPCalendarView::IsVScrollEnabled() const { return !m_bScrollV_Disabled; } AFX_INLINE void CXTPCalendarView::SetDayHeaderFormatLong(LPCTSTR pcszCustomFormat) { m_strDayHeaderFormatLong = pcszCustomFormat; } AFX_INLINE void CXTPCalendarView::SetDayHeaderFormatShortest(LPCTSTR pcszCustomFormat) { m_strDayHeaderFormatShortest = pcszCustomFormat; } AFX_INLINE void CXTPCalendarView::SetDayHeaderFormatMiddle(LPCTSTR pcszCustomFormat) { m_strDayHeaderFormatMiddle = pcszCustomFormat; } AFX_INLINE void CXTPCalendarView::SetDayHeaderFormatShort(LPCTSTR pcszCustomFormat) { m_strDayHeaderFormatShort = pcszCustomFormat; } AFX_INLINE int CXTPCalendarView::GetChildHandlersCount() const { return GetViewDayCount(); } AFX_INLINE XTP_VIEW_LAYOUT& CXTPCalendarView::GetLayout_() { return m_Layout; } AFX_INLINE const XTP_VIEW_LAYOUT& CXTPCalendarView::GetLayout_() const { return m_Layout; } AFX_INLINE BOOL CXTPCalendarView::IsUseCellAlignedDraggingInTimeArea() const { return FALSE; } AFX_INLINE UINT CXTPCalendarView::GetShowToolTipTimeOut() const { return XTP_CALENDAR_SHOW_BUTTON_TIMEOUT_MS; } AFX_INLINE void CXTPCalendarView::ClearDiscreteSelection() { m_DiscreteSelection.RemoveAll(); } AFX_INLINE UINT CXTPCalendarView::GetDiscreteSelectionCount() const { return (UINT)m_DiscreteSelection.GetSize(); } AFX_INLINE int CXTPCalendarView::GetViewDayCount() const { return m_arDays.GetCount(); } ///////////////////////////////////////////////////////////////////////////// # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(_XTPCALENDARVIEW_H__)