Aspose.Tasks for C++
View.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="View.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/icomparable.h>
10 #include <system/guid.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 Filter;
20 class GanttChartView;
21 class Group;
22 namespace IO
23 {
24 namespace MSProject
25 {
26 class MPP12Reader;
27 class MPP12ViewReader;
28 class Mpp12ViewWriter;
29 class MPP14Reader;
30 class MPP9Reader;
31 class MppFolderBinaryStructure;
32 class MPPGanttBarStyleWriter;
33 class MppOleObjectWriter;
34 class MppSavedViewStateWriter;
35 class MppViewPropsInitializer;
36 class MPPViewReader;
37 class MppViewWriter;
38 class MppVisualObjectPlacementReader;
39 class TimelineViewWriter;
40 namespace Writers
41 {
42 class MppVisualObjectPlacementWriter;
43 } // namespace Writers
44 } // namespace MSProject
45 namespace Pwa
46 {
47 namespace InternalApi
48 {
49 namespace Mapping
50 {
51 class ProjectViewsMapper;
52 } // namespace Mapping
53 } // namespace InternalApi
54 } // namespace Pwa
55 } // namespace IO
56 enum class ItemType;
57 class OleObject;
58 class Project;
59 class ResourceUsageView;
60 namespace Saving
61 {
62 class LayoutBuilderFactory;
63 class SaveOptions;
64 } // namespace Saving
65 class Table;
66 class TaskUsageView;
67 class TimelineView;
68 class UsageView;
69 class ViewCollection;
70 enum class ViewScreen;
71 namespace Visualization
72 {
73 template <typename> class ApsBaseChartBuilder;
74 class PageInfo;
75 class ProjectView;
76 class VisualObjectPlacement;
77 } // namespace Visualization
78 } // namespace Tasks
79 } // namespace Aspose
80 namespace System
81 {
82 namespace Collections
83 {
84 namespace Generic
85 {
86 template <typename> class IEnumerable;
87 template <typename> class List;
88 } // namespace Generic
89 } // namespace Collections
90 } // namespace System
91 
92 namespace Aspose {
93 
94 namespace Tasks {
95 
96 /// <summary>
97 /// Represents a view in Project.
98 /// </summary>
99 class ASPOSE_TASKS_SHARED_CLASS View : public System::IComparable<System::SharedPtr<Aspose::Tasks::View>>
100 {
101  typedef View ThisType;
102  typedef System::IComparable<System::SharedPtr<Aspose::Tasks::View>> BaseType;
103 
104  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
105  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
106 
107  friend class Aspose::Tasks::IO::MSProject::MppVisualObjectPlacementReader;
108  friend class Aspose::Tasks::IO::MSProject::Writers::MppVisualObjectPlacementWriter;
109  friend class Aspose::Tasks::IO::MSProject::MppViewPropsInitializer;
110  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::ProjectViewsMapper;
111  friend class Aspose::Tasks::Project;
112  friend class Aspose::Tasks::IO::MSProject::MppOleObjectWriter;
113  friend class Aspose::Tasks::GanttChartView;
114  friend class Aspose::Tasks::IO::MSProject::MPP12Reader;
115  friend class Aspose::Tasks::IO::MSProject::MPP14Reader;
116  friend class Aspose::Tasks::IO::MSProject::MPP9Reader;
117  friend class Aspose::Tasks::IO::MSProject::MPP12ViewReader;
118  friend class Aspose::Tasks::IO::MSProject::MPPViewReader;
119  friend class Aspose::Tasks::IO::MSProject::MppSavedViewStateWriter;
120  friend class Aspose::Tasks::IO::MSProject::Mpp12ViewWriter;
121  friend class Aspose::Tasks::IO::MSProject::MppViewWriter;
122  friend class Aspose::Tasks::IO::MSProject::MPPGanttBarStyleWriter;
123  friend class Aspose::Tasks::IO::MSProject::TimelineViewWriter;
124  friend class Aspose::Tasks::OleObject;
126  friend class Aspose::Tasks::UsageView;
128  friend class Aspose::Tasks::Saving::LayoutBuilderFactory;
129  friend class Aspose::Tasks::TaskUsageView;
130  friend class Aspose::Tasks::TimelineView;
131  friend class Aspose::Tasks::ViewCollection;
132  template<typename FT0> friend class Aspose::Tasks::Visualization::ApsBaseChartBuilder;
134  friend ASPOSE_TASKS_SHARED_API bool operator ==(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
135  friend ASPOSE_TASKS_SHARED_API bool operator !=(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
136  friend ASPOSE_TASKS_SHARED_API bool operator <(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
137  friend ASPOSE_TASKS_SHARED_API bool operator >(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
138  friend ASPOSE_TASKS_SHARED_API bool operator >=(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
139  friend ASPOSE_TASKS_SHARED_API bool operator <=(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
140 
141 public:
142 
143  /// <summary>
144  /// Gets a filter used in a single view.
145  /// </summary>
146  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Tasks::Filter> get_Filter();
147  /// <summary>
148  /// Sets a filter used in a single view.
149  /// </summary>
150  ASPOSE_TASKS_SHARED_API void set_Filter(const System::SharedPtr<Aspose::Tasks::Filter>& value);
151  /// <summary>
152  /// Gets a group of the single view.
153  /// </summary>
154  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Tasks::Group> get_Group();
155  /// <summary>
156  /// Sets a group of the single view.
157  /// </summary>
158  ASPOSE_TASKS_SHARED_API void set_Group(const System::SharedPtr<Aspose::Tasks::Group>& value);
159  /// <summary>
160  /// Gets the unique identifier of a view.
161  /// </summary>
162  ASPOSE_TASKS_SHARED_API int32_t get_Uid() const;
163  /// <summary>
164  /// Gets a value indicating whether Microsoft Project highlights the filter for a single view.
165  /// </summary>
166  ASPOSE_TASKS_SHARED_API bool get_HighlightFilter() const;
167  /// <summary>
168  /// Sets a value indicating whether Microsoft Project highlights the filter for a single view.
169  /// </summary>
170  ASPOSE_TASKS_SHARED_API void set_HighlightFilter(bool value);
171  /// <summary>
172  /// Gets the name of a View object.
173  /// </summary>
174  ASPOSE_TASKS_SHARED_API System::String get_Name() const;
175  /// <summary>
176  /// Sets the name of a View object.
177  /// </summary>
178  ASPOSE_TASKS_SHARED_API void set_Name(const System::String& value);
179  /// <summary>
180  /// Gets the screen type for the single view.
181  /// Read-only <see cref="ViewScreen"></see>.
182  /// </summary>
183  ASPOSE_TASKS_SHARED_API ViewScreen get_Screen() const;
184  /// <summary>
185  /// Gets the parent of the View object.
186  /// Read-only <see cref="Project"></see>.
187  /// </summary>
188  ASPOSE_TASKS_SHARED_API const System::SharedPtr<Project>& get_ParentProject() const;
189  /// <summary>
190  /// Gets a table of the single view.
191  /// </summary>
192  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Tasks::Table> get_Table();
193  /// <summary>
194  /// Sets a table of the single view.
195  /// </summary>
196  ASPOSE_TASKS_SHARED_API void set_Table(const System::SharedPtr<Aspose::Tasks::Table>& value);
197  /// <summary>
198  /// Gets the type of item in the single view, such as tasks or resources.
199  /// Read-only <see cref="ItemType"></see>.
200  /// </summary>
201  ASPOSE_TASKS_SHARED_API ItemType get_Type() const;
202  /// <summary>
203  /// Gets a value indicating whether Microsoft Project shows the single view name in the View or the Other Views drop-down lists in the Ribbon.
204  /// </summary>
205  ASPOSE_TASKS_SHARED_API bool get_ShowInMenu() const;
206  /// <summary>
207  /// Sets a value indicating whether Microsoft Project shows the single view name in the View or the Other Views drop-down lists in the Ribbon.
208  /// </summary>
209  ASPOSE_TASKS_SHARED_API void set_ShowInMenu(bool value);
210  /// <summary>
211  /// Gets an instance of the <see cref="PageInfo"></see> class. Represents page setup data which is present in mpp file format.
212  /// </summary>
213  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Tasks::Visualization::PageInfo> get_PageInfo() const;
214  /// <summary>
215  /// Gets a collection of objects representing placement and appearance of <see cref="OleObject"></see> in the view.
216  /// </summary>
217  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<Visualization::VisualObjectPlacement>>> get_VisualObjectsPlacements();
218 
219  /// <summary>
220  /// Initializes a new instance of the <see cref="View"></see> class.
221  /// </summary>
222  ASPOSE_TASKS_SHARED_API View();
223  /// <summary>
224  /// Initializes a new instance of the <see cref="View"></see> class.
225  /// </summary>
226  /// <param name="viewScreen">The screen type for which the view can be displayed.</param>
227  ASPOSE_TASKS_SHARED_API View(ViewScreen viewScreen);
228 
229  /// <summary>
230  /// Returns a value indicating whether this instance is equal to a specified object.
231  /// </summary>
232  /// <param name="obj">The object to compare with this instance.</param>
233  /// <returns><b>True</b> if the specified object is a View that has the same Uid value as this instance; otherwise, <b>false</b>.</returns>
234  ASPOSE_TASKS_SHARED_API bool Equals(System::SharedPtr<System::Object> obj) override;
235  /// <summary>
236  /// Returns a hash code value for the instance of the <see cref="Resource"></see> class.
237  /// </summary>
238  /// <returns>returns a hash code value for this object.</returns>
239  ASPOSE_TASKS_SHARED_API int32_t GetHashCode() const override;
240  /// <summary>
241  /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
242  /// </summary>
243  /// <returns>
244  /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <paramref name="other"></paramref> in the sort order. Zero This instance occurs in the same position in the sort order as <paramref name="other"></paramref>. Greater than zero This instance follows <paramref name="other"></paramref> in the sort order.
245  /// </returns>
246  /// <param name="other">the specified View object to compare this instance to. </param>
247  ASPOSE_TASKS_SHARED_API int32_t CompareTo(System::SharedPtr<View> other) override;
248 
249 protected:
250 
251  /// <summary>
252  /// Gets the unique identifier of a view.
253  /// </summary>
254  ASPOSE_TASKS_SHARED_API void set_Uid(int32_t value);
255  /// <summary>
256  /// Gets the screen type for the single view.
257  /// Read-only <see cref="ViewScreen"></see>.
258  /// </summary>
259  ASPOSE_TASKS_SHARED_API void set_Screen(ViewScreen value);
260  /// <summary>
261  /// Gets the parent of the View object.
262  /// Read-only <see cref="Project"></see>.
263  /// </summary>
264  ASPOSE_TASKS_SHARED_API void set_ParentProject(const System::SharedPtr<Project>& value);
265  /// <summary>
266  /// Gets the type of item in the single view, such as tasks or resources.
267  /// Read-only <see cref="ItemType"></see>.
268  /// </summary>
269  ASPOSE_TASKS_SHARED_API void set_Type(ItemType value);
270  ASPOSE_TASKS_SHARED_API const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Visualization::VisualObjectPlacement>>>& get_VisualObjectsPlacementsInternal() const;
271  ASPOSE_TASKS_SHARED_API const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Visualization::VisualObjectPlacement>>>& get_VisualObjectsPlacementsDrawingObjects() const;
272  ASPOSE_TASKS_SHARED_API System::Guid get_Guid() const;
273  ASPOSE_TASKS_SHARED_API void set_Guid(System::Guid value);
274  /// <summary>
275  /// Gets the X position of the Chart (Gantt Chart for GanttChart View or Usage section for Task\Resource Usage views).
276  /// </summary>
277  ASPOSE_TASKS_SHARED_API int16_t get_ChartXPosition() const;
278  /// <summary>
279  /// Sets the X position of the Chart (Gantt Chart for GanttChart View or Usage section for Task\Resource Usage views).
280  /// </summary>
281  ASPOSE_TASKS_SHARED_API void set_ChartXPosition(int16_t value);
282  ASPOSE_TASKS_SHARED_API System::String get_DefaultTableName() const;
283  ASPOSE_TASKS_SHARED_API void set_DefaultTableName(const System::String& value);
284  ASPOSE_TASKS_SHARED_API System::String get_DefaultFilterName() const;
285  ASPOSE_TASKS_SHARED_API void set_DefaultFilterName(const System::String& value);
286  ASPOSE_TASKS_SHARED_API System::String get_DefaultGroupName() const;
287  ASPOSE_TASKS_SHARED_API void set_DefaultGroupName(const System::String& value);
288  /// <summary>
289  /// Gets the original mpp data.
290  /// </summary>
291  ASPOSE_TASKS_SHARED_API const System::SharedPtr<IO::MSProject::MppFolderBinaryStructure>& get_BinaryStruct() const;
292  /// <summary>
293  /// Sets the original mpp data.
294  /// </summary>
295  ASPOSE_TASKS_SHARED_API void set_BinaryStruct(const System::SharedPtr<IO::MSProject::MppFolderBinaryStructure>& value);
296 
297  ASPOSE_TASKS_SHARED_API View(int32_t uid);
298 
299  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(View, CODEPORTING_ARGS(int32_t uid));
300  #ifdef ASPOSE_GET_SHARED_MEMBERS
301  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
302  #endif
303 
304 
305 private:
306 
307  System::SharedPtr<Aspose::Tasks::Visualization::PageInfo> pageInfo;
308  int32_t uid;
309  System::SharedPtr<Aspose::Tasks::Filter> filter;
310  System::SharedPtr<Aspose::Tasks::Table> table;
311  System::SharedPtr<Aspose::Tasks::Group> group;
312  System::String defaultTableName;
313  bool pr_HighlightFilter;
314  System::String pr_Name;
315  ViewScreen pr_Screen;
316  System::WeakPtr<Project> pr_ParentProject;
317  ItemType pr_Type;
318  bool pr_ShowInMenu;
319  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Visualization::VisualObjectPlacement>>> pr_VisualObjectsPlacementsInternal;
320 
321  ASPOSE_TASKS_SHARED_API void set_VisualObjectsPlacementsInternal(const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Visualization::VisualObjectPlacement>>>& value);
322 
323  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Visualization::VisualObjectPlacement>>> pr_VisualObjectsPlacementsDrawingObjects;
324 
325  ASPOSE_TASKS_SHARED_API void set_VisualObjectsPlacementsDrawingObjects(const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Visualization::VisualObjectPlacement>>>& value);
326 
327  System::Guid pr_Guid;
328  int16_t pr_ChartXPosition;
329  System::String pr_DefaultFilterName;
330  System::String pr_DefaultGroupName;
331  System::SharedPtr<IO::MSProject::MppFolderBinaryStructure> pr_BinaryStruct;
332 
333  System::String get_DebuggerDisplay();
334 
335 };
336 
337 ASPOSE_TASKS_SHARED_API bool operator ==(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
338 ASPOSE_TASKS_SHARED_API bool operator !=(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
339 ASPOSE_TASKS_SHARED_API bool operator <(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
340 ASPOSE_TASKS_SHARED_API bool operator >(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
341 ASPOSE_TASKS_SHARED_API bool operator >=(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
342 ASPOSE_TASKS_SHARED_API bool operator <=(const System::SharedPtr<View>& a, const System::SharedPtr<View>& b);
343 
344 } // namespace Tasks
345 } // namespace Aspose
346 
347 
Represents a GanttChart view.
Definition: GanttChartView.h:69
Represents an OLE object which can be inserter into Gantt Chart View of an MPP file.
Definition: OleObject.h:39
Represents a project.
Definition: Project.h:551
Represents resource usage view in a project.
Definition: ResourceUsageView.h:45
This is an abstract base class for classes that allow the user to specify additional options when sav...
Definition: SaveOptions.h:95
Represents task usage view in a project.
Definition: TaskUsageView.h:44
Represents a timeline view of a project.
Definition: TimelineView.h:52
Represent a usage view in a project.
Definition: UsageView.h:37
Contains a list of View objects. Implements ICollection<View> interface.
Definition: ViewCollection.h:53
Represents a view in Project.
Definition: View.h:100
ItemType get_Type() const
Gets the type of item in the single view, such as tasks or resources. Read-only ItemType.
System::SharedPtr< Aspose::Tasks::Table > get_Table()
Gets a table of the single view.
void set_Filter(const System::SharedPtr< Aspose::Tasks::Filter > &value)
Sets a filter used in a single view.
int32_t CompareTo(System::SharedPtr< View > other) override
Compares the current instance with another object of the same type and returns an integer that indica...
System::String get_Name() const
Gets the name of a View object.
System::SharedPtr< Aspose::Tasks::Filter > get_Filter()
Gets a filter used in a single view.
void set_Name(const System::String &value)
Sets the name of a View object.
bool get_HighlightFilter() const
Gets a value indicating whether Microsoft Project highlights the filter for a single view.
int32_t get_Uid() const
Gets the unique identifier of a view.
void set_Table(const System::SharedPtr< Aspose::Tasks::Table > &value)
Sets a table of the single view.
const System::SharedPtr< Project > & get_ParentProject() const
Gets the parent of the View object. Read-only Project.
int32_t GetHashCode() const override
Returns a hash code value for the instance of the Resource class.
void set_Group(const System::SharedPtr< Aspose::Tasks::Group > &value)
Sets a group of the single view.
View(ViewScreen viewScreen)
Initializes a new instance of the View class.
ViewScreen get_Screen() const
Gets the screen type for the single view. Read-only ViewScreen.
void set_ShowInMenu(bool value)
Sets a value indicating whether Microsoft Project shows the single view name in the View or the Other...
bool Equals(System::SharedPtr< System::Object > obj) override
Returns a value indicating whether this instance is equal to a specified object.
View()
Initializes a new instance of the View class.
bool get_ShowInMenu() const
Gets a value indicating whether Microsoft Project shows the single view name in the View or the Other...
void set_HighlightFilter(bool value)
Sets a value indicating whether Microsoft Project highlights the filter for a single view.
System::SharedPtr< Aspose::Tasks::Group > get_Group()
Gets a group of the single view.
System::SharedPtr< Aspose::Tasks::Visualization::PageInfo > get_PageInfo() const
Gets an instance of the PageInfo class. Represents page setup data which is present in mpp file forma...
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< Visualization::VisualObjectPlacement > > > get_VisualObjectsPlacements()
Gets a collection of objects representing placement and appearance of OleObject in the view.
Project's view class
Definition: ProjectView.h:58
Definition: Asn.h:13