/** * @file XTPCalendarWeekViewDay.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(__XTPCALENDARWEEKVIEWDAY_H_) # define __XTPCALENDARWEEKVIEWDAY_H_ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCalendarWeekView; class CXTPCalendarWeekViewDay; class CXTPCalendarWeekViewEvent; /** * @brief * This class represents a single resource view portion of the Calendar * Week View. * * @details * It represents a specific view of the CalendarView's associated events * data grouped by one day and one resource group. And provides basic * functionality on this data using user input through keyboard and mouse. * * @see CXTPCalendarWeekViewDay */ class _XTP_EXT_CLASS CXTPCalendarWeekViewGroup : public CXTPCalendarViewGroupT { public: /** * @brief * Base class type definition. */ typedef CXTPCalendarViewGroupT TBase; /** * @brief * Default object constructor. * Construct CXTPCalendarWeekViewGroup object. * * @param pViewDay Pointer to CXTPCalendarWeekViewDay object. */ CXTPCalendarWeekViewGroup(CXTPCalendarWeekViewDay* pViewDay); /** * @brief * Default class destructor. * * @details * Handles class members deallocation. */ virtual ~CXTPCalendarWeekViewGroup(); protected: /** * @brief * This member function is used to fill an XTP_CALENDAR_HITTESTINFO structure. * * @param pHitTest A pointer to an XTP_CALENDAR_HITTESTINFO struct. * * @details * Call this member function to gather hit test information from * the week view group. * * @see XTP_CALENDAR_HITTESTINFO */ virtual void FillHitTestEx(XTP_CALENDAR_HITTESTINFO* pHitTest) const; private: /** * @brief * This member function is used to obtain a pointer to itself. * * @details * Call this member function to get the "this" pointer. * * @return Pointer to a CXTPCalendarWeekViewGroup. */ virtual CXTPCalendarWeekViewGroup* GetPThis(); }; AFX_INLINE CXTPCalendarWeekViewGroup* CXTPCalendarWeekViewGroup::GetPThis() { return this; } /** * @brief * This class represents a day view portion of the CalendarWeekView. * * @details * It represents a specific view of the CalendarView's associated events * data grouped by one day and provides basic functionality on this * data using user input through the keyboard and mouse. * * CXTPCalendarWeekViewDay is based on the CXTPCalendarViewDayT template * class. CXTPCalendarWeekViewDay inherits basic behavior from the * CXTPCalendarViewDayT class. Furthermore, class CXTPCalendarWeekViewDay * overlaps and adds some functionality for its own behavior and look. * * @see CXTPCalendarViewDay * @see CXTPCalendarViewDayT */ class _XTP_EXT_CLASS CXTPCalendarWeekViewDay : public CXTPCalendarViewDayT { /** @cond */ friend class CXTPCalendarWeekViewEvent; DECLARE_DYNAMIC(CXTPCalendarWeekViewDay) /** @endcond */ public: /** * @brief * Base class type definition. */ typedef CXTPCalendarViewDayT TBase; /** * @brief * Default object constructor. Constructs a CXTPCalendarWeekViewDay * object. * * @param pWeekView Pointer to CXTPCalendarWeekView object. * * @see ~CXTPCalendarWeekViewDay() */ CXTPCalendarWeekViewDay(CXTPCalendarWeekView* pWeekView); /** * @brief * Default class destructor. * * @details * Handles member items deallocation. */ virtual ~CXTPCalendarWeekViewDay(); /** * @brief * This member function is used to fill an XTP_CALENDAR_HITTESTINFO structure. * * @param pInfo A pointer to an XTP_CALENDAR_HITTESTINFO struct. * * @details * Call this member function to gather hit test information from * the week view. * * @see XTP_CALENDAR_HITTESTINFO */ virtual void FillHitTestEx(XTP_CALENDAR_HITTESTINFO* pInfo) const; /** * @brief * This member function is used to determine which view item, * if any, is at the specified position index, and returns additional * info in the XTP_CALENDAR_HITTESTINFO template object. * * @param pt A CPoint that contains the coordinates of the point test. * @param pHitTest A pointer to an XTP_CALENDAR_HITTESTINFO structure. * * @details * Implements standard functionality for the HitTestEx method. * * @return A BOOL. TRUE if the item is found. FALSE otherwise. * * @see XTP_CALENDAR_HITTESTINFO */ virtual BOOL HitTestEx(CPoint pt, XTP_CALENDAR_HITTESTINFO* pHitTest) const; /** * @brief * This member function is used to adjust the view's layout depending * on the provided rectangle and also calls AdjustLayout() for all * sub-items. * * @param pDC A pointer to a valid device context. * @param rcDay A CRect object that contains the rectangle coordinates * used to draw the day view. * * @details * Call Populate(COleDateTime dtDayDate) prior to calling AdjustLayout(). */ virtual void AdjustLayout(CDC* pDC, const CRect& rcDay); /** * @brief * This member function is used to adjust the view's layout depending * on the provided rectangle and also calls AdjustLayout() for all * sub-items. * * @param pDC A pointer to a valid device context. * @param rcDay A CRect object that contains the rectangle coordinates * used to draw the day view. * * @details * Call Populate(COleDateTime dtDayDate) prior to calling AdjustLayout(). */ virtual void AdjustLayout2(CDC* pDC, const CRect& rcDay); /** * @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(). * * @see AdjustLayout(CRect rcDay) */ virtual void Draw(CDC* pDC); /** * @brief * This function is used to obtain a portion of a day rectangle * used to draw event views. * * @return A CRect object that contains the rectangle coordinates. */ CRect GetDayEventsRect() const; /** * @brief * This member function is used to obtain a single day's view caption. * * @return A CString object that contains the day's view caption. */ virtual CString GetCaption() const; protected: /** * @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 * presses the left mouse button. */ virtual BOOL OnLButtonDown(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 obtain a pointer to itself. * * @return A pointer to a CXTPCalendarWeekViewDay object. */ virtual CXTPCalendarWeekViewDay* GetPThis(); }; //////////////////////////////////////////////////////////////////////////// AFX_INLINE CXTPCalendarWeekViewDay* CXTPCalendarWeekViewDay::GetPThis() { return this; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCALENDARWEEKVIEWDAY_H_)