xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
text_format_flags.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/ustring.h>
6 
8 namespace xtd {
10  namespace forms {
18  enum class text_format_flags {
20  default_format = 0b0,
24  left = 0b0,
26  top = 0b0,
28  horizontal_center = 0b1,
30  right = 0b10,
32  vertical_center = 0b100,
34  bottom = 0b1000,
36  word_break = 0b10000,
38  single_line = 0b100000,
40  expand_tabs = 0b1000000,
42  no_clipping = 0b100000000,
44  external_leading = 0b1000000000,
46  no_prefix = 0b10000000000,
48  internal = 0b1000000000000,
50  text_box_control = 0b10000000000000,
52  path_ellipsis = 0b100000000000000,
54  end_ellipse = 0b1000000000000000,
56  modify_string = 0b10000000000000000,
58  right_to_left = 0b100000000000000000,
60  word_ellipsis = 0b1000000000000000000,
62  no_full_width_characterB_break = 0b10000000000000000000,
64  hide_prefix = 0b100000000000000000000,
66  prefix_only = 0b1000000000000000000000,
68  preserve_graphics_clipping = 0b1000000000000000000000000,
70  preserve_graphics_translate_transform = 0b10000000000000000000000000,
72  no_padding = 0b10000000000000000000000000000,
74  left_and_right_padding = 0b100000000000000000000000000000,
75  };
76 
78  inline text_format_flags& operator +=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) + static_cast<long long>(rhs)); return lhs;}
79  inline text_format_flags& operator -=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) - static_cast<long long>(rhs)); return lhs;}
80  inline text_format_flags& operator &=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) & static_cast<long long>(rhs)); return lhs;}
81  inline text_format_flags& operator |=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) | static_cast<long long>(rhs)); return lhs;}
82  inline text_format_flags& operator ^=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs)); return lhs;}
83  inline text_format_flags operator +(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) + static_cast<long long>(rhs));}
84  inline text_format_flags operator -(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) - static_cast<long long>(rhs));}
85  inline text_format_flags operator ~(text_format_flags rhs) {return static_cast<text_format_flags>(~static_cast<long long>(rhs));}
86  inline text_format_flags operator &(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) & static_cast<long long>(rhs));}
87  inline text_format_flags operator |(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) | static_cast<long long>(rhs));}
88  inline text_format_flags operator ^(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs));}
89  inline std::ostream& operator<<(std::ostream& os, text_format_flags value) {return os << to_string(value, {{text_format_flags::default_format, "default_format"}});}
90  inline std::wostream& operator<<(std::wostream& os, text_format_flags value) {return os << to_string(value, {{text_format_flags::default_format, L"default_format"}});}
92  }
93 }
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
text_format_flags
Specifies the display and layout information for text strings.
Definition: text_format_flags.h:18
@ modify_string
Has no effect on the drawn text or text measurements. When used to draw text by TextRenderer,...
@ vertical_center
Centers the text vertically, within the bounding rectangle.
@ expand_tabs
Expands tab characters. The default number of characters per tab is eight. The word_ellipsis,...
@ default_format
Applies the default formatting, which is left-aligned.
@ preserve_graphics_translate_transform
Preserves the transformation specified by a graphics. Applies only to methods receiving an ideviceCon...
@ bottom
Aligns the text on the bottom of the bounding rectangle. Applied only when the text is a single line....
@ no_prefix
Turns off processing of prefix characters. Typically, the ampersand (&) mnemonic-prefix character is ...
@ right_to_left
Displays the text from right to left.
@ right
Aligns the text on the right side of the clipping area.
@ left
Aligns the text on the left side of the clipping area. This is the default.
@ word_break
Breaks the text at the end of a word.
@ external_leading
Includes the font external leading in line height. Typically, external leading is not included in the...
@ preserve_graphics_clipping
Preserves the clipping specified by a graphics object. Applies only to methods receiving an idevice_c...
@ word_ellipsis
Trims the line to the nearest word and an ellipsis is placed at the end of a trimmed line....
@ glyph_overhang_padding
Adds padding to the bounding rectangle to accommodate overhanging glyphs. This is the default.
@ top
Aligns the text on the top of the bounding rectangle. This is the default.
@ end_ellipse
Removes the end of trimmed lines, and replaces them with an ellipsis. When used to draw text by text_...
@ hide_prefix
Ignores the ampersand (&) prefix character in the text, so that the letter that follows won't be unde...
@ path_ellipsis
Removes the center of trimmed lines and replaces it with an ellipsis. When used to draw text by text_...
@ text_box_control
Specifies the text should be formatted for display on a TextBox control.
@ left_and_right_padding
Adds padding to both sides of the bounding rectangle.
@ single_line
Displays the text in a single line.
@ no_clipping
Allows the overhanging parts of glyphs and unwrapped text reaching outside the formatting rectangle t...
@ no_padding
Does not add padding to the bounding rectangle.
@ horizontal_center
Centers the text horizontally within the bounding rectangle.
@ no_full_width_characterB_break
A legacy value that has no effect. It prevents a line break at a double-wide character string,...
@ prefix_only
Draws only an underline at the position of the character following the ampersand (&) prefix character...
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::ustring class.