/** * @file XTPCalendarTimeLineViewGroup.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(__XTPCALENDARTIMELINEVIEWGROUP_H__) # define __XTPCALENDARTIMELINEVIEWGROUP_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" # pragma warning(disable : 4100) class CXTPCalendarEvent; class CXTPCalendarTimeLineView; class CXTPCalendarTimeLineViewGroup; class CXTPCalendarTimeLineViewGroups; class CXTPCalendarTimeLineViewEvent; class CXTPCalendarTimeLineViewPart; /** * @brief * This class represents an event timeline view portion of the CXTPCalendarViewEvent. * * @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 keyboard and mouse. * CXTPCalendarTimeLineViewEvent is a descendant of the CXTPCalendarViewEvent class. */ class _XTP_EXT_CLASS CXTPCalendarTimeLineViewEvent : public CXTPCalendarViewEvent { public: /** * @brief * Default object constructor. * * @param pEvent A pointer to a CXTPCalendarEvent object. * @param pGroup A pointer to a CXTPCalendarTimeLineViewGroup object. */ CXTPCalendarTimeLineViewEvent(CXTPCalendarEvent* pEvent, CXTPCalendarTimeLineViewGroup* pGroup); /** * @brief * This member function is used to calculate a rectangle for an event. * * @param pDC A pointer to a valid device context. */ void CalcRect(CDC* pDC); /** * @brief * This member function is used to obtain the owner view object. * * @return A CXTPCalendarTimeLineView pointer to the owner view object. */ CXTPCalendarTimeLineView* GetView() const; /** * @brief * Access function to get view group. * * @return Current view group as a pointer to CXTPCalendarTimeLineViewGroup. */ CXTPCalendarTimeLineViewGroup* GetViewGroup() const { return m_pGroup; } /** * @brief * Access function to get view group. * * @return Current view group as a pointer to CXTPCalendarTimeLineViewGroup. */ virtual CXTPCalendarViewGroup* GetViewGroup_() 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 struct. * * @param pt A CPoint that contains the coordinates of the point to * test. * @param pHitTest A pointer to an XTP_CALENDAR_HITTESTINFO structure that * contains information about the point to test. * * @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 { return FALSE; }; virtual BOOL HitTestEx(CPoint pt, XTP_CALENDAR_HITTESTINFO* pHitTest) const { return FALSE; } /** * @brief * This member function is used to get is group visible. * * @return TRUE if object is visible, FALSE otherwise. */ virtual BOOL IsVisible() const { return FALSE; }; /** * @brief * This member function is used to get is group selected. * * @return TRUE if object is selected, FALSE otherwise. */ virtual BOOL IsSelected() const; /** * @brief * This member function is used to adjust the view's layout. * * @param pDC A pointer to a valid device context. * @param rcEventMax A CRect object that contains the rectangle coordinates * that are used to draw the view. * @param nEventPlaceNumber Ordinal number of event. */ virtual void AdjustLayout(CDC* pDC, const CRect& rcEventMax, int nEventPlaceNumber); /** * @brief * This member function is used to adjust the view's layout with the theme used. * * @param pDC A pointer to a valid device context. * @param rcEventMax A CRect object that contains the rectangle coordinates * that are used to draw the view. * @param nEventPlaceNumber Ordinal number of event. */ 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. */ virtual void Draw(CDC* pDC); /** * @brief * This function is used to change the event place number. * * @param nNewPlace new event place number. */ virtual void ChangeEventPlace(int nNewPlace); /** * @brief * Access function to get the visual part of a CXTPCalendarTimeLineViewPart object. * * @return Pointer to a CXTPCalendarTimeLineViewPart object. */ virtual CXTPCalendarTimeLineViewPart* GetPart() const; /** * @brief * Access function to get event duration in pixels. * * @return Event duration in pixels as int. */ virtual int GetEventDurationInPixels() const; /** * @brief * Returns the rect in the client coordinates in which the event was drawn last time. * * @details * GetLastVisibleRect and SetLastVisibleRect are workaround functions for HitTest in * Timeline view. * SetLastVisibleRects is called by the draw operation each time the event is drawn * in timeline view. * GetLastVisibleRect is used in the HitTest function to determine the HitTest info. * @return The last used rectangle for event drawing. */ const CRect& GetLastVisibleRect() const; /** * @brief * Sets the rect in the client coordinates in which the event was drawn last time. * @param rc A new value of the last used draw rectangle. * @details * GetLastVisibleRect and SetLastVisibleRect are workaround functions for HitTest in * Timeline view. * SetLastVisibleRects is called by the draw operation each time the event is drawn * in timeline view. * GetLastVisibleRect is used in the HitTest function to determine the HitTest info. */ void SetLastVisibleRect(const CRect& rc); protected: CXTPCalendarTimeLineViewGroup* m_pGroup; /**< internal member to keep pointer to CXTPCalendarTimeLineViewGroup*/ int m_nEventDurationInPixels; /**< internal nmember to keep event duration in pixels value*/ CRect m_rcLastVisible; }; /** * @brief * This class represents an event timeline view portion of the CalendarViewGroup. * * @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 keyboard and mouse. * CXTPCalendarTimeLineViewGroup is a descendant of the CXTPCalendarViewGroup class. */ class _XTP_EXT_CLASS CXTPCalendarTimeLineViewGroup : public CXTPCalendarViewGroup { public: /** * @brief * Base class type definition. */ typedef CXTPCalendarViewGroup TBase; /** * @brief * Default object constructor. * * @param pView A pointer to a CXTPCalendarTimeLineView object. * @param pParentGroup A pointer to a CXTPCalendarTimeLineViewGroup object. */ CXTPCalendarTimeLineViewGroup(CXTPCalendarTimeLineView* pView, CXTPCalendarTimeLineViewGroup* pParentGroup = NULL); /** * @brief * Default class destructor. */ virtual ~CXTPCalendarTimeLineViewGroup(); /** * @brief * This member function is used to populate the view with data for * all event items contained in the view. * * @param dtDayDate A COleDateTime object that contains the day's date. * * @details * This function provides common functionality for all CXTPCalendarViewGroup - * derived classes. */ virtual void Populate(COleDateTime dtDayDate){}; /** * @brief * This member function is used to populate the view with data for * all event items contained in the view. * * @param pEvents pointer to CXTPCalendarEvents. */ virtual void Populate(CXTPCalendarEvents* pEvents); /** * @brief * This member function is used to adjust the view's layout * depending on the provided rectangle and calls AdjustLayout() * for all sub-items. * * @param pDC A pointer to a valid device context. * @param rcGroup rectangle used to draw the group. */ virtual void AdjustLayout(CDC* pDC, const CRect& rcGroup); /** * @brief * This member function is used to draw the group using the specified * device context. * * @param pDC A pointer to a valid device context. * @param nOffset Vertical offset to draw. */ virtual void Draw(CDC* pDC, int nOffset); /** * @brief * This member function is used to draw the group using the specified * device context. * * @param pDC A pointer to a valid device context. */ virtual void Draw(CDC* pDC); /** * @brief * This member function is used to determine which view item, * if any, is at a specified position index, and returns additional * info in a XTP_CALENDAR_HITTESTINFO struct. * * @param pt A CPoint that contains the coordinates of the point to * test. * @param pHitTest A pointer to a XTP_CALENDAR_HITTESTINFO structure that * contains information about the point to test. * * @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 { return FALSE; }; virtual void FillHitTestEx(XTP_CALENDAR_HITTESTINFO* pHitTest) const { } /** * @brief * This member function is used to obtain the owner view object. * * @return A CXTPCalendarTimeLineView pointer to the owner view object. */ CXTPCalendarTimeLineView* GetView() const { return (CXTPCalendarTimeLineView*)m_pView; } /** * @brief * Call this member function to obtain a pointer to the base CXTPCalendarViewEvent* * object that corresponds to the event's index. * * @param nIndex Index of the event in m_arEvents. * * @return A pointer to the CXTPCalendarViewEvent object. */ virtual CXTPCalendarTimeLineViewEvent* GetViewEvent(int nIndex) const { return (CXTPCalendarTimeLineViewEvent*)m_arEvents.GetAt(nIndex); } /** * @brief * Call this member function to obtain a pointer to the containing * CXTPCalendarViewDay object. * * @return A pointer to the CXTPCalendarViewDay object. */ virtual CXTPCalendarViewDay* GetViewDay_() const { _ASSERTE(FALSE); return 0; } /** * @brief * Call this member function to obtain a pointer to the calendar control * object. * * @return A pointer to a CXTPCalendarControl object. */ virtual CXTPCalendarControl* GetCalendarControl() const; /** * @brief * Call this member function to obtain the current height of the group. * * @return An int that contains the current height of the group. */ int GetGroupHeight(); void AddViewEvent(CXTPCalendarEvent* pEvent); virtual CXTPCalendarViewEvent* CreateViewEvent(CXTPCalendarEvent* pEvent); protected: /** * @details * Event views collection type definition. */ typedef CXTPCalendarPtrCollectionT TViewEventsCollection; CXTPCalendarTimeLineViewGroup* m_pParentGroup; /**< pointer to the owner view group object*/ CXTPCalendarTimeLineViewGroups* m_pChildren; /**< not used in current version - always NULL*/ CXTPCalendarTimeLineView* m_pView; }; /** * @brief * This class represents a collection of CXTPCalendarTimeLineViewGroup objects. */ class _XTP_EXT_CLASS CXTPCalendarTimeLineViewGroups : public CXTPCalendarPtrCollectionT { }; ///////////////////////////////////////////////////////////////////////////// AFX_INLINE CXTPCalendarViewGroup* CXTPCalendarTimeLineViewEvent::GetViewGroup_() const { return m_pGroup; } AFX_INLINE int CXTPCalendarTimeLineViewEvent::GetEventDurationInPixels() const { return m_nEventDurationInPixels; } AFX_INLINE const CRect& CXTPCalendarTimeLineViewEvent::GetLastVisibleRect() const { return m_rcLastVisible; } AFX_INLINE void CXTPCalendarTimeLineViewEvent::SetLastVisibleRect(const CRect& rc) { m_rcLastVisible = rc; } //=========================================================================== AFX_INLINE void CXTPCalendarTimeLineViewGroup::AddViewEvent(CXTPCalendarEvent* /*pEvent*/) { _ASSERTE(FALSE); } //=========================================================================== # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCALENDARTIMELINEVIEWGROUP_H__)