Aspose.Tasks for C++
RecurringTaskParameters.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="RecurringTaskParameters.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/string.h>
9 #include <system/enum_helpers.h>
10 
11 #include "aspose.tasks.cpp/Duration.h"
12 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
13 
14 namespace Aspose
15 {
16 namespace Tasks
17 {
18 class Calendar;
19 enum class Month;
20 enum class OrdinalNumber;
21 class Project;
22 enum class RecurrencePattern;
23 class RecurrencePatternBase;
24 class RecurrenceRangeBase;
25 class RecurringTaskBuilder;
26 class RecurringTaskInfo;
27 class Task;
28 namespace Validators
29 {
30 class RecurringTaskParametersValidator;
31 } // namespace Validators
32 enum class WeekdayType;
33 } // namespace Tasks
34 } // namespace Aspose
35 namespace System
36 {
37 class DateTime;
38 enum class DayOfWeek;
39 } // namespace System
40 
41 namespace Aspose {
42 
43 namespace Tasks {
44 
45 /// <summary>
46 /// Represents the set of parameters are used to create a recurring task in a project.
47 /// </summary>
48 class ASPOSE_TASKS_SHARED_CLASS RecurringTaskParameters : public System::Object
49 {
51  typedef System::Object BaseType;
52 
53  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
54  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
55 
56  friend class Aspose::Tasks::RecurringTaskBuilder;
57  friend class Aspose::Tasks::Validators::RecurringTaskParametersValidator;
58 
59 private:
60 
61  class TaskRecurringInfoBuilder : public System::Object
62  {
63  typedef TaskRecurringInfoBuilder ThisType;
64  typedef System::Object BaseType;
65 
66  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
67  RTTI_INFO_DECL();
68 
69  public:
70 
71  System::SharedPtr<RecurringTaskInfo> Build(const System::SharedPtr<Task>& task, const System::SharedPtr<RecurringTaskParameters>& parameters);
72 
73  private:
74 
75  int32_t GetDailyRepetitions(const System::SharedPtr<RecurrencePatternBase>& pattern);
76  System::DateTime GetFinishDate(const System::SharedPtr<RecurrenceRangeBase>& rangeBase);
77  int32_t GetMonthlyDay(const System::SharedPtr<RecurrencePatternBase>& pattern);
78  System::DayOfWeek GetMonthlyOrdinalDay(const System::SharedPtr<RecurrencePatternBase>& pattern);
79  OrdinalNumber GetMonthlyOrdinalNumber(const System::SharedPtr<RecurrencePatternBase>& pattern);
80  int32_t GetMonthlyOrdinalRepetitions(const System::SharedPtr<RecurrencePatternBase>& pattern);
81  int32_t GetMonthlyRepetitions(const System::SharedPtr<RecurrencePatternBase>& pattern);
82  int32_t GetOccurrences(const System::SharedPtr<RecurrencePatternBase>& patternBase);
83  RecurrencePattern GetRecurrencePatternType(const System::SharedPtr<RecurrencePatternBase>& pattern);
84  WeekdayType GetWeeklyDays(const System::SharedPtr<RecurrencePatternBase>& pattern);
85  int32_t GetWeeklyRepetitions(const System::SharedPtr<RecurrencePatternBase>& pattern);
86  System::DateTime GetYearlyDate(const System::SharedPtr<RecurrencePatternBase>& pattern, const System::SharedPtr<Task>& task);
87  System::DayOfWeek GetYearlyOrdinalDay(const System::SharedPtr<RecurrencePatternBase>& pattern);
88  Month GetYearlyOrdinalMonth(const System::SharedPtr<RecurrencePatternBase>& pattern);
89  OrdinalNumber GetYearlyOrdinalNumber(const System::SharedPtr<RecurrencePatternBase>& pattern);
90  bool IsDailyUseWorkDays(const System::SharedPtr<RecurrencePatternBase>& pattern);
91  bool IsMonthlyUseOrdinalDay(const System::SharedPtr<RecurrencePatternBase>& pattern);
92  bool IsUseEndDate(const System::SharedPtr<RecurrenceRangeBase>& recurrenceRange);
93  bool IsYearlyUseOrdinalDay(const System::SharedPtr<RecurrencePatternBase>& pattern);
94 
95  };
96 
97 
98 public:
99 
100  /// <summary>
101  /// Gets the duration for one occurrence of the recurring task.
102  /// <remarks>The instance of <see cref="Duration"></see> class.</remarks>
103  /// </summary>
104  ASPOSE_TASKS_SHARED_API Aspose::Tasks::Duration get_Duration() const;
105  /// <summary>
106  /// Sets the duration for one occurrence of the recurring task.
107  /// <remarks>The instance of <see cref="Duration"></see> class.</remarks>
108  /// </summary>
109  ASPOSE_TASKS_SHARED_API void set_Duration(Aspose::Tasks::Duration value);
110  /// <summary>
111  /// Gets a value indicating whether to schedule the recurring task even if it does not happen when any resources are available to work on it.
112  /// </summary>
113  ASPOSE_TASKS_SHARED_API bool get_IgnoreResourceCalendar() const;
114  /// <summary>
115  /// Sets a value indicating whether to schedule the recurring task even if it does not happen when any resources are available to work on it.
116  /// </summary>
117  ASPOSE_TASKS_SHARED_API void set_IgnoreResourceCalendar(bool value);
118  /// <summary>
119  /// Gets the recurrence pattern of the recurring task.
120  /// <remarks>Can be one of the values of <see cref="RecurrencePattern"></see> enumeration.</remarks>
121  /// </summary>
122  ASPOSE_TASKS_SHARED_API const System::SharedPtr<RecurrencePatternBase>& get_RecurrencePattern() const;
123  /// <summary>
124  /// Sets the recurrence pattern of the recurring task.
125  /// <remarks>Can be one of the values of <see cref="RecurrencePattern"></see> enumeration.</remarks>
126  /// </summary>
127  ASPOSE_TASKS_SHARED_API void set_RecurrencePattern(const System::SharedPtr<RecurrencePatternBase>& value);
128  /// <summary>
129  /// Gets the name of the recurring task.
130  /// </summary>
131  ASPOSE_TASKS_SHARED_API System::String get_TaskName() const;
132  /// <summary>
133  /// Sets the name of the recurring task.
134  /// </summary>
135  ASPOSE_TASKS_SHARED_API void set_TaskName(const System::String& value);
136 
137  /// <summary>
138  /// Initializes a new instance of the <see cref="RecurringTaskParameters"></see> class.
139  /// </summary>
140  ASPOSE_TASKS_SHARED_API RecurringTaskParameters();
141 
142  /// <summary>
143  /// Set a calendar for recurring task. The calendar is selected from project calendar collection.
144  /// </summary>
145  /// <param name="project">The project with calendar collection.</param>
146  /// <param name="calendarName">The name of calendar.</param>
147  ASPOSE_TASKS_SHARED_API void SetCalendar(const System::SharedPtr<Project>& project, const System::String& calendarName);
148 
149 protected:
150 
151  /// <summary>
152  /// Gets the calendar which is used to schedule tasks.
153  /// </summary>
154  ASPOSE_TASKS_SHARED_API const System::SharedPtr<Aspose::Tasks::Calendar>& get_Calendar() const;
155 
156  ASPOSE_TASKS_SHARED_API void EnsureInitializationIsDone();
157  ASPOSE_TASKS_SHARED_API System::SharedPtr<RecurringTaskInfo> GetRecurringInfo(const System::SharedPtr<Task>& task);
158 
159  virtual ASPOSE_TASKS_SHARED_API ~RecurringTaskParameters();
160 
161  #ifdef ASPOSE_GET_SHARED_MEMBERS
162  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
163  #endif
164 
165 
166 private:
167 
168  Aspose::Tasks::Duration pr_Duration;
169  bool pr_IgnoreResourceCalendar;
170  System::SharedPtr<RecurrencePatternBase> pr_RecurrencePattern;
171  System::String pr_TaskName;
172  System::SharedPtr<Aspose::Tasks::Calendar> pr_Calendar;
173 
174  /// <summary>
175  /// Gets the calendar which is used to schedule tasks.
176  /// </summary>
177  ASPOSE_TASKS_SHARED_API void set_Calendar(const System::SharedPtr<Aspose::Tasks::Calendar>& value);
178 
179 };
180 
181 } // namespace Tasks
182 } // namespace Aspose
183 
184 
Represents duration in a project.
Definition: Duration.h:161
Represents the set of parameters are used to create a recurring task in a project.
Definition: RecurringTaskParameters.h:49
const System::SharedPtr< RecurrencePatternBase > & get_RecurrencePattern() const
Gets the recurrence pattern of the recurring task.
void SetCalendar(const System::SharedPtr< Project > &project, const System::String &calendarName)
Set a calendar for recurring task. The calendar is selected from project calendar collection.
void set_RecurrencePattern(const System::SharedPtr< RecurrencePatternBase > &value)
Sets the recurrence pattern of the recurring task.
void set_TaskName(const System::String &value)
Sets the name of the recurring task.
RecurringTaskParameters()
Initializes a new instance of the RecurringTaskParameters class.
Aspose::Tasks::Duration get_Duration() const
Gets the duration for one occurrence of the recurring task.
System::String get_TaskName() const
Gets the name of the recurring task.
void set_Duration(Aspose::Tasks::Duration value)
Sets the duration for one occurrence of the recurring task.
bool get_IgnoreResourceCalendar() const
Gets a value indicating whether to schedule the recurring task even if it does not happen when any re...
void set_IgnoreResourceCalendar(bool value)
Sets a value indicating whether to schedule the recurring task even if it does not happen when any re...
Definition: Asn.h:13