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