xtd - Reference Guide 0.2.0
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 "string_alignment.h"
10 #include "string_format_flags.h"
11 #include "string_trimming.h"
12 #include "text/hotkey_prefix.h"
13 
15 namespace xtd {
17  namespace drawing {
30  class drawing_export_ string_format final : public xtd::object {
31  public:
33 
41  string_format() = default;
44  string_format(const xtd::drawing::string_format& format) = default;
47  explicit string_format(xtd::drawing::string_format_flags options) : format_flags_(options) {}
49 
51 
56  xtd::drawing::string_alignment alignment() const {return alignment_;}
61  alignment_ = alignment;
62  return *this;
63  }
64 
67  xtd::drawing::string_format_flags format_flags() const {return format_flags_;}
71  format_flags_ = format_flag;
72  return *this;
73  }
74 
88  return format;
89  }
90 
102 
106  xtd::drawing::text::hotkey_prefix hotkey_prefix() const {return hotkey_prefix_;}
111  hotkey_prefix_ = hotkey_prefix;
112  return *this;
113  }
114 
118  xtd::drawing::string_alignment line_alignment() const {return line_alignment_;}
123  line_alignment_ = line_alignment;
124  return *this;
125  }
126 
129  xtd::drawing::string_trimming trimming() const {return trimming_;}
133  trimming_ = trimming;
134  return *this;
135  }
137 
138  private:
144  };
145  }
146 }
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:56
static xtd::drawing::string_format generic_typographic()
Gets a generic typographic string_format object.
Definition: string_format.h:101
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 & line_alignment(xtd::drawing::string_alignment line_alignment)
Sets vertical alignment of the string.
Definition: string_format.h:122
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
xtd::drawing::text::hotkey_prefix hotkey_prefix() const
Gets the HotkeyPrefix object for this string_format object.
Definition: string_format.h:106
xtd::drawing::string_format & hotkey_prefix(xtd::drawing::text::hotkey_prefix hotkey_prefix)
Sets the HotkeyPrefix object for this string_format object.
Definition: string_format.h:110
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::text::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:70
xtd::drawing::string_format & alignment(xtd::drawing::string_alignment alignment)
Sets horizontal alignment of the string.
Definition: string_format.h:60
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:118
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:85
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:30
hotkey_prefix
Specifies the type of display for hot-key prefixes that relate to text.
Definition: hotkey_prefix.h:20
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:47
xtd::drawing::string_format & trimming(xtd::drawing::string_trimming trimming)
Sets the string_trimming enumeration for this string_format object.
Definition: string_format.h:132
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:67
Specifies that the text is trimmed to the nearest character.
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition: string_format.h:30
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:129