/** * @file XTPCalendarRemindersDialog.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(_XTP_CALENDAR_REMINDERS_DIALOG_H__) # define _XTP_CALENDAR_REMINDERS_DIALOG_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCalendarRemindersManager; class CXTPCalendarControl; class CXTPNotifySink; ///////////////////////////////////////////////////////////////////////////// /** * @brief * This class used to display calendar reminders. This is a default * implementation which can be used as an example or as a base class * for custom dialogs. * It designed to be localized - XTPResourceManager is used to load * resources. */ class _XTP_EXT_CLASS CXTPCalendarRemindersDialog : public CDialog { // Construction public: enum { IDD = XTP_IDD_CALENDAR_REMINDERS }; /** * @brief * Dialog class constructor. * * @param pParent [in] Pointer to parent window. Can be NULL. * @param nIDTemplate [in] Contains the ID number of a dialog-box template resource. */ CXTPCalendarRemindersDialog(CWnd* pParent = NULL, UINT nIDTemplate = CXTPCalendarRemindersDialog::IDD); /** * @brief * Default object destructor. */ virtual ~CXTPCalendarRemindersDialog(); /** * @brief * Use this method to create a dialog window. * * @param pParent [in] Pointer to parent window. Can be NULL. * * @return TRUE if dialog window created successfully, FALSE otherwise. */ virtual BOOL Create(CWnd* pParent = NULL); /** * @brief * Use this method to attach dialog to calendar control (and reminders manager). * * @param pCalendar [in] Pointer to control. */ virtual void SetRemindersManager(CXTPCalendarControl* pCalendar); /** * @brief * Use this method to update the dialog reminders list from the reminders * manager. */ virtual void UpdateFromManager(); /** * @brief * Use this method to update the dialog reminders list from the calendar * control (and reminders manager). */ virtual void Detach(); /** * @brief * This method is used to determine if the dialog window is displayed in * the Microsoft Windows taskbar. * * @return TRUE if dialog displayed in the taskbar, FALSE otherwise. */ virtual BOOL IsShowInTaskBar(); /** * @brief * This method is used to set if the dialog window is displayed in * the Microsoft Windows taskbar. * * @param bShow [in] Set TRUE to show dialog in the taskbar, FALSE otherwise. */ virtual void SetShowInTaskBar(BOOL bShow = TRUE); /** * @brief * This method is used to determine if the dialog window pops up automatically * when new reminders arrive. * * @return TRUE if the dialog window pops up automatically, FALSE otherwise. */ BOOL IsAutoPopup() const; /** * @brief * This method is used to set if the dialog window pops up automatically * when new reminders arrive. * * @param bAutoPopup [in] Set TRUE to pop up dialog automatically, FALSE otherwise. */ void SetAutoPopup(BOOL bAutoPopup = TRUE); private: virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL) { return CDialog::Create(lpszTemplateName, pParentWnd); } virtual BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL) { return CDialog::Create(nIDTemplate, pParentWnd); } virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } protected: CXTPCalendarRemindersManager* m_pRemindersMan; /**< Store pointer to reminders manager.*/ CXTPCalendarReminders m_arActiveReminders; /**< Store active reminders list.*/ CXTPCalendarControl* m_pCalendar; /**< Store pointer to calendar control.*/ int m_nNextRefreshIndex; /**< Store next reminder item index for automatic refresh by timer or -1 to refresh all.*/ CXTPNotifySink* m_pSink; virtual void OnReminders(XTP_NOTIFY_CODE Event, WPARAM wParam, LPARAM lParam); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); virtual void InitSnoozeComboBox(); virtual void UpdateControlsBySelection(); virtual void SelectItem(int nSelItemIndex); virtual void UpdateTitle(); virtual BOOL _RemoveReminderInfo(CXTPCalendarReminder* pReminder); virtual void OnOK(); afx_msg void OnDismiss(); afx_msg void OnDismissAll(); afx_msg void OnOpenItem(); afx_msg void OnSnooze(); afx_msg void OnRemindersList_ItemChanged(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnRemindersList_DblClick(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnTimer(UINT_PTR nIDEvent); /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ protected: CListCtrl m_ctrlRemindersList; /**< Reminders list control.*/ CStatic m_ctrlDescription; /**< Description control. */ CComboBox m_ctrlSnoozeTimeCB; /**< Snooze combobox control. */ CButton m_ctrlSnoozeBtn; /**< Snooze button. */ CButton m_ctrlDismissBtn; /**< Dismiss button. */ CButton m_ctrlDismissAllBtn; /**< Dismiss All button. */ CButton m_ctrlOpenItemBtn; /**< Open Item button. */ BOOL m_bShowInTaskBar; /**< Store ShowInTaskBar property value. */ BOOL m_bAutoPopup; /**< Store AutoPopup property value. */ }; ///////////////////////////////////////////////////////////////////////////// AFX_INLINE void CXTPCalendarRemindersDialog::Detach() { SetRemindersManager(NULL); } AFX_INLINE BOOL CXTPCalendarRemindersDialog::IsAutoPopup() const { return m_bAutoPopup; } AFX_INLINE void CXTPCalendarRemindersDialog::SetAutoPopup(BOOL bAutoPopup) { m_bAutoPopup = bAutoPopup; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(_XTP_CALENDAR_REMINDERS_DIALOG_H__)