Aspose.Tasks for C++
WeekDayCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="WeekDayCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/collections/ilist.h>
9 #include <system/array.h>
10 #include <cstdint>
11 
12 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
13 
14 namespace Aspose
15 {
16 namespace Tasks
17 {
18 class Calendar;
19 namespace Connectivity
20 {
21 class MpdCalendarMapper;
22 class MspCalendarMapper;
23 } // namespace Connectivity
24 enum class DayType;
25 namespace IO
26 {
27 namespace MSProject
28 {
29 class Mpp12CalendarWriter;
30 class Mpp9CalendarWriter;
31 class MPP9DefaultWeekWorkingDaysReader;
32 class MPPReader;
33 class MppWeekDayReader;
34 } // namespace MSProject
35 namespace Pwa
36 {
37 namespace InternalApi
38 {
39 namespace Mapping
40 {
41 class ProjectCalendarsMapper;
42 } // namespace Mapping
43 } // namespace InternalApi
44 } // namespace Pwa
45 } // namespace IO
46 class Project;
47 namespace Saving
48 {
49 class MpxWriter;
50 } // namespace Saving
51 class WeekDay;
52 class WorkWeek;
53 } // namespace Tasks
54 } // namespace Aspose
55 namespace System
56 {
57 namespace Collections
58 {
59 namespace Generic
60 {
61 template <typename> class IComparer;
62 template <typename> class IEnumerator;
63 template <typename> class List;
64 } // namespace Generic
65 } // namespace Collections
66 } // namespace System
67 
68 namespace Aspose {
69 
70 namespace Tasks {
71 
72 /// <summary>
73 /// Represents a collection of <see cref="WeekDay"></see> objects.
74 /// </summary>
75 class ASPOSE_TASKS_SHARED_CLASS WeekDayCollection : public System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::WeekDay>>
76 {
78  typedef System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::WeekDay>> BaseType;
79 
80  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
81  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
82 
83  friend class Aspose::Tasks::Calendar;
84  friend class Aspose::Tasks::Project;
85  friend class Aspose::Tasks::Connectivity::MpdCalendarMapper;
86  friend class Aspose::Tasks::Connectivity::MspCalendarMapper;
87  friend class Aspose::Tasks::IO::MSProject::MPP9DefaultWeekWorkingDaysReader;
88  friend class Aspose::Tasks::IO::MSProject::MPPReader;
89  friend class Aspose::Tasks::IO::MSProject::MppWeekDayReader;
90  friend class Aspose::Tasks::IO::MSProject::Mpp12CalendarWriter;
91  friend class Aspose::Tasks::IO::MSProject::Mpp9CalendarWriter;
92  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::ProjectCalendarsMapper;
93  friend class Aspose::Tasks::Saving::MpxWriter;
94  friend class Aspose::Tasks::WorkWeek;
95 
96 public:
97 
98  /// <summary>
99  /// Gets the number of objects contained in this <see cref="WeekDayCollection"></see> object.
100  /// </summary>
101  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
102 
103  /// <summary>
104  /// Gets the item value at specified index.
105  /// </summary>
106  /// <param name="index">The zero-based index of the element to get or set.</param>
107  ASPOSE_TASKS_SHARED_API System::SharedPtr<WeekDay> idx_get(int32_t index) const override;
108  /// <summary>
109  /// Sets the item value at specified index.
110  /// </summary>
111  /// <param name="index">The zero-based index of the element to get or set.</param>
112  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, System::SharedPtr<WeekDay> value) override;
113 
114  /// <summary>
115  /// Returns an enumerator for this collection.
116  /// </summary>
117  /// <returns>an enumerator for this collection.</returns>
118  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<WeekDay>>> GetEnumerator() override;
119  /// <summary>
120  /// Adds a <see cref="WeekDay"></see> instance to this object.
121  /// </summary>
122  /// <param name="item">The item to add.</param>
123  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<WeekDay>& item) override;
124  /// <summary>
125  /// Removes an item at specified index.
126  /// </summary>
127  /// <param name="index">index of item to delete.</param>
128  ASPOSE_TASKS_SHARED_API void RemoveAt(int32_t index) override;
129  /// <summary>
130  /// Checks if collection contains <see cref="WeekDay"></see>.specified.
131  /// </summary>
132  /// <param name="item">The item to check against to.</param>
133  /// <returns>true, if collection contains item specified, of false otherwise.</returns>
134  ASPOSE_TASKS_SHARED_API bool Contains(const System::SharedPtr<WeekDay>& item) const override;
135  /// <summary>
136  /// Copies collection content to an array at specified index.
137  /// </summary>
138  /// <param name="array">Destination array of <see cref="WeekDay"></see> to copy to</param>
139  /// <param name="arrayIndex">Starting index for copy operation.</param>
140  ASPOSE_TASKS_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<WeekDay>> array, int32_t arrayIndex) override;
141  /// <summary>
142  /// Converts the WeekDayCollection object to a list of <see cref="WeekDay"></see> objects.
143  /// </summary>
144  /// <returns>List of <see cref="WeekDay"></see> objects.</returns>
145  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<WeekDay>>> ToList();
146  /// <summary>
147  /// Clear the WeekDayCollection object.
148  /// </summary>
149  ASPOSE_TASKS_SHARED_API void Clear() override;
150  /// <summary>
151  /// Returns index of <see cref="WeekDay"></see> specified.
152  /// </summary>
153  /// <param name="item">The item to check against to.</param>
154  /// <returns>Zero-based index of <see cref="WeekDay"></see> specified, if present, or -1 otherwise.</returns>
155  ASPOSE_TASKS_SHARED_API int32_t IndexOf(const System::SharedPtr<WeekDay>& item) const override;
156  /// <summary>
157  /// Inserts <see cref="WeekDay"></see> at specified index.
158  /// </summary>
159  /// <param name="index">Index to insert to.</param>
160  /// <param name="item">The item to insert.</param>
161  ASPOSE_TASKS_SHARED_API void Insert(int32_t index, const System::SharedPtr<WeekDay>& item) override;
162  /// <summary>
163  /// Removes <see cref="WeekDay"></see> specified, if any.
164  /// </summary>
165  /// <param name="item">The item to remove.</param>
166  /// <returns>True, if <see cref="WeekDay"></see> was removed, false if such item was not found.</returns>
167  ASPOSE_TASKS_SHARED_API bool Remove(const System::SharedPtr<WeekDay>& item) override;
168 
169 protected:
170 
171  ASPOSE_TASKS_SHARED_API WeekDayCollection(const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<WeekDay>>>& weekDays);
172 
173  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WeekDayCollection, CODEPORTING_ARGS(const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<WeekDay>>>& weekDays));
174 
175  ASPOSE_TASKS_SHARED_API WeekDayCollection();
176 
177  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WeekDayCollection, CODEPORTING_ARGS());
178  ASPOSE_TASKS_SHARED_API void Sort(int32_t index, int32_t count, const System::SharedPtr<System::Collections::Generic::IComparer<System::SharedPtr<WeekDay>>>& comparer);
179  ASPOSE_TASKS_SHARED_API bool HasWork();
180  ASPOSE_TASKS_SHARED_API const System::SharedPtr<WeekDay>& GetByDayType(DayType dayType);
181  ASPOSE_TASKS_SHARED_API const System::SharedPtr<WeekDay>& GetByDayType(int32_t dayType);
182 
183  virtual ASPOSE_TASKS_SHARED_API ~WeekDayCollection();
184 
185  #ifdef ASPOSE_GET_SHARED_MEMBERS
186  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
187  #endif
188 
189 
190 private:
191 
192  System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<WeekDay>>> weekDays;
193  System::ArrayPtr<System::SharedPtr<WeekDay>> weekDayTypes;
194 
195  bool get_IsReadOnly() const override;
196 
197  void AddWeekDayType(const System::SharedPtr<WeekDay>& wd);
198  void RemoveWeekDayType(const System::SharedPtr<WeekDay>& wd);
199 
200 };
201 
202 } // namespace Tasks
203 } // namespace Aspose
204 
205 
Represents a collection of WeekDay objects.
Definition: WeekDayCollection.h:75
Represent WorkWeek class
Definition: WorkWeek.h:29
Represents a calendar used in a project.
Definition: Calendar.h:297
Represents a project.
Definition: Project.h:551