Aspose.Tasks for C++
Filter.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="Filter.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/iequatable.h>
10 #include <system/icomparable.h>
11 #include <cstdint>
12 
13 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
14 
15 namespace Aspose
16 {
17 namespace Tasks
18 {
19 class FilterCollection;
20 class FilterCriteria;
21 namespace IO
22 {
23 namespace MSProject
24 {
25 class MPP14GanttChartReader;
26 class MPP9GanttChartReader;
27 class MPPFilterReader;
28 class MPPFilterWriter;
29 } // namespace MSProject
30 } // namespace IO
31 enum class ItemType;
32 class ProjectIntegrityValidator;
33 } // namespace Tasks
34 } // namespace Aspose
35 
36 namespace Aspose {
37 
38 namespace Tasks {
39 
40 /// <summary>
41 /// Represents a filter in Project.
42 /// </summary>
43 class ASPOSE_TASKS_SHARED_CLASS Filter final : public System::IComparable<System::SharedPtr<Aspose::Tasks::Filter>>, public System::IEquatable<System::SharedPtr<Aspose::Tasks::Filter>>
44 {
45  typedef Filter ThisType;
46  typedef System::IComparable<System::SharedPtr<Aspose::Tasks::Filter>> BaseType;
47  typedef System::IEquatable<System::SharedPtr<Aspose::Tasks::Filter>> BaseType1;
48 
49  typedef ::System::BaseTypesInfo<BaseType, BaseType1> ThisTypeBaseTypesInfo;
50  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
51 
52  friend class Aspose::Tasks::IO::MSProject::MPPFilterWriter;
54  friend class Aspose::Tasks::IO::MSProject::MPP9GanttChartReader;
55  friend class Aspose::Tasks::ProjectIntegrityValidator;
56  friend class Aspose::Tasks::IO::MSProject::MPPFilterReader;
57  friend class Aspose::Tasks::IO::MSProject::MPP14GanttChartReader;
58  friend ASPOSE_TASKS_SHARED_API bool operator ==(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
59  friend ASPOSE_TASKS_SHARED_API bool operator !=(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
60  friend ASPOSE_TASKS_SHARED_API bool operator <(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
61  friend ASPOSE_TASKS_SHARED_API bool operator >(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
62  friend ASPOSE_TASKS_SHARED_API bool operator >=(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
63  friend ASPOSE_TASKS_SHARED_API bool operator <=(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
64 
65 public:
66 
67  /// <summary>
68  /// Gets the type of the filter.
69  /// </summary>
70  ASPOSE_TASKS_SHARED_API ItemType get_FilterType() const;
71  /// <summary>
72  /// Gets the type of the filter.
73  /// </summary>
74  ASPOSE_TASKS_SHARED_API void set_FilterType(ItemType value);
75  /// <summary>
76  /// Gets the name of a Filter object.
77  /// </summary>
78  ASPOSE_TASKS_SHARED_API System::String get_Name() const;
79  /// <summary>
80  /// Sets the name of a Filter object.
81  /// </summary>
82  ASPOSE_TASKS_SHARED_API void set_Name(const System::String& value);
83  /// <summary>
84  /// Gets a value indicating whether project shows the filter name in the Filter drop-down list on the View tab of the Ribbon.
85  /// </summary>
86  ASPOSE_TASKS_SHARED_API bool get_ShowInMenu() const;
87  /// <summary>
88  /// Sets a value indicating whether project shows the filter name in the Filter drop-down list on the View tab of the Ribbon.
89  /// </summary>
90  ASPOSE_TASKS_SHARED_API void set_ShowInMenu(bool value);
91  /// <summary>
92  /// Gets a value indicating whether related summary rows are displayed for the filter.
93  /// </summary>
94  ASPOSE_TASKS_SHARED_API bool get_ShowRelatedSummaryRows() const;
95  /// <summary>
96  /// Sets a value indicating whether related summary rows are displayed for the filter.
97  /// </summary>
98  ASPOSE_TASKS_SHARED_API void set_ShowRelatedSummaryRows(bool value);
99  /// <summary>
100  /// Gets the index of a <see cref="Filter"></see> object in the Filters containing object.
101  /// </summary>
102  ASPOSE_TASKS_SHARED_API int32_t get_Index() const;
103  /// <summary>
104  /// Gets the unique identifier of a filter.
105  /// </summary>
106  ASPOSE_TASKS_SHARED_API int32_t get_Uid() const;
107  /// <summary>
108  /// Gets the criteria that tasks or resources must meet to be displayed in MSP view.
109  /// </summary>
110  ASPOSE_TASKS_SHARED_API const System::SharedPtr<FilterCriteria>& get_Criteria() const;
111  /// <summary>
112  /// Sets the criteria that tasks or resources must meet to be displayed in MSP view.
113  /// </summary>
114  ASPOSE_TASKS_SHARED_API void set_Criteria(const System::SharedPtr<FilterCriteria>& value);
115 
116  /// <summary>
117  /// Compares this instance to the specified instance of the <see cref="Filter"></see> class and returns an indication of their relative order.
118  /// </summary>
119  /// <param name="other">the specified instance of the <see cref="Filter"></see> class to compare to this object.</param>
120  /// <returns>an indication of their relative order.</returns>
121  ASPOSE_TASKS_SHARED_API int32_t CompareTo(System::SharedPtr<Filter> other) override;
122  /// <summary>
123  /// Returns a value indicating whether this instance is equal to the specified AssignmentBaseline object.
124  /// </summary>
125  /// <param name="other">the specified AssignmentBaseline object to compare with this instance.</param>
126  /// <returns>returns true if this instance is equal to the specified AssignmentBaseline object; otherwise, false.</returns>
127  ASPOSE_TASKS_SHARED_API bool Equals(System::SharedPtr<Filter> other) override;
128  /// <summary>
129  /// Returns a value indicating whether this instance is equal to the specified AssignmentBaseline object.
130  /// </summary>
131  /// <param name="obj">the specified AssignmentBaseline object to compare with this instance.</param>
132  /// <returns>returns true if this instance is equal to the specified AssignmentBaseline object; otherwise, false.</returns>
133  ASPOSE_TASKS_SHARED_API bool Equals(System::SharedPtr<System::Object> obj) override;
134  /// <summary>
135  /// Returns a hash code value for the filter.
136  /// </summary>
137  /// <returns>returns a hash code value for this object.</returns>
138  ASPOSE_TASKS_SHARED_API int32_t GetHashCode() const override;
139 
140  ASPOSE_TASKS_SHARED_API Filter();
141 
142 protected:
143 
144  /// <summary>
145  /// Gets the index of a <see cref="Filter"></see> object in the Filters containing object.
146  /// </summary>
147  ASPOSE_TASKS_SHARED_API void set_Index(int32_t value);
148  /// <summary>
149  /// Gets the unique identifier of a filter.
150  /// </summary>
151  ASPOSE_TASKS_SHARED_API void set_Uid(int32_t value);
152 
153  virtual ASPOSE_TASKS_SHARED_API ~Filter();
154 
155  #ifdef ASPOSE_GET_SHARED_MEMBERS
156  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
157  #endif
158 
159 
160 private:
161 
162  static const int32_t MaxNameLength;
163  System::String name;
164  ItemType pr_FilterType;
165  bool pr_ShowInMenu;
166  bool pr_ShowRelatedSummaryRows;
167  int32_t pr_Index;
168  int32_t pr_Uid;
169  System::SharedPtr<FilterCriteria> pr_Criteria;
170 
171  System::String get_DebuggerDisplay();
172 
173  System::String GetFilterTypeString();
174 
175 };
176 
177 ASPOSE_TASKS_SHARED_API bool operator ==(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
178 ASPOSE_TASKS_SHARED_API bool operator !=(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
179 ASPOSE_TASKS_SHARED_API bool operator <(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
180 ASPOSE_TASKS_SHARED_API bool operator >(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
181 ASPOSE_TASKS_SHARED_API bool operator >=(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
182 ASPOSE_TASKS_SHARED_API bool operator <=(const System::SharedPtr<Filter>& a, const System::SharedPtr<Filter>& b);
183 
184 } // namespace Tasks
185 } // namespace Aspose
186 
187 
Represents a filter in Project.
Definition: Filter.h:43
Contains a list of Filter objects. Implements ICollection<Filter> interface.
Definition: FilterCollection.h:51