xtd 1.0.0
Loading...
Searching...
No Matches
xtd::drawing::string_format Class Referencefinal
Inheritance diagram for xtd::drawing::string_format:
xtd::object

Definition

Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.

string_format()=default
Initializes a new string_format object.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Inheritance
xtd::object → xtd::drawing::string_dormat
Namespace
xtd::drawing
Library
xtd.drawing
Remarks
Many common formats are provided through the string_format_flags enumeration. string_format objects can be changed.
Examples
hello_world_png.cpp.

Public Constructors

 string_format ()=default
 Initializes a new string_format object.
 string_format (xtd::drawing::string_format_flags options)
 Initializes a new string_format object with the specified string_format_flags enumeration.

Public Properties

auto alignment () const noexcept -> xtd::drawing::string_alignment
 Gets horizontal alignment of the string.
auto alignment (xtd::drawing::string_alignment alignment) noexcept -> string_format &
 Sets horizontal alignment of the string.
auto format_flags () const noexcept -> xtd::drawing::string_format_flags
 Gets a string_formatFlags enumeration that contains formatting information.
auto format_flags (xtd::drawing::string_format_flags format_flag) noexcept -> string_format &
 Sets a string_formatFlags enumeration that contains formatting information.
auto hotkey_prefix () const noexcept -> xtd::drawing::text::hotkey_prefix
 Gets the HotkeyPrefix object for this string_format object.
auto hotkey_prefix (xtd::drawing::text::hotkey_prefix hotkey_prefix) noexcept -> string_format &
 Sets the HotkeyPrefix object for this string_format object.
auto line_alignment () const noexcept -> xtd::drawing::string_alignment
 Gets vertical alignment of the string.
auto line_alignment (xtd::drawing::string_alignment line_alignment) noexcept -> string_format &
 Sets vertical alignment of the string.
auto trimming () const noexcept -> xtd::drawing::string_trimming
 Gets the string_trimming enumeration for this string_format object.
auto trimming (xtd::drawing::string_trimming trimming) noexcept -> string_format &
 Sets the string_trimming enumeration for this string_format object.

Public Static Properties

static auto generic_default () noexcept -> string_format
 Gets a generic default string_format object.
static auto generic_typographic () noexcept -> string_format
 Gets a generic typographic string_format object.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.

Constructor & Destructor Documentation

◆ string_format() [1/2]

xtd::drawing::string_format::string_format ( )
default

Initializes a new string_format object.

Remarks
The following table shows initial property values for an instance of string_format class.
property initial value
format_flag 0
hotkey_prefix none

◆ string_format() [2/2]

xtd::drawing::string_format::string_format ( xtd::drawing::string_format_flags options)
explicit

Initializes a new string_format object with the specified string_format_flags enumeration.

Parameters
optionsThe StringFormatFlags enumeration for the new StringFormat object.

Member Function Documentation

◆ alignment() [1/2]

auto xtd::drawing::string_format::alignment ( ) const -> xtd::drawing::string_alignment
nodiscardnoexcept

Gets horizontal alignment of the string.

Returns
A string_alignment enumeration that specifies the horizontal alignment of the string.
Remarks
Use line_alignment to specify the vertical alignment of the string.
Examples
hello_world_png.cpp.

◆ alignment() [2/2]

auto xtd::drawing::string_format::alignment ( xtd::drawing::string_alignment alignment) -> string_format &
noexcept

Sets horizontal alignment of the string.

Parameters
alignmentA string_alignment enumeration that specifies the horizontal alignment of the string.
Remarks
Use line_alignment to specify the vertical alignment of the string.

◆ format_flags() [1/2]

auto xtd::drawing::string_format::format_flags ( ) const -> xtd::drawing::string_format_flags
nodiscardnoexcept

Gets a string_formatFlags enumeration that contains formatting information.

Returns
A string_formatFlags enumeration that contains formatting information.

◆ format_flags() [2/2]

auto xtd::drawing::string_format::format_flags ( xtd::drawing::string_format_flags format_flag) -> string_format &
noexcept

Sets a string_formatFlags enumeration that contains formatting information.

Parameters
format_flagA string_formatFlags enumeration that contains formatting information.

◆ hotkey_prefix() [1/2]

auto xtd::drawing::string_format::hotkey_prefix ( ) const -> xtd::drawing::text::hotkey_prefix
nodiscardnoexcept

Gets the HotkeyPrefix object for this string_format object.

Returns
The hotkey_prefix object for this string_format object, the default is hotkey_prefix::none.
Remarks
In a graphical user interface, a hot key is the underlined letter in a word (usually combined with another key, such as the Alt key) that you can press on the keyboard to activate the functionality that the word represents.

◆ hotkey_prefix() [2/2]

auto xtd::drawing::string_format::hotkey_prefix ( xtd::drawing::text::hotkey_prefix hotkey_prefix) -> string_format &
noexcept

Sets the HotkeyPrefix object for this string_format object.

Parameters
hotkey_prefixThe hotkey_prefix object for this string_format object, the default is hotkey_prefix::none.
Remarks
In a graphical user interface, a hot key is the underlined letter in a word (usually combined with another key, such as the Alt key) that you can press on the keyboard to activate the functionality that the word represents.

◆ line_alignment() [1/2]

auto xtd::drawing::string_format::line_alignment ( ) const -> xtd::drawing::string_alignment
nodiscardnoexcept

Gets vertical alignment of the string.

Returns
A string_alignment enumeration that specifies the vertical alignment of the string.
Remarks
Use alignment to specify the horizontal alignment of the string.

◆ line_alignment() [2/2]

auto xtd::drawing::string_format::line_alignment ( xtd::drawing::string_alignment line_alignment) -> string_format &
noexcept

Sets vertical alignment of the string.

Parameters
alignmentA string_alignment enumeration that specifies the vertical alignment of the string.
Remarks
Use alignment to specify the horizontal alignment of the string.

◆ trimming() [1/2]

auto xtd::drawing::string_format::trimming ( ) const -> xtd::drawing::string_trimming
nodiscardnoexcept

Gets the string_trimming enumeration for this string_format object.

Returns
A string_trimming enumeration that indicates how text drawn with this string_format object is trimmed when it exceeds the edges of the layout rectangle.

◆ trimming() [2/2]

auto xtd::drawing::string_format::trimming ( xtd::drawing::string_trimming trimming) -> string_format &
noexcept

Sets the string_trimming enumeration for this string_format object.

Parameters
trimmingA string_trimming enumeration that indicates how text drawn with this string_format object is trimmed when it exceeds the edges of the layout rectangle.

◆ generic_default()

auto xtd::drawing::string_format::generic_default ( ) -> string_format
staticnodiscardnoexcept

Gets a generic default string_format object.

Returns
The generic default string_format object.
Remarks
The following table shows initial property values for a generic default instance of the string_format class.
property initial value
format_flag 0
alignment near
line_alignment near
hotkey_prefix none
trimming character

◆ generic_typographic()

auto xtd::drawing::string_format::generic_typographic ( ) -> string_format
staticnodiscardnoexcept

Gets a generic typographic string_format object.

Returns
A generic typographic string_format object.
Remarks
The following table shows initial property values for a generic default instance of the string_format class.
property initial value
format_flag 0b110000000000100 (no_clip|fit_black_box|line_limit)
alignment near
line_alignment near
hotkey_prefix none
trimming none

The documentation for this class was generated from the following file: