Aspose.Tasks for C++
FilterCriteria.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="FilterCriteria.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/array.h>
9 
10 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
11 
12 namespace Aspose
13 {
14 namespace Tasks
15 {
16 enum class Field;
17 enum class FilterComparisonType;
18 enum class FilterOperation;
19 namespace IO
20 {
21 namespace MSProject
22 {
23 class MPPFilterCriteriaReader;
24 class MPPFilterCriteriaWriter;
25 } // namespace MSProject
26 } // namespace IO
27 } // namespace Tasks
28 } // namespace Aspose
29 namespace System
30 {
31 namespace Collections
32 {
33 namespace Generic
34 {
35 template <typename> class List;
36 } // namespace Generic
37 } // namespace Collections
38 namespace Text
39 {
40 class StringBuilder;
41 } // namespace Text
42 } // namespace System
43 
44 namespace Aspose {
45 
46 namespace Tasks {
47 
48 /// <summary>
49 /// Defines the criteria that tasks or resources must meet to be displayed in MSP view.
50 /// </summary>
51 class ASPOSE_TASKS_SHARED_CLASS FilterCriteria : public System::Object
52 {
53  typedef FilterCriteria ThisType;
54  typedef System::Object BaseType;
55 
56  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
57  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
58 
59  friend class Aspose::Tasks::IO::MSProject::MPPFilterCriteriaWriter;
60  friend class Aspose::Tasks::IO::MSProject::MPPFilterCriteriaReader;
61 
62 public:
63 
64  /// <summary>
65  /// Gets the criterion established with FieldName, Test, and Value relates to other criteria in the filter.
66  /// </summary>
67  ASPOSE_TASKS_SHARED_API FilterOperation get_Operation() const;
68  /// <summary>
69  /// Sets the criterion established with FieldName, Test, and Value relates to other criteria in the filter.
70  /// </summary>
71  ASPOSE_TASKS_SHARED_API void set_Operation(FilterOperation value);
72  /// <summary>
73  /// Gets a <see cref="Field"></see> to change.
74  /// </summary>
75  ASPOSE_TASKS_SHARED_API Aspose::Tasks::Field get_Field() const;
76  /// <summary>
77  /// Sets a <see cref="Field"></see> to change.
78  /// </summary>
79  ASPOSE_TASKS_SHARED_API void set_Field(Aspose::Tasks::Field value);
80  /// <summary>
81  /// Gets the type of comparison made between FieldName and Value that acts as selection criteria for the filter.
82  /// <see cref="FilterComparisonType"></see>
83  /// </summary>
84  ASPOSE_TASKS_SHARED_API FilterComparisonType get_Test() const;
85  /// <summary>
86  /// Sets the type of comparison made between FieldName and Value that acts as selection criteria for the filter.
87  /// <see cref="FilterComparisonType"></see>
88  /// </summary>
89  ASPOSE_TASKS_SHARED_API void set_Test(FilterComparisonType value);
90  /// <summary>
91  /// Gets the object values to compare with the value of the field specified with FieldName.
92  /// </summary>
93  ASPOSE_TASKS_SHARED_API System::ArrayPtr<System::SharedPtr<System::Object>> get_Values() const;
94  /// <summary>
95  /// Gets the list of child <see cref="FilterCriteria"></see> rows.
96  /// If the filter contains more than one criterion row then the effect of an And operator is that the criteria for both rows must be met for the task or resource to be displayed as a result of this filter.
97  /// The effect of an Or operator is that the criteria for one or the other row must be met.
98  /// </summary>
99  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<FilterCriteria>>> get_CriteriaRows() const;
100 
101  /// <summary>
102  /// Gets whether the right-hand value of FilterCriteria is a field reference, not a constant value.
103  /// </summary>
104  ASPOSE_TASKS_SHARED_API bool IsFieldValue();
105  /// <summary>
106  /// Sets the field whose value will be compared with the value of the field specified by FieldName.
107  /// </summary>
108  /// <param name="value">Field which will serve as right-hand value of filter criteria.</param>
109  ASPOSE_TASKS_SHARED_API void SetValueField(Aspose::Tasks::Field value);
110  /// <summary>
111  /// Returns string representation of the instance of the <see cref="FilterCriteria"></see> class.
112  /// </summary>
113  /// <returns>string representation of this object.</returns>
114  ASPOSE_TASKS_SHARED_API System::String ToString() const override;
115 
116  ASPOSE_TASKS_SHARED_API FilterCriteria();
117 
118 protected:
119 
120  /// <summary>
121  /// Gets the object values to compare with the value of the field specified with FieldName.
122  /// </summary>
123  ASPOSE_TASKS_SHARED_API void set_Values(const System::ArrayPtr<System::SharedPtr<System::Object>>& value);
124 
125  #ifdef ASPOSE_GET_SHARED_MEMBERS
126  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
127  #endif
128 
129 
130 private:
131 
132  System::ArrayPtr<System::SharedPtr<System::Object>> values;
133  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<FilterCriteria>>> criteriaRows;
134  FilterOperation pr_Operation;
135  Aspose::Tasks::Field pr_Field;
136  FilterComparisonType pr_Test;
137 
138  void AppendValues(const System::SharedPtr<System::Text::StringBuilder>& sb) const;
139 
140 };
141 
142 } // namespace Tasks
143 } // namespace Aspose
144 
145 
Defines the criteria that tasks or resources must meet to be displayed in MSP view.
Definition: FilterCriteria.h:52
FilterOperation get_Operation() const
Gets the criterion established with FieldName, Test, and Value relates to other criteria in the filte...
System::String ToString() const override
Returns string representation of the instance of the FilterCriteria class.
System::ArrayPtr< System::SharedPtr< System::Object > > get_Values() const
Gets the object values to compare with the value of the field specified with FieldName.
void set_Operation(FilterOperation value)
Sets the criterion established with FieldName, Test, and Value relates to other criteria in the filte...
void set_Test(FilterComparisonType value)
Sets the type of comparison made between FieldName and Value that acts as selection criteria for the ...
Aspose::Tasks::Field get_Field() const
Gets a Field to change.
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< FilterCriteria > > > get_CriteriaRows() const
Gets the list of child FilterCriteria rows. If the filter contains more than one criterion row then t...
FilterComparisonType get_Test() const
Gets the type of comparison made between FieldName and Value that acts as selection criteria for the ...
void SetValueField(Aspose::Tasks::Field value)
Sets the field whose value will be compared with the value of the field specified by FieldName.
void set_Field(Aspose::Tasks::Field value)
Sets a Field to change.
bool IsFieldValue()
Gets whether the right-hand value of FilterCriteria is a field reference, not a constant value.
Definition: Asn.h:13