Aspose.Tasks for C++
GanttBarStyle.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="GanttBarStyle.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/nullable.h>
10 #include <drawing/color.h>
11 #include <cstdint>
12 
13 #include "aspose.tasks.cpp/Visualization/View/Styles/TaskBarTextConverter.h"
14 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
15 
16 namespace Aspose
17 {
18 namespace Tasks
19 {
20 enum class Field;
21 namespace IO
22 {
23 namespace MSProject
24 {
25 class MPP14GanttBarStyleReader;
26 class MPP14GanttBarStyleWriter;
27 class MPP9GanttBarStyleReader;
28 class MPP9GanttBarStyleWriter;
29 } // namespace MSProject
30 } // namespace IO
31 class Task;
32 namespace Visualization
33 {
34 enum class BarShape;
35 class BarStyle;
36 enum class GanttBarEndShape;
37 enum class GanttBarFillPattern;
38 enum class GanttBarMiddleShape;
39 enum class GanttBarShowFor;
40 enum class GanttBarType;
41 class GanttChartBarStylesManager;
42 enum class Shape;
43 } // namespace Visualization
44 } // namespace Tasks
45 } // namespace Aspose
46 namespace System
47 {
48 namespace Collections
49 {
50 namespace Generic
51 {
52 template <typename, typename> class Dictionary;
53 template <typename> class IList;
54 } // namespace Generic
55 } // namespace Collections
56 } // namespace System
57 
58 namespace Aspose {
59 
60 namespace Tasks {
61 
62 namespace Visualization {
63 
64 /// <summary>
65 /// Represents a bar style used by MSP in Gantt Chart view.
66 /// </summary>
67 class ASPOSE_TASKS_SHARED_CLASS GanttBarStyle : public System::Object
68 {
69  typedef GanttBarStyle ThisType;
70  typedef System::Object BaseType;
71 
72  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
73  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
74 
75  friend class Aspose::Tasks::IO::MSProject::MPP14GanttBarStyleReader;
76  friend class Aspose::Tasks::IO::MSProject::MPP9GanttBarStyleReader;
77  friend class Aspose::Tasks::IO::MSProject::MPP14GanttBarStyleWriter;
78  friend class Aspose::Tasks::IO::MSProject::MPP9GanttBarStyleWriter;
79  friend class Aspose::Tasks::Visualization::GanttChartBarStylesManager;
80 
81 public:
82 
83  /// <summary>
84  /// Gets data to be displayed on the bottom of the bar.
85  /// <see cref="Field"></see>.
86  /// </summary>
87  ASPOSE_TASKS_SHARED_API Field get_BottomField() const;
88  /// <summary>
89  /// Sets data to be displayed on the bottom of the bar.
90  /// <see cref="Field"></see>.
91  /// </summary>
92  ASPOSE_TASKS_SHARED_API void set_BottomField(Field value);
93  /// <summary>
94  /// Gets an end shape of the bar.
95  /// </summary>
96  ASPOSE_TASKS_SHARED_API GanttBarEndShape get_EndShape() const;
97  /// <summary>
98  /// Sets an end shape of the bar.
99  /// </summary>
100  ASPOSE_TASKS_SHARED_API void set_EndShape(GanttBarEndShape value);
101  /// <summary>
102  /// Gets a color of the end shape.
103  /// </summary>
104  ASPOSE_TASKS_SHARED_API System::Drawing::Color get_EndShapeColor() const;
105  /// <summary>
106  /// Sets a color of the end shape.
107  /// </summary>
108  ASPOSE_TASKS_SHARED_API void set_EndShapeColor(System::Drawing::Color value);
109  /// <summary>
110  /// Gets a type of the end shape.
111  /// <see cref="GanttBarType"></see>.
112  /// </summary>
113  ASPOSE_TASKS_SHARED_API GanttBarType get_EndShapeType() const;
114  /// <summary>
115  /// Sets a type of the end shape.
116  /// <see cref="GanttBarType"></see>.
117  /// </summary>
118  ASPOSE_TASKS_SHARED_API void set_EndShapeType(GanttBarType value);
119  /// <summary>
120  /// Gets a start point position of the gantt bar.
121  /// <see cref="Field"></see>.
122  /// </summary>
123  ASPOSE_TASKS_SHARED_API Field get_From() const;
124  /// <summary>
125  /// Sets a start point position of the gantt bar.
126  /// <see cref="Field"></see>.
127  /// </summary>
128  ASPOSE_TASKS_SHARED_API void set_From(Field value);
129  /// <summary>
130  /// Gets data to be displayed inside of the bar.
131  /// <see cref="Field"></see>.
132  /// </summary>
133  ASPOSE_TASKS_SHARED_API Field get_InsideField() const;
134  /// <summary>
135  /// Sets data to be displayed inside of the bar.
136  /// <see cref="Field"></see>.
137  /// </summary>
138  ASPOSE_TASKS_SHARED_API void set_InsideField(Field value);
139  /// <summary>
140  /// Gets data to be displayed on the left of the bar.
141  /// <see cref="Field"></see>.
142  /// </summary>
143  ASPOSE_TASKS_SHARED_API Field get_LeftField() const;
144  /// <summary>
145  /// Sets data to be displayed on the left of the bar.
146  /// <see cref="Field"></see>.
147  /// </summary>
148  ASPOSE_TASKS_SHARED_API void set_LeftField(Field value);
149  /// <summary>
150  /// Gets a fill pattern of the gantt bar.
151  /// </summary>
152  ASPOSE_TASKS_SHARED_API GanttBarFillPattern get_MiddleFillPattern() const;
153  /// <summary>
154  /// Sets a fill pattern of the gantt bar.
155  /// </summary>
156  ASPOSE_TASKS_SHARED_API void set_MiddleFillPattern(GanttBarFillPattern value);
157  /// <summary>
158  /// Gets a middle shape of the bar.
159  /// </summary>
160  ASPOSE_TASKS_SHARED_API GanttBarMiddleShape get_MiddleShape() const;
161  /// <summary>
162  /// Sets a middle shape of the bar.
163  /// </summary>
164  ASPOSE_TASKS_SHARED_API void set_MiddleShape(GanttBarMiddleShape value);
165  /// <summary>
166  /// Gets a color of the middle shape.
167  /// </summary>
168  ASPOSE_TASKS_SHARED_API System::Drawing::Color get_MiddleShapeColor() const;
169  /// <summary>
170  /// Sets a color of the middle shape.
171  /// </summary>
172  ASPOSE_TASKS_SHARED_API void set_MiddleShapeColor(System::Drawing::Color value);
173  /// <summary>
174  /// Gets a name of the style.
175  /// </summary>
176  ASPOSE_TASKS_SHARED_API System::String get_Name() const;
177  /// <summary>
178  /// Sets a name of the style.
179  /// </summary>
180  ASPOSE_TASKS_SHARED_API void set_Name(const System::String& value);
181  /// <summary>
182  /// Gets data to be displayed on the right of the bar.
183  /// <see cref="Field"></see>.
184  /// </summary>
185  ASPOSE_TASKS_SHARED_API Field get_RightField() const;
186  /// <summary>
187  /// Sets data to be displayed on the right of the bar.
188  /// <see cref="Field"></see>.
189  /// </summary>
190  ASPOSE_TASKS_SHARED_API void set_RightField(Field value);
191  /// <summary>
192  /// Gets user-defined converter to get text to render on the left of the task's bar. Overrides the value of <see cref="LeftField"></see> property.
193  /// <remarks>Is not persisted to MPP format.</remarks>
194  /// </summary>
195  ASPOSE_TASKS_SHARED_API TaskBarTextConverter get_LeftBarTextConverter() const;
196  /// <summary>
197  /// Sets user-defined converter to get text to render on the left of the task's bar. Overrides the value of <see cref="LeftField"></see> property.
198  /// <remarks>Is not persisted to MPP format.</remarks>
199  /// </summary>
200  ASPOSE_TASKS_SHARED_API void set_LeftBarTextConverter(TaskBarTextConverter value);
201  /// <summary>
202  /// Gets user-defined converter to get text to render on the top of the task's bar. Overrides the value of <see cref="TopField"></see> property.
203  /// </summary>
204  /// <remarks>Is not persisted to MPP format.</remarks>
205  ASPOSE_TASKS_SHARED_API TaskBarTextConverter get_TopBarTextConverter() const;
206  /// <summary>
207  /// Sets user-defined converter to get text to render on the top of the task's bar. Overrides the value of <see cref="TopField"></see> property.
208  /// </summary>
209  /// <remarks>Is not persisted to MPP format.</remarks>
210  ASPOSE_TASKS_SHARED_API void set_TopBarTextConverter(TaskBarTextConverter value);
211  /// <summary>
212  /// Gets user-defined converter to get text to render on the right of the task's bar. Overrides the value of <see cref="RightField"></see> property.
213  /// </summary>
214  /// <remarks>Is not persisted to MPP format.</remarks>
215  ASPOSE_TASKS_SHARED_API TaskBarTextConverter get_RightBarTextConverter() const;
216  /// <summary>
217  /// Sets user-defined converter to get text to render on the right of the task's bar. Overrides the value of <see cref="RightField"></see> property.
218  /// </summary>
219  /// <remarks>Is not persisted to MPP format.</remarks>
220  ASPOSE_TASKS_SHARED_API void set_RightBarTextConverter(TaskBarTextConverter value);
221  /// <summary>
222  /// Gets user-defined converter to get text to render on the bottom of the task's bar. Overrides the value of <see cref="BottomField"></see> property.
223  /// </summary>
224  /// <remarks>Is not persisted to MPP format.</remarks>
225  ASPOSE_TASKS_SHARED_API TaskBarTextConverter get_BottomBarTextConverter() const;
226  /// <summary>
227  /// Sets user-defined converter to get text to render on the bottom of the task's bar. Overrides the value of <see cref="BottomField"></see> property.
228  /// </summary>
229  /// <remarks>Is not persisted to MPP format.</remarks>
230  ASPOSE_TASKS_SHARED_API void set_BottomBarTextConverter(TaskBarTextConverter value);
231  /// <summary>
232  /// Gets user-defined converter to get text to render inside of the task's bar. Overrides the value of <see cref="InsideField"></see> property.
233  /// </summary>
234  /// <remarks>Is not persisted to MPP format.</remarks>
235  ASPOSE_TASKS_SHARED_API TaskBarTextConverter get_InsideBarTextConverter() const;
236  /// <summary>
237  /// Sets user-defined converter to get text to render inside of the task's bar. Overrides the value of <see cref="InsideField"></see> property.
238  /// </summary>
239  /// <remarks>Is not persisted to MPP format.</remarks>
240  ASPOSE_TASKS_SHARED_API void set_InsideBarTextConverter(TaskBarTextConverter value);
241  /// <summary>
242  /// Gets a row number.
243  /// <remarks> Can be from 1 to 4 (1 is default value).</remarks>
244  /// </summary>
245  ASPOSE_TASKS_SHARED_API int32_t get_Row() const;
246  /// <summary>
247  /// Sets a row number.
248  /// <remarks> Can be from 1 to 4 (1 is default value).</remarks>
249  /// </summary>
250  ASPOSE_TASKS_SHARED_API void set_Row(int32_t value);
251  /// <summary>
252  /// Gets task categories for which the style is applied. Is applicable for parent (or common) styles of bars in Gantt chart
253  /// (see <see cref="GanttChartView::BarStyles"></see>).
254  /// </summary>
255  ASPOSE_TASKS_SHARED_API const System::SharedPtr<System::Collections::Generic::IList<GanttBarShowFor>>& get_ShowForCategories() const;
256  /// <summary>
257  /// Sets task categories for which the style is applied. Is applicable for parent (or common) styles of bars in Gantt chart
258  /// (see <see cref="GanttChartView::BarStyles"></see>).
259  /// </summary>
260  ASPOSE_TASKS_SHARED_API void set_ShowForCategories(const System::SharedPtr<System::Collections::Generic::IList<GanttBarShowFor>>& value);
261  /// <summary>
262  /// Gets Unique Id of a task for which the style is applied. Is applicable for task-specific styles of bars in Gantt chart (see <see cref="GanttChartView::CustomBarStyles"></see>).
263  /// </summary>
264  ASPOSE_TASKS_SHARED_API System::Nullable<int32_t> get_ShowForTaskUid() const;
265  /// <summary>
266  /// Sets Unique Id of a task for which the style is applied. Is applicable for task-specific styles of bars in Gantt chart (see <see cref="GanttChartView::CustomBarStyles"></see>).
267  /// </summary>
268  ASPOSE_TASKS_SHARED_API void set_ShowForTaskUid(System::Nullable<int32_t> value);
269  /// <summary>
270  /// Gets a start shape of the bar.
271  /// </summary>
272  ASPOSE_TASKS_SHARED_API GanttBarEndShape get_StartShape() const;
273  /// <summary>
274  /// Sets a start shape of the bar.
275  /// </summary>
276  ASPOSE_TASKS_SHARED_API void set_StartShape(GanttBarEndShape value);
277  /// <summary>
278  /// Gets a color of the start shape.
279  /// </summary>
280  ASPOSE_TASKS_SHARED_API System::Drawing::Color get_StartShapeColor() const;
281  /// <summary>
282  /// Sets a color of the start shape.
283  /// </summary>
284  ASPOSE_TASKS_SHARED_API void set_StartShapeColor(System::Drawing::Color value);
285  /// <summary>
286  /// Gets a type of the start shape.
287  /// </summary>
288  ASPOSE_TASKS_SHARED_API GanttBarType get_StartShapeType() const;
289  /// <summary>
290  /// Sets a type of the start shape.
291  /// </summary>
292  ASPOSE_TASKS_SHARED_API void set_StartShapeType(GanttBarType value);
293  /// <summary>
294  /// Gets a finish point position of the gantt bar.
295  /// </summary>
296  ASPOSE_TASKS_SHARED_API Field get_To() const;
297  /// <summary>
298  /// Sets a finish point position of the gantt bar.
299  /// </summary>
300  ASPOSE_TASKS_SHARED_API void set_To(Field value);
301  /// <summary>
302  /// Gets data to be displayed on the top of the bar.
303  /// </summary>
304  ASPOSE_TASKS_SHARED_API Field get_TopField() const;
305  /// <summary>
306  /// Sets data to be displayed on the top of the bar.
307  /// </summary>
308  ASPOSE_TASKS_SHARED_API void set_TopField(Field value);
309  /// <summary>
310  /// Gets parent (or common) style for custom task-specific style.
311  /// </summary>
312  /// <remarks>
313  /// Task can have multiple custom styles with different parent styles. For example consider task having custom style with "Critical" parent style and another style with "Normal" parent style.
314  /// Simply put, if task is critical, the first style is applied. If task becomes non-critical, the second style is applied (this logic is inherited from Microsoft Project Professional).
315  /// </remarks>
316  ASPOSE_TASKS_SHARED_API System::SharedPtr<GanttBarStyle> get_ParentStyle() const;
317  /// <summary>
318  /// Sets parent (or common) style for custom task-specific style.
319  /// </summary>
320  /// <remarks>
321  /// Task can have multiple custom styles with different parent styles. For example consider task having custom style with "Critical" parent style and another style with "Normal" parent style.
322  /// Simply put, if task is critical, the first style is applied. If task becomes non-critical, the second style is applied (this logic is inherited from Microsoft Project Professional).
323  /// </remarks>
324  ASPOSE_TASKS_SHARED_API void set_ParentStyle(const System::SharedPtr<GanttBarStyle>& value);
325 
326  /// <summary>
327  /// Initializes a new instance of the <see cref="GanttBarStyle"></see> class.
328  /// </summary>
329  // ReSharper disable once EmptyConstructor
330  ASPOSE_TASKS_SHARED_API GanttBarStyle();
331 
332 protected:
333 
334  ASPOSE_TASKS_SHARED_API System::Nullable<int16_t> get_Id() const;
335  ASPOSE_TASKS_SHARED_API void set_Id(System::Nullable<int16_t> value);
336 
337  /// <summary>
338  /// Initializes a new instance of the <see cref="GanttBarStyle"></see> class.
339  /// </summary>
340  /// <param name="that">The style to copy.</param>
341  ASPOSE_TASKS_SHARED_API GanttBarStyle(const System::SharedPtr<GanttBarStyle>& that);
342 
343  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(GanttBarStyle, CODEPORTING_ARGS(const System::SharedPtr<GanttBarStyle>& that));
344  ASPOSE_TASKS_SHARED_API bool IsShownFor(const System::String& taskType);
345  ASPOSE_TASKS_SHARED_API System::SharedPtr<BarStyle> ToBarStyle();
346  #ifdef ASPOSE_GET_SHARED_MEMBERS
347  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
348  #endif
349 
350 
351 private:
352 
353  static System::SharedPtr<System::Collections::Generic::Dictionary<GanttBarEndShape, Shape>>& EndShapesTableInternal();
354  static System::SharedPtr<System::Collections::Generic::Dictionary<GanttBarMiddleShape, BarShape>>& MiddleShapesTableInternal();
355 
356  int32_t row;
357  System::SharedPtr<GanttBarStyle> parentStyle;
358  Field pr_BottomField;
359  GanttBarEndShape pr_EndShape;
360  System::Drawing::Color pr_EndShapeColor;
361  GanttBarType pr_EndShapeType;
362  Field pr_From;
363  Field pr_InsideField;
364  Field pr_LeftField;
365  GanttBarFillPattern pr_MiddleFillPattern;
366  GanttBarMiddleShape pr_MiddleShape;
367  System::Drawing::Color pr_MiddleShapeColor;
368  System::String pr_Name;
369  Field pr_RightField;
370  TaskBarTextConverter pr_LeftBarTextConverter;
371  TaskBarTextConverter pr_TopBarTextConverter;
372  TaskBarTextConverter pr_RightBarTextConverter;
373  TaskBarTextConverter pr_BottomBarTextConverter;
374  TaskBarTextConverter pr_InsideBarTextConverter;
375  System::SharedPtr<System::Collections::Generic::IList<GanttBarShowFor>> pr_ShowForCategories;
376  System::Nullable<int32_t> pr_ShowForTaskUid;
377  GanttBarEndShape pr_StartShape;
378  System::Drawing::Color pr_StartShapeColor;
379  GanttBarType pr_StartShapeType;
380  Field pr_To;
381  Field pr_TopField;
382  System::Nullable<int16_t> pr_Id;
383 
384  System::String get_DebuggerDisplay();
385  bool get_IsParentStyle();
386 
387  static System::SharedPtr<System::Collections::Generic::Dictionary<GanttBarEndShape, Shape>> InitEndShapesTable();
388  static System::SharedPtr<System::Collections::Generic::Dictionary<GanttBarMiddleShape, BarShape>> InitMiddleShapesTable();
389 
390 };
391 
392 } // namespace Visualization
393 } // namespace Tasks
394 } // namespace Aspose
395 
396 
Represents a bar style used by MSP in Gantt Chart view.
Definition: GanttBarStyle.h:68
void set_ShowForCategories(const System::SharedPtr< System::Collections::Generic::IList< GanttBarShowFor >> &value)
Sets task categories for which the style is applied. Is applicable for parent (or common) styles of b...
void set_InsideBarTextConverter(TaskBarTextConverter value)
Sets user-defined converter to get text to render inside of the task's bar. Overrides the value of In...
void set_Row(int32_t value)
Sets a row number.
void set_ParentStyle(const System::SharedPtr< GanttBarStyle > &value)
Sets parent (or common) style for custom task-specific style.
GanttBarEndShape get_EndShape() const
Gets an end shape of the bar.
TaskBarTextConverter get_TopBarTextConverter() const
Gets user-defined converter to get text to render on the top of the task's bar. Overrides the value o...
Field get_InsideField() const
Gets data to be displayed inside of the bar. Field.
Field get_LeftField() const
Gets data to be displayed on the left of the bar. Field.
System::Drawing::Color get_MiddleShapeColor() const
Gets a color of the middle shape.
GanttBarStyle()
Initializes a new instance of the GanttBarStyle class.
void set_LeftField(Field value)
Sets data to be displayed on the left of the bar. Field.
System::String get_Name() const
Gets a name of the style.
GanttBarFillPattern get_MiddleFillPattern() const
Gets a fill pattern of the gantt bar.
const System::SharedPtr< System::Collections::Generic::IList< GanttBarShowFor > > & get_ShowForCategories() const
Gets task categories for which the style is applied. Is applicable for parent (or common) styles of b...
void set_StartShape(GanttBarEndShape value)
Sets a start shape of the bar.
System::SharedPtr< GanttBarStyle > get_ParentStyle() const
Gets parent (or common) style for custom task-specific style.
System::Nullable< int32_t > get_ShowForTaskUid() const
Gets Unique Id of a task for which the style is applied. Is applicable for task-specific styles of ba...
System::Drawing::Color get_EndShapeColor() const
Gets a color of the end shape.
TaskBarTextConverter get_BottomBarTextConverter() const
Gets user-defined converter to get text to render on the bottom of the task's bar....
TaskBarTextConverter get_RightBarTextConverter() const
Gets user-defined converter to get text to render on the right of the task's bar. Overrides the value...
GanttBarMiddleShape get_MiddleShape() const
Gets a middle shape of the bar.
Field get_To() const
Gets a finish point position of the gantt bar.
void set_ShowForTaskUid(System::Nullable< int32_t > value)
Sets Unique Id of a task for which the style is applied. Is applicable for task-specific styles of ba...
GanttBarEndShape get_StartShape() const
Gets a start shape of the bar.
void set_EndShapeColor(System::Drawing::Color value)
Sets a color of the end shape.
int32_t get_Row() const
Gets a row number.
void set_To(Field value)
Sets a finish point position of the gantt bar.
GanttBarType get_EndShapeType() const
Gets a type of the end shape. GanttBarType.
void set_MiddleFillPattern(GanttBarFillPattern value)
Sets a fill pattern of the gantt bar.
void set_TopBarTextConverter(TaskBarTextConverter value)
Sets user-defined converter to get text to render on the top of the task's bar. Overrides the value o...
Field get_RightField() const
Gets data to be displayed on the right of the bar. Field.
Field get_TopField() const
Gets data to be displayed on the top of the bar.
void set_Name(const System::String &value)
Sets a name of the style.
void set_EndShape(GanttBarEndShape value)
Sets an end shape of the bar.
void set_From(Field value)
Sets a start point position of the gantt bar. Field.
System::Drawing::Color get_StartShapeColor() const
Gets a color of the start shape.
void set_TopField(Field value)
Sets data to be displayed on the top of the bar.
Field get_BottomField() const
Gets data to be displayed on the bottom of the bar. Field.
Field get_From() const
Gets a start point position of the gantt bar. Field.
void set_EndShapeType(GanttBarType value)
Sets a type of the end shape. GanttBarType.
TaskBarTextConverter get_InsideBarTextConverter() const
Gets user-defined converter to get text to render inside of the task's bar. Overrides the value of In...
void set_StartShapeType(GanttBarType value)
Sets a type of the start shape.
void set_BottomField(Field value)
Sets data to be displayed on the bottom of the bar. Field.
void set_InsideField(Field value)
Sets data to be displayed inside of the bar. Field.
void set_MiddleShape(GanttBarMiddleShape value)
Sets a middle shape of the bar.
GanttBarType get_StartShapeType() const
Gets a type of the start shape.
void set_StartShapeColor(System::Drawing::Color value)
Sets a color of the start shape.
void set_LeftBarTextConverter(TaskBarTextConverter value)
Sets user-defined converter to get text to render on the left of the task's bar. Overrides the value ...
void set_BottomBarTextConverter(TaskBarTextConverter value)
Sets user-defined converter to get text to render on the bottom of the task's bar....
void set_MiddleShapeColor(System::Drawing::Color value)
Sets a color of the middle shape.
void set_RightBarTextConverter(TaskBarTextConverter value)
Sets user-defined converter to get text to render on the right of the task's bar. Overrides the value...
TaskBarTextConverter get_LeftBarTextConverter() const
Gets user-defined converter to get text to render on the left of the task's bar. Overrides the value ...
void set_RightField(Field value)
Sets data to be displayed on the right of the bar. Field.
Definition: Asn.h:13