CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
string_format.h
1
2#ifndef _string_format_h_
3#define _string_format_h_
4
5#include "drawing/string_format_flags.h"
6#include "drawing/string_alignment.h"
7#include "drawing/string_trimming.h"
8#include "drawing/string_digit_substitute.h"
9#include "drawing/text/hotkey_prefix.h"
10#include "drawing/character_range.h"
11
12#include "system/array.h"
13#include "system/exceptions.h"
14
15
16namespace System { namespace Drawing {
17
18class Graphics;
19
24class ASPOSECPP_SHARED_CLASS StringFormat: public System::Object // ICloneable
25{
26public:
28 ASPOSECPP_SHARED_API StringFormat();
33 ASPOSECPP_SHARED_API StringFormat(StringFormatFlags options, int32_t language = 0);
34
37 ASPOSECPP_SHARED_API StringFormat(const SharedPtr<StringFormat>& format);
38
40 static ASPOSECPP_SHARED_API SharedPtr<StringFormat> get_GenericTypographic();
42 static ASPOSECPP_SHARED_API SharedPtr<StringFormat> get_GenericDefault();
43
46 ASPOSECPP_SHARED_API StringFormatFlags get_FormatFlags() const;
49 ASPOSECPP_SHARED_API void set_FormatFlags(StringFormatFlags value);
50
52 ASPOSECPP_SHARED_API StringAlignment get_Alignment() const;
55 ASPOSECPP_SHARED_API void set_Alignment(StringAlignment value);
56
58 ASPOSECPP_SHARED_API StringAlignment get_LineAlignment() const;
61 ASPOSECPP_SHARED_API void set_LineAlignment(StringAlignment value);
62
64 ASPOSECPP_SHARED_API StringTrimming get_Trimming() const;
67 ASPOSECPP_SHARED_API void set_Trimming(StringTrimming value);
68
72 ASPOSECPP_SHARED_API ArrayPtr<float> GetTabStops(float &first_tab_offset) const;
76 ASPOSECPP_SHARED_API void SetTabStops(float first_tab_offset, const ArrayPtr<float>& tab_stops);
77
79 ASPOSECPP_SHARED_API int32_t get_DigitSubstitutionLanguage() const;
82
84 ASPOSECPP_SHARED_API Text::HotkeyPrefix get_HotkeyPrefix() const;
87 ASPOSECPP_SHARED_API void set_HotkeyPrefix(Text::HotkeyPrefix value);
88
92 ASPOSECPP_SHARED_API void SetDigitSubstitution(int32_t language, StringDigitSubstitute substitute);
93
97 ASPOSECPP_SHARED_API void SetMeasurableCharacterRanges(const ArrayPtr<CharacterRange>& ranges);
98
100 ASPOSECPP_SHARED_API SharedPtr<StringFormat> Clone();
101
102 // service method used in manually implemented code parts
105 ASPOSECPP_SHARED_API int GetCharacterRangesCount() const;
106
107protected:
109
123
124private:
126 bool m_is_generic_typographic = false;
128 bool m_is_generic_default = false;
129
130 Text::HotkeyPrefix m_hotkey_prefix;
131 ArrayPtr<CharacterRange> m_character_ranges;
132};
133
134}}
135
136
137#endif
Represents a drawing surface. Objects of this class should only be allocated using System::MakeObject...
Definition: graphics.h:68
Encapsulates text layout information, display manipulations and OpenType features....
Definition: string_format.h:25
void set_LineAlignment(StringAlignment value)
Sets vertical alignment of the string.
StringDigitSubstitute get_DigitSubstitutionMethod() const
Returns digit substitution method.
SharedPtr< StringFormat > Clone()
Returns an exact copy of the current object.
void SetDigitSubstitution(int32_t language, StringDigitSubstitute substitute)
Sets digit substitution language and method.
StringFormatFlags m_string_format_flags
A bitwise combination of StringFormatFlags that specifies the string format represented by the curren...
Definition: string_format.h:112
void set_Trimming(StringTrimming value)
Sets a value that specifies how the string is trimmed.
float m_first_tab_offset
Indicates the number of spaces between the beginning of a text line and the first tab stop.
Definition: string_format.h:120
static SharedPtr< StringFormat > get_GenericTypographic()
Returns a StringFormat object that represents a generic typographic format.
int32_t get_DigitSubstitutionLanguage() const
Returns a value that indicats the language that is used when local digits are substituted with wester...
void set_FormatFlags(StringFormatFlags value)
Sets the string format flags.
StringAlignment m_line_alignment
A value that indicates vertical alignment of the string.
Definition: string_format.h:116
StringFormatFlags get_FormatFlags() const
Returns a bitwise combination of StringFormatFlags that specifies the string format represented by th...
StringAlignment m_alignment
A value that indicates horizontal alignment of the string.
Definition: string_format.h:114
void SetTabStops(float first_tab_offset, const ArrayPtr< float > &tab_stops)
Sets the tab stops for the current StringFormat object.
static SharedPtr< StringFormat > get_GenericDefault()
Returns a StringFormat object that represents a generic default format.
ArrayPtr< float > m_tab_stops
Contains the numbers of spaces between tab stops.
Definition: string_format.h:122
int GetCharacterRangesCount() const
Gets a size of the CharacterRange array.
StringAlignment get_Alignment() const
Returns a value that indicates horizontal alignment of the string.
StringAlignment get_LineAlignment() const
Returns a value that indicates vertical alignment of the string.
void set_Alignment(StringAlignment value)
Sets horizontal alignment of the string.
StringFormat()
Constructs a new instance of StringFormat class.
void SetMeasurableCharacterRanges(const ArrayPtr< CharacterRange > &ranges)
Sets an array of CharacterRange objects that represent the chracter ranges measured by a call to the ...
StringFormat(const SharedPtr< StringFormat > &format)
Copy constructor.
StringTrimming get_Trimming() const
Returns a value that indicates how the string is trimmed.
Text::HotkeyPrefix get_HotkeyPrefix() const
Returns the value that indicates how the hot key prefix is displayed.
ArrayPtr< float > GetTabStops(float &first_tab_offset) const
Returns the tab stops for the current StringFormat object.
void set_HotkeyPrefix(Text::HotkeyPrefix value)
Sets the value that specifies how the hot key prefix should be displayed.
StringFormat(StringFormatFlags options, int32_t language=0)
Constructs a new instance of StringFormat class with the specified format flags and language.
StringTrimming m_trimming
A value that indicates how the string is trimmed.
Definition: string_format.h:118
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
HotkeyPrefix
Specifies the type of display for hot-key prefixes that relate to text.
Definition: hotkey_prefix.h:7
StringFormatFlags
Specifies the display and layout information for the strings of text.
Definition: string_format_flags.h:9
StringAlignment
Specifies the string alignment relative to its layout rectangle.
Definition: string_alignment.h:11
StringTrimming
Specifies how characters should be trimmed from a string that does not fit the layout shape.
Definition: string_trimming.h:8
StringDigitSubstitute
Specifies how digits in a string are substituted according to the locale or language.
Definition: string_digit_substitute.h:7
Definition: db_command.h:9