Aspose.Tasks for C++
TextStyle.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="TextStyle.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2025 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/object.h>
9 #include <drawing/color.h>
10 
11 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
12 
13 namespace Aspose
14 {
15 namespace Foundation
16 {
17 namespace Drawing
18 {
19 class DrColor;
20 class DrFont;
21 } // namespace Drawing
22 } // namespace Foundation
23 namespace Tasks
24 {
25 enum class BackgroundPattern;
26 namespace RiskAnalysis
27 {
28 namespace Reporting
29 {
30 class RiskReportBuilder;
31 } // namespace Reporting
32 } // namespace RiskAnalysis
33 namespace Visualization
34 {
35 template <typename> class ApsBaseChartBuilder;
36 class ApsGlyphFactory;
37 class ApsNote;
38 class ApsReportBestPracticesAnalyzerBuilder;
39 class ApsReportBuilder;
40 class ApsReportCashFlowBuilder;
41 class ApsReportMilestonesBuilder;
42 class ApsResourceSheetBuilder;
43 class ApsResourceUsageBuilder;
44 class ApsTableBuilder;
45 class ApsTextStyleManager;
46 class ApsTimescaleTierBuilder;
47 class ApsTimescaleTiersCommonSettings;
48 template <typename, typename> class ApsUsageBuilder;
49 class BarStyle;
50 namespace Charting
51 {
52 class ChartStyle;
53 } // namespace Charting
54 class FontDescriptor;
55 class FontManager;
56 enum class FontStyles;
57 class PageHeaderFooterBase;
58 class RowLayoutCalculator;
59 class RtfFlowLayoutBuilder;
60 class TableStyle;
61 enum class TextItemType;
62 } // namespace Visualization
63 } // namespace Tasks
64 } // namespace Aspose
65 namespace System
66 {
67 namespace Collections
68 {
69 namespace Generic
70 {
71 template <typename> class List;
72 } // namespace Generic
73 } // namespace Collections
74 } // namespace System
75 
76 namespace Aspose {
77 
78 namespace Tasks {
79 
80 namespace Visualization {
81 
82 /// <summary>
83 /// Change the visual style of the text for an item in the project view.
84 /// </summary>
85 class ASPOSE_TASKS_SHARED_CLASS TextStyle : public System::Object
86 {
87  typedef TextStyle ThisType;
88  typedef System::Object BaseType;
89 
90  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
91  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
92 
93  template<typename FT0, typename FT1> friend class ApsUsageBuilder;
94  friend class FontManager;
95  friend class RowLayoutCalculator;
96  friend class ApsTimescaleTiersCommonSettings;
97  friend class PageHeaderFooterBase;
98  friend class ApsGlyphFactory;
99  friend class ApsTimescaleTierBuilder;
100  friend class Aspose::Tasks::RiskAnalysis::Reporting::RiskReportBuilder;
101  friend class ApsReportCashFlowBuilder;
102  friend class ApsResourceSheetBuilder;
103  friend class TableStyle;
104  friend class ApsReportBestPracticesAnalyzerBuilder;
105  friend class ApsResourceUsageBuilder;
106  friend class BarStyle;
107  friend class ApsReportMilestonesBuilder;
108  template<typename FT0> friend class ApsBaseChartBuilder;
109  friend class ApsTableBuilder;
110  friend class ApsTextStyleManager;
111  friend class Aspose::Tasks::Visualization::Charting::ChartStyle;
112  friend class ApsReportBuilder;
113  friend class ApsNote;
114  friend class RtfFlowLayoutBuilder;
115 
116 public:
117 
118  /// <summary>
119  /// Gets font of the text style.
120  /// </summary>
121  ASPOSE_TASKS_SHARED_API System::SharedPtr<FontDescriptor> get_Font() const;
122  /// <summary>
123  /// Sets font of the text style.
124  /// </summary>
125  ASPOSE_TASKS_SHARED_API void set_Font(const System::SharedPtr<FontDescriptor>& value);
126  /// <summary>
127  /// Gets color of the text.
128  /// </summary>
129  ASPOSE_TASKS_SHARED_API System::Drawing::Color get_Color() const;
130  /// <summary>
131  /// Sets color of the text.
132  /// </summary>
133  ASPOSE_TASKS_SHARED_API void set_Color(System::Drawing::Color value);
134  /// <summary>
135  /// Gets <see cref="TextItemType"></see> of the text style.
136  /// </summary>
137  ASPOSE_TASKS_SHARED_API virtual TextItemType get_ItemType();
138  /// <summary>
139  /// Sets <see cref="TextItemType"></see> of the text style.
140  /// </summary>
141  ASPOSE_TASKS_SHARED_API virtual void set_ItemType(TextItemType value);
142  /// <summary>
143  /// Gets background pattern of the text style.
144  /// <see cref="BackgroundPattern"></see>.
145  /// </summary>
146  ASPOSE_TASKS_SHARED_API Aspose::Tasks::BackgroundPattern get_BackgroundPattern() const;
147  /// <summary>
148  /// Sets background pattern of the text style.
149  /// <see cref="BackgroundPattern"></see>.
150  /// </summary>
151  ASPOSE_TASKS_SHARED_API void set_BackgroundPattern(Aspose::Tasks::BackgroundPattern value);
152  /// <summary>
153  /// Gets background color of the text style.
154  /// <see cref="Color"></see>.
155  /// </summary>
156  ASPOSE_TASKS_SHARED_API System::Drawing::Color get_BackgroundColor() const;
157  /// <summary>
158  /// Sets background color of the text style.
159  /// <see cref="Color"></see>.
160  /// </summary>
161  ASPOSE_TASKS_SHARED_API void set_BackgroundColor(System::Drawing::Color value);
162 
163  /// <summary>
164  /// Initializes a new instance of the <see cref="TextStyle"></see> class with default settings.
165  /// </summary>
166  ASPOSE_TASKS_SHARED_API TextStyle();
167  /// <summary>
168  /// Initializes a new instance of the <see cref="TextStyle"></see> class with the default font and specified font size and style.
169  /// </summary>
170  /// <param name="fontSize">Size of font of TextStyle.</param>
171  /// <param name="fontStyle">Style of font of TextStyle.</param>
172  ASPOSE_TASKS_SHARED_API TextStyle(float fontSize, FontStyles fontStyle);
173  /// <summary>
174  /// Initializes a new instance of the <see cref="TextStyle"></see> class with the default font and specified font style.
175  /// </summary>
176  /// <param name="fontStyle">Style of font to apply to default font.</param>
177  ASPOSE_TASKS_SHARED_API TextStyle(FontStyles fontStyle);
178  /// <summary>
179  /// Initializes a new instance of the <see cref="TextStyle"></see> class with the specified font settings.
180  /// </summary>
181  /// <param name="font">Font of the TextStyle.</param>
182  ASPOSE_TASKS_SHARED_API TextStyle(const System::SharedPtr<FontDescriptor>& font);
183 
184 protected:
185 
186  ASPOSE_TASKS_SHARED_API const System::SharedPtr<Foundation::Drawing::DrFont>& get_CachedDrFont() const;
187  ASPOSE_TASKS_SHARED_API void set_CachedDrFont(const System::SharedPtr<Foundation::Drawing::DrFont>& value);
188  ASPOSE_TASKS_SHARED_API bool get_IsColorEmpty();
189  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Foundation::Drawing::DrColor> get_DrColor();
190  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Foundation::Drawing::DrColor> get_DrBackgroundColor();
191  ASPOSE_TASKS_SHARED_API static float get_DefaultSizeInPoints();
192 
193  ASPOSE_TASKS_SHARED_API static System::SharedPtr<FontDescriptor> GetDefaultFontDescriptor(float size, FontStyles style);
194  ASPOSE_TASKS_SHARED_API static System::SharedPtr<TextStyle> GetTextStyle(const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<TextStyle>>>& textStyles, TextItemType type);
195  ASPOSE_TASKS_SHARED_API static System::SharedPtr<TextStyle> GetTextStyle(const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<TextStyle>>>& textStyles, const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<TextStyle>>>& secondPriorityStyles, TextItemType type);
196  ASPOSE_TASKS_SHARED_API static System::SharedPtr<TextStyle> GetDefaultTextStyle();
197  ASPOSE_TASKS_SHARED_API static System::SharedPtr<TextStyle> GetDefaultTextStyleBold();
198  ASPOSE_TASKS_SHARED_API static System::SharedPtr<TextStyle> GetDefaultOverallocatedRscStyle(const System::SharedPtr<FontDescriptor>& defaultFont);
199  ASPOSE_TASKS_SHARED_API static bool IsDefaultFont(const System::SharedPtr<FontDescriptor>& font);
200  ASPOSE_TASKS_SHARED_API static bool IsDefaultStyle(const System::SharedPtr<TextStyle>& textStyle);
201  ASPOSE_TASKS_SHARED_API System::SharedPtr<TextStyle> Clone();
202  ASPOSE_TASKS_SHARED_API System::SharedPtr<TextStyle> Clone(FontStyles fontStyle);
203  ASPOSE_TASKS_SHARED_API System::SharedPtr<TextStyle> Clone(float fontSize, FontStyles fontStyle);
204  ASPOSE_TASKS_SHARED_API System::SharedPtr<TextStyle> Clone(const System::SharedPtr<FontDescriptor>& fontDescriptor);
205  #ifdef ASPOSE_GET_SHARED_MEMBERS
206  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
207  #endif
208 
209 
210 private:
211 
212  static const float DefaultSizeInPointsConst;
213  static System::SharedPtr<Aspose::Tasks::Visualization::FontDescriptor>& defaultFont();
214  static System::SharedPtr<Aspose::Tasks::Visualization::FontDescriptor>& defaultFontBold();
215  System::SharedPtr<FontDescriptor> font;
216 
217  static System::SharedPtr<FontDescriptor> get_DefaultFont();
218  static System::SharedPtr<FontDescriptor> get_DefaultFontBold();
219 
220  System::Drawing::Color pr_Color;
221  TextItemType pr_ItemType;
222  Aspose::Tasks::BackgroundPattern pr_BackgroundPattern;
223  System::Drawing::Color pr_BackgroundColor;
224  System::SharedPtr<Foundation::Drawing::DrFont> pr_CachedDrFont;
225 
226 };
227 
228 } // namespace Visualization
229 } // namespace Tasks
230 } // namespace Aspose
231 
232 
Change the visual style of the bar for the item in the project view.
Definition: BarStyle.h:67
Change the visual style of the text for an item in the project view.
Definition: TextStyle.h:86
void set_Color(System::Drawing::Color value)
Sets color of the text.
void set_BackgroundPattern(Aspose::Tasks::BackgroundPattern value)
Sets background pattern of the text style. BackgroundPattern.
System::Drawing::Color get_Color() const
Gets color of the text.
TextStyle()
Initializes a new instance of the TextStyle class with default settings.
System::Drawing::Color get_BackgroundColor() const
Gets background color of the text style. Color.
TextStyle(FontStyles fontStyle)
Initializes a new instance of the TextStyle class with the default font and specified font style.
Aspose::Tasks::BackgroundPattern get_BackgroundPattern() const
Gets background pattern of the text style. BackgroundPattern.
virtual TextItemType get_ItemType()
Gets TextItemType of the text style.
virtual void set_ItemType(TextItemType value)
Sets TextItemType of the text style.
System::SharedPtr< FontDescriptor > get_Font() const
Gets font of the text style.
void set_BackgroundColor(System::Drawing::Color value)
Sets background color of the text style. Color.
TextStyle(float fontSize, FontStyles fontStyle)
Initializes a new instance of the TextStyle class with the default font and specified font size and s...
void set_Font(const System::SharedPtr< FontDescriptor > &value)
Sets font of the text style.
TextStyle(const System::SharedPtr< FontDescriptor > &font)
Initializes a new instance of the TextStyle class with the specified font settings.
Aspose.
Definition: Asn.h:13