/**
* @file XTPCalendarEvent.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(_XTPCALENDAREVENT_H__)
# define _XTPCALENDAREVENT_H__
# if _MSC_VER > 1000
# pragma once
# endif // _MSC_VER > 1000
# include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h"
class CXTPCalendarEvent;
class CXTPCalendarRecurrencePattern;
class CXTPCalendarEventLabel;
class CXTPCalendarEventLabels;
class CXTPCalendarEventCategoryIDs;
class CXTPPropExchange;
class CXTPCalendarCustomProperties;
class CXTPCalendarIconIDs;
typedef CXTPCalendarIconIDs CXTPCalendarCustomIconIDs;
/** @cond */
XTP_DEFINE_SMART_PTR_INTERNAL(CXTPCalendarRecurrencePattern)
XTP_DEFINE_SMART_PTR_INTERNAL(CXTPCalendarEvent)
/** @endcond */
/**
* @brief
* This class represents the data of a single Event used in the Calendar
* control.
*
* @details
* Event can be recurring or non-recurring: see GetRecurrenceState()
* method and XTPCalendarEventRecurrenceState. If Event is
* recurring use GetRecurrencePattern() method to retrieve recurrence
* properties.
* Recurrence States (XTPCalendarEventRecurrenceState):
*
*
* xtpCalendarRecurrenceMaster: Main event which is used for
* creating Occurrences.
* xtpCalendarRecurrenceOccurrence: Event is one Occurrence of the
* Recurrence series.
* xtpCalendarRecurrenceException: Event is Occurrence which
* properties differ than in the
* Recurrence pattern or this
* Occurrence is deleted (for
* example Start/End time or
* Location are different).
*
* @see CXTPCalendarRecurrencePattern overview,
* @see CXTPCalendarEventLabels overview,
* @see CXTPCalendarEventLabel overview,
* @see XTPCalendarEventRecurrenceState
*/
class _XTP_EXT_CLASS CXTPCalendarEvent : public CXTPCmdTarget
{
friend class CXTPCalendarData;
friend class CXTPCalendarRecurrencePattern;
friend class CXTPCalendarView;
/** @cond */
DECLARE_DYNAMIC(CXTPCalendarEvent)
/** @endcond */
public:
/**
* @brief
* Default object constructor.
*
* @param pDataProvider Pointer to CXTPCalendarData object.
*
* @see ~CXTPCalendarEvent()
*/
CXTPCalendarEvent(CXTPCalendarData* pDataProvider);
public:
/**
* @brief
* Default class destructor.
*
* @details
* Handles member items deallocation. Decreases reference of
* stored objects: CXTPCalendarEventLabels and
* CXTPCalendarRecurrencePattern.
*/
virtual ~CXTPCalendarEvent();
/**
* @brief
* This member function is used to obtain a unique event ID.
*
* @return A DWORD value denoting the event ID.
*
* @see CXTPCalendarEvent
* @see SetEventID
*/
virtual DWORD GetEventID() const;
/**
* @brief
* This member function is used to set a new ID value for an event.
*
* @param dwEventID A DWORD that contains the event id value.
*/
virtual void SetEventID(DWORD dwEventID);
/**
* @brief
* This member function is used to obtain a schedule ID of the event.
*
* @return A UINT schedule value.
*
* @details
* String with the schedule ID allows for the identification of schedules for
* different resources. For example, Schedule ID could contain the
* name of the employee, who is the owner of this event.
*
* @see CXTPCalendarEvent
* @see SetScheduleID
*/
virtual UINT GetScheduleID() const;
/**
* @brief
* This member function is used to set a new schedule ID for the event.
*
* @param uScheduleID An UINT that contains the ScheduleID.
*/
virtual void SetScheduleID(UINT uScheduleID);
/**
* @brief
* This member function is used to obtain a multiple schedules set for the event.
* @return Current schedule set value.
*/
virtual CString GetScheduleSet() const;
/**
* @brief
* This member function is used to set a new multiple schedules set for the event.
*
* @param ScheduleSet CString uScheduleID - |\#1|...|\#n| type of string
*/
virtual void SetScheduleSet(CString ScheduleSet);
/**
* @brief
* This member function is used to obtain the event subject.
*
* @return A CString object that contains the subject text.
*/
virtual CString GetSubject() const;
/**
* @brief
* This member function is used to set the subject text for the event.
*
* @param pcszSubject A LPCTSTR object that contains the string of text.
*/
virtual void SetSubject(LPCTSTR pcszSubject);
/**
* @brief
* Call this member function to obtain the event location text.
*
* @return A CString object that contains the location text.
*
* @see SetLocation
*/
virtual CString GetLocation() const;
/**
* @brief
* This member function is used to set the location text for the event.
*
* @param pcszLocation An LPCTSTR object that contains the string of text.
*
* @see GetLocation
*/
virtual void SetLocation(LPCTSTR pcszLocation);
/**
* @brief
* Call this member function to obtain the event label.
*
* @return Pointer to an CXTPCalendarEventLabel object that contains
* the event label.
*
* @see CXTPCalendarEventLabel
* @see SetLocation
*/
virtual CXTPCalendarEventLabel* GetLabel() const;
/**
* @brief
* Call this member function to get the event label ID.
*
* @return An int that contains the event label ID value.
*
* @see CXTPCalendarEventLabel
* @see SetLabelID
*/
virtual int GetLabelID() const;
/**
* @brief
* This member function is used to set the new label ID for the event.
*
* @param nLabelID An int that contains the label ID value.
*
* @see GetLabelID
*/
virtual void SetLabelID(int nLabelID);
/**
* @brief
* Call this member function to determine if an event is
* an "All Day" event.
*
* @return A BOOL - TRUE if event is "All Day", FALSE otherwise.
*
* @see SetAllDayEvent
*/
virtual BOOL IsAllDayEvent() const;
/**
* @brief
* This member function is used to set the "All Day" flag
* for an event.
*
* @param bSet A BOOL. Boolean value used to set the "All Day" flag
* to TRUE or FALSE.
* TRUE - Event is an "All day" event.
* FALSE - Event is not an "All day" event.
*
* @see IsAllDayEvent
*/
virtual void SetAllDayEvent(BOOL bSet = TRUE);
/**
* @brief
* Call this member function to determine if an event is Visible.
*
* @return A BOOL - TRUE if event Visible.
*/
BOOL IsEventVisible() const;
/**
* @brief
* This member function is used to set the EventVisible flag for an event.
*
* @param bSet A BOOL. Boolean value used to set the EventVisible flag
* to TRUE or FALSE.
*/
void SetEventVisible(BOOL bSet);
/**
* @brief
* Call this member function to get the event's start DateTime.
*
* @return A COleDateTime object containing the event's start DateTime.
*
* @see SetStartTime
*/
virtual COleDateTime GetStartTime() const;
/**
* @brief
* This member function is used to set the new start date and
* time for the event.
* The time is accepted as is, and no any conversions is performed.
*
* @param dtStart A COleDateTime object that contains the new start
* date value.
*
* @see GetStartTime
*/
virtual void SetStartTime(COleDateTime dtStart);
/**
* @brief
* Call this member function to get the event's end DateTime.
*
* @return A COleDateTime object that contains the event's end DateTime.
*
* @see SetEndTime
*/
virtual COleDateTime GetEndTime() const;
/**
* @brief
* This member function is used to set the new end date and time
* for the event.
*
* @param dtEnd new date value.
*
* @see GetEndTime
*/
virtual void SetEndTime(COleDateTime dtEnd);
/**
* @brief
* Call this member function to get an event duration in minutes.
*
* @return Integer value of an event duration in minutes.
*
* @see GetDuration
*/
virtual int GetDurationMinutes() const;
/**
* @brief
* Call this member function to get an event duration as
* an COleDateTimeSpan object.
*
* @return An COleDateTimeSpan object that contains an event duration interval.
*
* @see SetDuration
*/
virtual COleDateTimeSpan GetDuration() const;
/**
* @brief
* This member function is used to set the new duration for the event.
*
* @param spDuration An COleDateTimeSpan object that contains the
* new date interval value.
* @param bKeepStart TRUE - Expanded flag and expand end DateTime.
* FALSE - Expand start DateTime.
*
* @see GetDuration
*/
virtual void SetDuration(COleDateTimeSpan spDuration, BOOL bKeepStart = TRUE);
/**
* @brief
* This member function is used to move the start date event to
* the provided DateTime. The duration of the event does not change.
*
* @param dtNewStartTime An COleDateTime object that contains the new
* start date for the event.
*/
virtual void MoveEvent(COleDateTime dtNewStartTime);
/**
* @brief
* Call this member function to get an event duration as a number
* of days.
*
* @return Integer value of an event duration in days.
*
* @see GetDurationMinutes()
* @see GetDuration()
*/
virtual int GetEventPeriodDays() const;
/**
* @brief
* Call this member function to determine if a reminder is set
* for event.
*
* @return TRUE if a reminder is set. FALSE otherwise.
*
* @see SetReminder()
*/
virtual BOOL IsReminder() const;
/**
* @brief
* Call this member function to setup a reminder for this event.
*
* @param bReminder TRUE to enable reminder. FALSE to disable.
*
* @details
* This function allows firing reminder notifications to be
* enabled/disabled for this event.
* This boolean setting corresponds to a checkbox near "Reminder"
* word in the Event details dialog.
*
* @see IsReminder()
*/
virtual void SetReminder(BOOL bReminder);
/**
* @brief
* Call this member function to determine if a sound file is configured
* for the event reminder.
*
* @return TRUE if sound file is configured. FALSE otherwise.
*/
virtual BOOL IsSound() const;
/**
* @brief
* Call this member function to determine the number of minutes
* before the start of an event.
*
* @return An int that contains the number of Minutes before the start of
* an event.
*
* @see SetReminderMinutesBeforeStart(int nMinutes)
*/
virtual int GetReminderMinutesBeforeStart() const;
/**
* @brief
* This member function is used to set the number of minutes
* before the start of an event.
*
* @param nMinutes An int that contains the number of minutes before
* the start of an event.
*
* @see GetReminderMinutesBeforeStart()
*/
virtual void SetReminderMinutesBeforeStart(int nMinutes);
/**
* @brief
* Call this member function to determine a full path to the
* sound file assigned to the event reminder.
*
* @return A CString object with a full path to the sound file for the
* event reminder.
*
* @see SetReminderSoundFile(LPCTSTR pcszFile)
*/
virtual CString GetReminderSoundFile() const;
/**
* @brief
* This member function is used to set the sound file for the
* event reminder.
*
* @param pcszFile An LPCTSTR object. A pointer to a string with full
* path to the sound file.
*
* @see GetReminderSoundFile()
*/
virtual void SetReminderSoundFile(LPCTSTR pcszFile);
/**
* @brief
* Call this member function to obtain the body
* text for the event.
*
* @return A CString object with the body text for the event.
*
* @see SetBody
*/
virtual CString GetBody() const;
/**
* @brief
* This member function is used to set the body text for the event.
*
* @param pcszDesc An LPCTSTR Pointer to the string with the body text.
*
* @see GetBody
*/
virtual void SetBody(LPCTSTR pcszDesc);
/**
* @brief
* Call this member function to get a busy status value for the event.
*
* @return Busy status value for the event as an XTPCalendarEventBusyStatus flag.
*
* @see SetBusyStatus
* @see XTPCalendarEventBusyStatus enum
*/
virtual int GetBusyStatus() const;
/**
* @brief
* This member function is used to set the busy status value for
* the event.
*
* @param Status An int that contains the busy status value.
*
* @see GetBusyStatus
* @see XTPCalendarEventBusyStatus enum
*/
virtual void SetBusyStatus(int Status);
/**
* @brief
* Call this member function to get an importance level for an event.
*
* @return An importance level for an event as an XTPCalendarEventImportance enum.
*
* @see SetImportance
* @see XTPCalendarEventImportance enum
*/
virtual int GetImportance() const;
/**
* @brief
* This member function is used to set the importance level for
* the event.
*
* @param nImportance - An int that contains the importance level value.
*
* @see GetImportance
* @see XTPCalendarEventImportance enum
*/
virtual void SetImportance(int nImportance);
/**
* @brief
* Call this member function to get the creation time for an event.
*
* @return Creation time for event as COleDateTime object.
*
* @see SetCreationTime
*/
virtual COleDateTime GetCreationTime() const;
/**
* @brief
* This member function is used to set the creation time for an event.
*
* @param dtTime A COleDateTime object that contains the new creation time.
*
* @see GetCreationTime
*/
virtual void SetCreationTime(COleDateTime dtTime);
/**
* @brief
* Call this member function to get the last modification time
* for an event.
*
* @return A COleDateTime object that contains the last modification time
* for the event.
*
* @see SetLastModificationTime
*/
virtual COleDateTime GetLastModificationTime() const;
/**
* @brief
* This member function is used to set the modification time for
* the event.
*
* @param dtTime A COleDateTime object that contains the new modification time.
*
* @see GetLastModificationTime
*/
virtual void SetLastModificationTime(COleDateTime dtTime);
/**
* @brief
* Call this member function to get a recurrence state for the event.
*
* @return Recurrence state for the event as an XTPCalendarEventRecurrenceState enum.
*
* @see MakeEventAsRecurrence
* @see XTPCalendarEventRecurrenceState enum
*/
virtual XTPCalendarEventRecurrenceState GetRecurrenceState() const;
/**
* @brief
* Call this member function to change the recurrence state for the event.
*
* @return TRUE if recurrence state successfully changed. FALSE otherwise.
*
* @see GetRecurrenceState
* @see XTPCalendarEventRecurrenceState enum
*/
virtual BOOL MakeEventAsRecurrence();
/**
* @brief
* This member function is used to set the recurrence pattern for the event.
*
* @param pRPattern A pointer to a CXTPCalendarRecurrencePattern object that
* contains the updated recurrence pattern.
*
* @return TRUE if new pattern changed successfully. FALSE otherwise.
*
* @see CXTPCalendarRecurrencePattern
* @see RemoveRecurrence
*/
virtual BOOL UpdateRecurrence(CXTPCalendarRecurrencePattern* pRPattern);
/**
* @brief
* This member function removes the recurrence pattern for the event.
*
* @return TRUE if the operation is successful. FALSE otherwise.
*
* @see UpdateRecurrence(CXTPCalendarRecurrencePattern* pRPattern)
*/
virtual BOOL RemoveRecurrence();
/**
* @brief
* Call this member function to get the recurrence pattern ID.
*
* @return A DWORD containing the recurrence pattern ID.
*/
virtual DWORD GetRecurrencePatternID() const;
/**
* @brief
* Call this member function to get the event's recurrence pattern
* object.
*
* @return Pointer to a CXTPCalendarRecurrencePattern object that contains
* the event's recurrence pattern.
*
* @see CXTPCalendarRecurrencePattern
*/
virtual CXTPCalendarRecurrencePatternPtr GetRecurrencePattern() const;
/**
* @brief
* Call this member function to set the event's recurrence pattern
* as an exception occurrence.
*
* @param dwPatternID Recurrence pattern ID.
*
* @return TRUE if successful. FALSE otherwise.
*/
virtual BOOL MakeAsRException(DWORD dwPatternID = XTP_CALENDAR_UNKNOWN_RECURRENCE_PATTERN_ID);
/**
* @brief
* Call this member function to determine if an exception occurrence
* is marked as deleted.
*
* @return TRUE if an exception occurrence is marked as deleted. FALSE otherwise.
*
* @see SetRExceptionDeleted(BOOL bDeleted = TRUE)
*/
virtual BOOL IsRExceptionDeleted() const;
/**
* @brief
* Call this member function to mark an exception occurrence as
* deleted/undeleted.
*
* @param bDeleted A BOOL. Exception deleted flag value.
* TRUE - To mark the exception recurrence as deleted.
* FALSE - To mark the exception recurrence as un-deleted.
*
* @see IsRExceptionDeleted()
*/
virtual void SetRExceptionDeleted(BOOL bDeleted = TRUE);
/**
* @brief
* Call this member function to update the event's data.
*
* @param pNewData Pointer to a CXTPCalendarEvent object that contains
* the new data.
*
* @return TRUE if successful. FALSE otherwise.
*
* @see CXTPCalendarEvent
*/
virtual BOOL Update(CXTPCalendarEvent* pNewData);
/**
* @brief
* Call this member function to obtain a pointer to the read-write
* interface of the event.
*
* @return Pointer to a CXTPCalendarEvent object that contains the
* read-write interface of the event.
*/
virtual CXTPCalendarEventPtr CloneEvent();
/**
* @brief
* Clones current event properties into a provided object instance.
*
* @param pEventDest Pointer to a destination CXTPCalendarEvent object.
*
* @details
* This member function is used by CloneEvent() implementation.
*
* @return TRUE if cloned successfully; FALSE otherwise.
*/
virtual BOOL CloneEventTo(CXTPCalendarEvent* pEventDest);
/**
* @brief
* This member function is used to build an occurrence event by
* duplicating the master event.
*
* @param dtStart Start occurrence event date time.
* @param dtEnd End occurrence event date time.
* @param dwNewEventID Occurrence event ID. If specified value is
* XTP_CALENDAR_UNKNOWN_EVENT_ID - a new occurrence
* event ID will be generated automatically.
*
* @details
* Call this member function to get an occurrence event object.
*
* @return Pointer to a CXTPCalendarEvent object that contains the cloned
* occurrence event.
*
* @see CXTPCalendarEvent
*/
virtual CXTPCalendarEventPtr
CloneForOccurrence(COleDateTime dtStart, COleDateTime dtEnd,
DWORD dwNewEventID = XTP_CALENDAR_UNKNOWN_EVENT_ID);
/**
* @brief
* Call this member function to compare IDs of different events.
*
* @param pEvent Pointer to a CXTPCalendarEvent object that contains
* an event to compare.
*
* @return TRUE if the provided event ID is equal the "this" ID. FALSE otherwise.
*/
BOOL IsEqualIDs(const CXTPCalendarEvent* pEvent) const;
/**
* @brief
* Call this member function to compare start dates of different
* events.
*
* @param pEvent Pointer to a CXTPCalendarEvent object that contains
* an event to compare.
*
* @return TRUE if the provided event start date is equal to the "this" date.
* FALSE otherwise.
*/
BOOL IsEqualStartEnd(const CXTPCalendarEvent* pEvent) const;
/**
* @brief
* This member function is used to set the state for the meeting flag.
*
* @param bMeeting A BOOL that contains the new state for the meeting flag.
*
* @details
* Call this member function to set meeting state flag.
*/
virtual void SetMeeting(BOOL bMeeting = TRUE);
/**
* @brief
* This member function is used to obtain the value of the
* Meeting state flag.
*
* @return TRUE if the event is a meeting. FALSE otherwise.
*/
virtual BOOL IsMeeting() const;
/**
* @brief
* This member function is used to set the state for the private flag.
*
* @param bPrivate A BOOL that contains the new state for the private flag.
*
* @details
* Call this member function to set the private state flag. The
* private flag is used to indicate that a meeting event is private.
*/
virtual void SetPrivate(BOOL bPrivate = TRUE);
/**
* @brief
* This member function is used to obtain the value of the
* private state flag.
*
* @return TRUE if the event is private. FALSE otherwise. The private flag
* is used to indicate that a meeting event is private.
*/
virtual BOOL IsPrivate() const;
/**
* @brief
* This member function is used to obtain collection of custom icons IDs
* associated with event object.
*
* @return Pointer to CXTPCalendarCustomIconIDs object.
*/
CXTPCalendarCustomIconIDs* GetCustomIcons() const;
/**
* @brief
* This member function is used to obtain a collection of Event category
* IDs associated with an event object.
*
* @return Pointer to a CXTPCalendarEventCategoryIDs object.
*
* @see CXTPCalendarEventCategories overview
* @see CXTPCalendarData::GetEventCategories
*/
CXTPCalendarEventCategoryIDs* GetCategories() const;
/**
* @brief
* This member function is used to obtain the count of Event category
* IDs associated with an event object.
*
* @return An int that contains the count of CXTPCalendarEventCategoryIDs.
*
* @see CXTPCalendarEventCategories overview
* @see CXTPCalendarData::GetEventCategories
*/
int GetCategoriesCount() const;
/**
* @brief
* Call this member function to Store/Load an event using the
* specified data object.
*
* @param pPX Source or destination CXTPPropExchange data object reference.
*
* @details
* This member function is used to either store event data to or
* load event data from storage.
*/
virtual void DoPropExchange(CXTPPropExchange* pPX);
/**
* @brief
* Get custom (named, user-defined) properties collection.
*
* @return A pointer to a CXTPCalendarCustomProperties object.
*
* @see CXTPCalendarCustomProperties.
*/
CXTPCalendarCustomProperties* GetCustomProperties() const;
/**
* @brief
* This member function is used to obtain the original start
* time of an exception event.
*
* @return A COleDateTime object with the start original date.
*
* @see SetRException_StartTimeOrig
* @see GetRException_EndTimeOrig
*/
virtual COleDateTime GetRException_StartTimeOrig() const;
/**
* @brief
* This member function is used to set the original start time
* of an exception event.
*
* @param dtStartOrig A COleDateTime object that contains the original
* start time of the exception event.
*
* @see GetRException_StartTimeOrig
*/
virtual void SetRException_StartTimeOrig(COleDateTime dtStartOrig);
/**
* @brief
* This member function is used to obtain the original end time
* of an exception event.
*
* @return A COleDateTime object that contains the original date.
*
* @see GetRException_StartTimeOrig
* @see SetRException_EndTimeOrig
*/
virtual COleDateTime GetRException_EndTimeOrig() const;
/**
* @brief
* This member function is used to set the original end time of
* an exception event.
*
* @param dtEndOrig A COleDateTime object that contains the original
* end time of an exception event.
*
* @see GetRException_EndTimeOrig
* @see SetRException_StartTimeOrig
*/
virtual void SetRException_EndTimeOrig(COleDateTime dtEndOrig);
// void SetPermanentlyROccurrence_Reminder(
// int nbIsReminder = xtpCalendarRmdPrm_DontChange,
// int nMinutesBeforeStart = xtpCalendarRmdPrm_DontChange );
// //, int nMinutesBeforeStart2_Snoozed = xtpCalendarRmdPrm_DontChange);
/**
* @brief
* This member function is used to set the new ID value for the
* event recurrence pattern.
*
* @param dwRecurrencePatternID An DWORD that contains the event
* recurrence pattern id value.
*/
virtual void SetRecurrencePatternID(DWORD dwRecurrencePatternID);
/**
* @brief
* Returns event data provider.
*
* @return A pointer to the data provider which stores this event object.
*/
CXTPCalendarData* GetDataProvider() const;
/**
* @brief
* This member function is used to obtain a pointer to the
* internally stored Recurrence Pattern object.
*
* @return A CXTPCalendarRecurrencePattern pointer that contains the
* Recurrence Pattern object.
*/
CXTPCalendarRecurrencePattern* GetRPatternRef() const;
protected:
/**
* @brief
* This member function is used to set all event properties to the
* empty or default state. The same as after new object creation.
*/
virtual void Clear(); // Clear current event properties
/**
* @brief
* This member function is used to calculate the date-time
* values of the start and end dates for occurrences of recurrent events.
*
* @return TRUE if successful. FALSE otherwise.
*/
virtual BOOL CalcStartEndDatesFromPattern();
/**
* @brief
* This member function is used to change the date-time values
* of the start and end dates of the master event using exception
* occurrences of recurrent events.
*
* @return TRUE if successful. FALSE otherwise.
*/
virtual BOOL UpdateStartEndDatesFromPatternExceptions();
/**
* @brief
* This member function is used to assign a new RecurrencePattern
* to an event and set the Master flag.
*
* @param pPattern Pointer to a CXTPCalendarRecurrencePattern object that
* contains the new recurrence pattern for the event.
*
* @return TRUE If the provided event start dates are equal. FALSE otherwise.
*/
virtual BOOL SetRecurrenceState_Master(CXTPCalendarRecurrencePattern* pPattern);
/**
* @brief
* This member function is used to set the exception recurrence.
*
* @param nState An int that contains the new state value.
* @param dwNewPatternID A DWORD that contains the new pattern ID.
*
* @return TRUE if the provided event start dates are equal. FALSE otherwise.
*/
virtual BOOL SetRecurrenceState_ExceptionOccurrence(
XTPCalendarEventRecurrenceState nState,
DWORD dwNewPatternID = XTP_CALENDAR_UNKNOWN_RECURRENCE_PATTERN_ID);
/**
* @brief
* This function is used to reset the recurrence state for an event.
*
* @return Always returns TRUE.
*/
virtual BOOL SetRecurrenceState_NotRecurring();
/**
* @brief
* Clear intermediate data members which where set when operations
* with recurrence properties where made.
*
* @details
* This method is automatically called by the date provider
* when event is updated or added.
*/
virtual void ClearIntermediateData();
protected:
CXTPCalendarData* m_pDataProvider; /**< Pointer to the owner data provider.*/
BOOL m_bMeeting; /**< Boolean flag that is used to indicate if an event is a meeting.*/
BOOL m_bPrivate; /**< Boolean flag that is used to indicate if an event is a private meeting.*/
DWORD m_dwEventID; /**< ID of this event object.*/
int m_nLabelID; /**< Label ID. */
CString m_strSubject; /**< Subject value. */
CString m_strLocation; /**< Location value. */
UINT m_uScheduleID; /**< ID of the corresponding Schedule.*/
BOOL m_bEventVisible; /**< flag to display event on screen */
BOOL m_bAllDayEvent; /**< Is this an all day event value. */
COleDateTime m_dtStartTime; /**< Start event time value. */
COleDateTime m_dtEndTime; /**< End event time value. */
BOOL m_bReminder; /**< This flag value indicates is the Reminder enabled or not.*/
int m_nReminderMinutesBeforeStart; /**< Reminder time value. (in minutes)*/
CString m_strReminderSoundFile; /**< Reminder sound file path.*/
CString m_strBody; /**< Body value.*/
int m_nBusyStatus; /**< Event Busy Status value.*/
int m_nImportance; /**< Event Importance value. */
XTPCalendarEventRecurrenceState m_nRecurrenceState; /**< Event Recurrence State. */
COleDateTime m_dtCreationTime; /**< Creation event time value.*/
COleDateTime m_dtLastModificationTime; /**< Last Modification event time value.*/
CXTPCalendarRecurrencePatternPtr m_ptrRPattern; /**< Recurrence Pattern object for a master
event only.*/
DWORD m_dwRecurrencePatternID; /**< Recurrence Pattern ID.*/
BOOL m_bRExceptionDeleted; /**< Is Recurrence Exception deleted.*/
COleDateTime m_dtRException_StartTimeOrig; /**< Original start time of Recurrence exception
event.*/
COleDateTime m_dtRException_EndTimeOrig; /**< Original end time of Recurrence exception event.*/
DWORD m_dwRecurrencePatternID_ToUse; /**< Previously used pattern ID.*/
CXTPCalendarCustomProperties* m_pCustomProperties; /**< Custom properties collection object.*/
CXTPCalendarCustomIconIDs* m_pCustomIconsIDs; /**< An array to store custom icons id's assigned
to event.*/
CXTPCalendarEventCategoryIDs* m_pEventCategoryIDs; /**< An array to store categories id's
assigned to event.*/
CString m_sMultipleSchedules; /**< ScheduleSet string in form "|#1|...|#N|"*/
protected:
# ifdef _XTP_ACTIVEX
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
DECLARE_OLETYPELIB_EX(CXTPCalendarEvent);
afx_msg DATE OleGetStartTime();
afx_msg void OleSetStartTime(DATE dt);
afx_msg DATE OleGetEndTime();
afx_msg void OleSetEndTime(DATE dt);
afx_msg LPDISPATCH OleGetStartTimeV();
afx_msg LPDISPATCH OleGetEndTimeV();
afx_msg long OleGetEventID();
afx_msg DATE OleGetCreationTime();
afx_msg void OleSetCreationTime(DATE dt);
afx_msg DATE OleGetLastModificationTime();
afx_msg void OleSetLastModificationTime(DATE dt);
afx_msg int OleGetRecurrence();
afx_msg LPDISPATCH OleGetRecurrencePattern();
afx_msg LPDISPATCH OleCreateRecurrence();
afx_msg LPDISPATCH OleCreateRecurrenceEx(long nPatternID);
afx_msg void OleUpdateRecurrence(LPDISPATCH Pattern);
afx_msg void OleRemoveRecurrence();
afx_msg void OleMakeAsRException();
afx_msg void OleMakeAsRExceptionEx(long nPatternID);
afx_msg void OleSetRExceptionDeleted(BOOL bDeleted);
afx_msg LPDISPATCH OleCloneEvent();
afx_msg void OleUpdate(LPDISPATCH SourceEvent);
afx_msg LPDISPATCH OleGetCustomProperties();
afx_msg LPDISPATCH OleGetCustomIcons();
afx_msg LPDISPATCH OleGetDataProvider();
afx_msg LPDISPATCH OleGetCategories();
# endif
};
AFX_INLINE DWORD CXTPCalendarEvent::GetEventID() const
{
return m_dwEventID;
}
AFX_INLINE CString CXTPCalendarEvent::GetSubject() const
{
return m_strSubject;
}
AFX_INLINE void CXTPCalendarEvent::SetSubject(LPCTSTR pcszSubject)
{
m_strSubject = pcszSubject;
}
AFX_INLINE UINT CXTPCalendarEvent::GetScheduleID() const
{
return m_uScheduleID;
}
AFX_INLINE void CXTPCalendarEvent::SetScheduleID(UINT uScheduleID)
{
m_uScheduleID = uScheduleID;
}
AFX_INLINE CString CXTPCalendarEvent::GetLocation() const
{
return m_strLocation;
}
AFX_INLINE void CXTPCalendarEvent::SetLocation(LPCTSTR pcszLocation)
{
m_strLocation = pcszLocation;
}
AFX_INLINE int CXTPCalendarEvent::GetLabelID() const
{
return m_nLabelID;
}
AFX_INLINE void CXTPCalendarEvent::SetLabelID(int nLabelID)
{
m_nLabelID = nLabelID;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsEventVisible() const
{
return m_bEventVisible;
}
AFX_INLINE void CXTPCalendarEvent::SetEventVisible(BOOL bSet)
{
m_bEventVisible = bSet;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsAllDayEvent() const
{
return m_bAllDayEvent;
}
AFX_INLINE void CXTPCalendarEvent::SetAllDayEvent(BOOL bSet)
{
_ASSERTE(m_nRecurrenceState != xtpCalendarRecurrenceOccurrence);
m_bAllDayEvent = bSet;
}
AFX_INLINE COleDateTime CXTPCalendarEvent::GetStartTime() const
{
return m_dtStartTime;
}
AFX_INLINE COleDateTime CXTPCalendarEvent::GetEndTime() const
{
return m_dtEndTime;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsReminder() const
{
return m_bReminder;
}
AFX_INLINE void CXTPCalendarEvent::SetReminder(BOOL bReminder)
{
m_bReminder = bReminder;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsSound() const
{
return !m_strReminderSoundFile.IsEmpty();
}
AFX_INLINE int CXTPCalendarEvent::GetReminderMinutesBeforeStart() const
{
return m_nReminderMinutesBeforeStart;
}
AFX_INLINE void CXTPCalendarEvent::SetReminderMinutesBeforeStart(int nMinutes)
{
m_nReminderMinutesBeforeStart = nMinutes;
}
AFX_INLINE CString CXTPCalendarEvent::GetReminderSoundFile() const
{
return m_strReminderSoundFile;
}
AFX_INLINE void CXTPCalendarEvent::SetReminderSoundFile(LPCTSTR pcszFile)
{
m_strReminderSoundFile = pcszFile;
}
AFX_INLINE CString CXTPCalendarEvent::GetBody() const
{
return m_strBody;
}
AFX_INLINE void CXTPCalendarEvent::SetBody(LPCTSTR pcszDesc)
{
m_strBody = pcszDesc;
}
AFX_INLINE int CXTPCalendarEvent::GetBusyStatus() const
{
return m_nBusyStatus;
}
AFX_INLINE void CXTPCalendarEvent::SetBusyStatus(int nStatus)
{
m_nBusyStatus = nStatus;
}
AFX_INLINE int CXTPCalendarEvent::GetImportance() const
{
return m_nImportance;
}
AFX_INLINE void CXTPCalendarEvent::SetImportance(int nImportance)
{
m_nImportance = nImportance;
}
AFX_INLINE XTPCalendarEventRecurrenceState CXTPCalendarEvent::GetRecurrenceState() const
{
return m_nRecurrenceState;
}
AFX_INLINE COleDateTime CXTPCalendarEvent::GetCreationTime() const
{
return m_dtCreationTime;
}
AFX_INLINE void CXTPCalendarEvent::SetCreationTime(COleDateTime dtTime)
{
m_dtCreationTime = dtTime;
}
AFX_INLINE COleDateTime CXTPCalendarEvent::GetLastModificationTime() const
{
return m_dtLastModificationTime;
}
AFX_INLINE void CXTPCalendarEvent::SetLastModificationTime(COleDateTime dtTime)
{
m_dtLastModificationTime = dtTime;
}
AFX_INLINE DWORD CXTPCalendarEvent::GetRecurrencePatternID() const
{
return m_dwRecurrencePatternID;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsRExceptionDeleted() const
{
return m_bRExceptionDeleted;
}
AFX_INLINE void CXTPCalendarEvent::SetRExceptionDeleted(BOOL bDeleted)
{
m_bRExceptionDeleted = bDeleted;
}
AFX_INLINE COleDateTime CXTPCalendarEvent::GetRException_StartTimeOrig() const
{
return m_dtRException_StartTimeOrig;
}
AFX_INLINE void CXTPCalendarEvent::SetRException_StartTimeOrig(COleDateTime dtStartOrig)
{
m_dtRException_StartTimeOrig = dtStartOrig;
}
AFX_INLINE COleDateTime CXTPCalendarEvent::GetRException_EndTimeOrig() const
{
return m_dtRException_EndTimeOrig;
}
AFX_INLINE void CXTPCalendarEvent::SetRException_EndTimeOrig(COleDateTime dtEndOrig)
{
m_dtRException_EndTimeOrig = dtEndOrig;
}
AFX_INLINE BOOL CXTPCalendarEvent::MakeAsRException(DWORD dwPatternID)
{
_ASSERTE(m_nRecurrenceState == xtpCalendarRecurrenceNotRecurring
|| m_nRecurrenceState == xtpCalendarRecurrenceOccurrence
|| m_nRecurrenceState == xtpCalendarRecurrenceException);
return SetRecurrenceState_ExceptionOccurrence(xtpCalendarRecurrenceException, dwPatternID);
}
AFX_INLINE void CXTPCalendarEvent::SetMeeting(BOOL bMeeting)
{
m_bMeeting = bMeeting;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsMeeting() const
{
return m_bMeeting;
}
AFX_INLINE void CXTPCalendarEvent::SetPrivate(BOOL bPrivate)
{
m_bPrivate = bPrivate;
}
AFX_INLINE BOOL CXTPCalendarEvent::IsPrivate() const
{
return m_bPrivate;
}
AFX_INLINE CXTPCalendarCustomProperties* CXTPCalendarEvent::GetCustomProperties() const
{
return m_pCustomProperties;
}
AFX_INLINE CXTPCalendarData* CXTPCalendarEvent::GetDataProvider() const
{
return m_pDataProvider;
}
AFX_INLINE CXTPCalendarCustomIconIDs* CXTPCalendarEvent::GetCustomIcons() const
{
return m_pCustomIconsIDs;
}
AFX_INLINE CXTPCalendarEventCategoryIDs* CXTPCalendarEvent::GetCategories() const
{
return m_pEventCategoryIDs;
}
AFX_INLINE CString CXTPCalendarEvent::GetScheduleSet() const
{
return m_sMultipleSchedules;
}
AFX_INLINE void CXTPCalendarEvent::SetScheduleSet(CString ScheduleSet)
{
m_sMultipleSchedules = ScheduleSet;
}
# include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h"
#endif // !defined(_XTPCALENDAREVENT_H__)