xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
string_format.h
Go to the documentation of this file.
1 #pragma once
5 #include <cstdint>
6 #include <ostream>
7 #include <xtd/object.h>
8 #include "../drawing_export.h"
9 #include "hotkey_prefix.h"
10 #include "string_alignment.h"
11 #include "string_format_flags.h"
12 #include "string_trimming.h"
13 
15 namespace xtd {
17  namespace drawing {
25  class drawing_export_ string_format final : public object {
26  public:
28 
36  string_format() = default;
39  string_format(const xtd::drawing::string_format& format) = default;
42  explicit string_format(xtd::drawing::string_format_flags options) : format_flags_(options) {}
44 
46 
51  xtd::drawing::string_alignment alignment() const {return alignment_;}
56  alignment_ = alignment;
57  return *this;
58  }
59 
62  xtd::drawing::string_format_flags format_flags() const {return format_flags_;}
66  format_flags_ = format_flag;
67  return *this;
68  }
69 
83  return format;
84  }
85 
97 
101  xtd::drawing::hotkey_prefix hotkey_prefix() const {return hotkey_prefix_;}
106  hotkey_prefix_ = hotkey_prefix;
107  return *this;
108  }
109 
113  xtd::drawing::string_alignment line_alignment() const {return line_alignment_;}
118  line_alignment_ = line_alignment;
119  return *this;
120  }
121 
124  xtd::drawing::string_trimming trimming() const {return trimming_;}
128  trimming_ = trimming;
129  return *this;
130  }
132 
133  private:
139  };
140  }
141 }
Specifies the text be aligned near the layout. In a left-to-right layout, the near position is left...
xtd::drawing::string_alignment alignment() const
Gets horizontal alignment of the string.
Definition: string_format.h:51
static xtd::drawing::string_format generic_typographic()
Gets a generic typographic string_format object.
Definition: string_format.h:96
string_trimming
Specifies how to trim characters from a string that does not completely fit into a layout shape...
Definition: string_trimming.h:17
Overhanging parts of glyphs, and unwrapped text reaching outside the formatting rectangle are allowed...
xtd::drawing::string_format & hotkey_prefix(xtd::drawing::hotkey_prefix hotkey_prefix)
Sets the HotkeyPrefix object for this string_format object.
Definition: string_format.h:105
xtd::drawing::string_format & line_alignment(xtd::drawing::string_alignment line_alignment)
Sets vertical alignment of the string.
Definition: string_format.h:117
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
string_alignment
Specifies the alignment of a text string relative to its layout rectangle.
Definition: string_alignment.h:23
Contains xtd::drawing::string_alignment enum class.
Contains xtd::drawing::hotkey_prefix enum class.
xtd::drawing::string_format & format_flags(xtd::drawing::string_format_flags format_flag)
Sets a string_formatFlags enumeration that contains formatting information.
Definition: string_format.h:65
xtd::drawing::string_format & alignment(xtd::drawing::string_alignment alignment)
Sets horizontal alignment of the string.
Definition: string_format.h:55
Parts of characters are allowed to overhang the string&#39;s layout rectangle. By default, characters are repositioned to avoid any overhang.
xtd::drawing::string_alignment line_alignment() const
Gets vertical alignment of the string.
Definition: string_format.h:113
string_format_flags
Specifies the display and layout information for text strings. This enumeration allows a bitwise comb...
Definition: string_format_flags.h:17
Contains xtd::drawing::string_trimming enum class.
static xtd::drawing::string_format generic_default()
Gets a generic default string_format object.
Definition: string_format.h:80
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:30
string_format(xtd::drawing::string_format_flags options)
Initializes a new string_format object with the specified string_format_flags enumeration.
Definition: string_format.h:42
xtd::drawing::string_format & trimming(xtd::drawing::string_trimming trimming)
Sets the string_trimming enumeration for this string_format object.
Definition: string_format.h:127
Only entire lines are laid out in the formatting rectangle. By default layout continues until the end...
xtd::drawing::string_format_flags format_flags() const
Gets a string_formatFlags enumeration that contains formatting information.
Definition: string_format.h:62
Specifies that the text is trimmed to the nearest character.
hotkey_prefix
Specifies the type of display for hot-key prefixes that relate to text.
Definition: hotkey_prefix.h:18
xtd::drawing::hotkey_prefix hotkey_prefix() const
Gets the HotkeyPrefix object for this string_format object.
Definition: string_format.h:101
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition: string_format.h:25
Contains xtd::drawing::string_format_flags enum class.
xtd::drawing::string_trimming trimming() const
Gets the string_trimming enumeration for this string_format object.
Definition: string_format.h:124