/** * @file XTPCalendarWeekViewEvent.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(__XTPCALENDARWEEKVIEWEVENT_H_) # define __XTPCALENDARWEEKVIEWEVENT_H_ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCalendarControl; class CXTPCalendarWeekView; class CXTPCalendarWeekViewDay; class CXTPCalendarWeekViewGroup; class CXTPCalendarEvent; struct XTP_CALENDAR_HITTESTINFO; /** * @brief * This class represents an event view portion of the CalendarWeekViewDay. * * @details * It represents a specific view of the event associated data according * to various view types and display settings and provides basic * functionality on this data using user input through the keyboard and mouse. * * CXTPCalendarWeekViewEvent is based on CXTPCalendarViewEventT template * class. CXTPCalendarWeekViewEvent inherits basic behavior from CXTPCalendarViewEventT. * Furthermore, CXTPCalendarWeekViewEvent overlaps some functionality in * CXTPCalendarViewEventT and also adds some new functionality for its * own behavior and look. * * @see CXTPCalendarViewEvent * @see CXTPCalendarViewEventT */ class _XTP_EXT_CLASS CXTPCalendarWeekViewEvent : public CXTPCalendarViewEventT { /** @cond */ DECLARE_DYNAMIC(CXTPCalendarWeekViewEvent) /** @endcond */ public: /** * @brief * Base class type definition. */ typedef CXTPCalendarViewEventT TBase; /** * @brief * Default object constructor. * * @param pViewGroup A pointer to a CXTPCalendarWeekViewGroup object. * @param pEvent A pointer to a CXTPCalendarEvent. * * @see ~CXTPCalendarWeekViewDay() */ CXTPCalendarWeekViewEvent(CXTPCalendarEvent* pEvent, CXTPCalendarWeekViewGroup* pViewGroup); /** * @brief * Default class destructor. */ virtual ~CXTPCalendarWeekViewEvent(); /** * @brief * This member function is used to fill an XTP_CALENDAR_HITTESTINFO structure. * * @param point A CPoint object that contains the point to test. * @param pInfo A pointer to a XTP_CALENDAR_HITTESTINFO struct. * * @return TRUE if the test is successful, FALSE otherwise. * * @details * Call this member function to gather hit test information from * the day view. * * @see XTP_CALENDAR_HITTESTINFO */ virtual BOOL HitTestEx(CPoint point, XTP_CALENDAR_HITTESTINFO* pInfo) const; /** * @brief * This member function is used to adjust rectangles used to draw * event view icons. * * @param rc A CRect that contains the rectangle coordinates used to * draw the view. * * @details * Call this member function to calculate rectangles to draw event * view icons. Depends on what glyphs should be drawn based on the * event view rect. * @return An integer denoting the width of the icon. */ virtual int CalcIconsRect(CRect rc); /** * @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 rcEventMax An int that contains the rectangle coordinates * used to draw the view. * @param nEventPlaceNumber An int that contains the sequential place number. * * @details * Call Populate(COleDateTime dtDayDate) prior calling AdjustLayout(). */ virtual void AdjustLayout(CDC* pDC, const CRect& rcEventMax, int nEventPlaceNumber); /** * @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 rcEventMax An int that contains the rectangle coordinates * used to draw the view. * @param nEventPlaceNumber An int that contains the sequential place number. * * @details * Call Populate(COleDateTime dtDayDate) prior calling AdjustLayout(). */ virtual void AdjustLayout2(CDC* pDC, const CRect& rcEventMax, int nEventPlaceNumber); /** * @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 * Call this member function to determine if the "view visible" flag is set. * * @return A BOOL. TRUE if the "view visible" is set. FALSE otherwise. */ virtual BOOL IsVisible() const; /** * @brief * Call this member function to get the day view rectangle coordinates. * * @return A CRect object with the day rectangle coordinates. * * @see SetDayRect(CRect rcDay) */ CRect GetViewRect(); /** * @brief * Call this member function to determine the value of the "show end time" flag. * * @return A BOOL. TRUE if "show end time" flag is set. FALSE otherwise. */ BOOL IsShowEndTime() const; /** * @brief * Call this member function to determine the value of the "show time as clock" flag. * * @return A BOOL. TRUE if the "show time as clock" flag is set. FALSE otherwise. */ BOOL IsTimeAsClock() const; /** * @brief * This member function is used to perform additional adjustments. * * @details * Call this member function to perform additional adjustments after * all adjustment activities are completed. */ virtual void OnPostAdjustLayout(); protected: /** * @brief * Call this member function to determine the editor window font. * * @return A pointer to a CFont object that contains the editor window font. */ virtual CFont* GetSubjectEditorFont() const; }; //////////////////////////////////////////////////////////////////////////// AFX_INLINE CRect CXTPCalendarWeekViewEvent::GetViewRect() { return m_rcEvent; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCALENDARWEEKVIEWEVENT_H_)