xtd 1.0.0
Loading...
Searching...
No Matches
renderer.hpp
Go to the documentation of this file.
1
4#pragma once
8#include "../forms_export.hpp"
10#include <xtd/drawing/color>
11#include <xtd/drawing/font>
12#include <xtd/drawing/graphics>
13#include <xtd/drawing/image>
14#include <xtd/drawing/rectangle>
15#include <xtd/optional>
16#include <xtd/delegate>
17#include <xtd/iequatable>
18#include <xtd/object>
19#include <xtd/string>
20
22namespace xtd {
24 namespace forms {
35 class forms_export_ renderer : public xtd::object, public xtd::iequatable<renderer> {
36 struct data;
37
38 public:
40
42 using button_renderer = xtd::delegate<void(xtd::drawing::graphics, const xtd::drawing::rectangle&, const xtd::string&, const xtd::drawing::font&, xtd::forms::text_format_flags, const xtd::drawing::image&, const xtd::drawing::rectangle&, bool focused, xtd::forms::visual_styles::push_button_state, const std::optional<xtd::drawing::color>&, const std::optional<xtd::drawing::color>&)>;
43 using check_box_renderer = xtd::delegate<void(xtd::drawing::graphics, const xtd::drawing::rectangle&, const xtd::string&, const xtd::drawing::font&, xtd::forms::text_format_flags, const xtd::drawing::image&, const xtd::drawing::rectangle&, bool focused, xtd::forms::visual_styles::check_box_state, const std::optional<xtd::drawing::color>&, const std::optional<xtd::drawing::color>&)>;
44 using radio_button_renderer = xtd::delegate<void(xtd::drawing::graphics, const xtd::drawing::rectangle&, const xtd::string&, const xtd::drawing::font&, xtd::forms::text_format_flags, const xtd::drawing::image&, const xtd::drawing::rectangle&, bool focused, xtd::forms::visual_styles::radio_button_state, const std::optional<xtd::drawing::color>&, const std::optional<xtd::drawing::color>&)>;
46
48
50 static const renderer empty;
52
54
56 renderer();
57 explicit renderer(const xtd::string& name);
59
61 renderer(const renderer&);
62 auto operator =(const renderer&) -> renderer&;
64
66
68 [[nodiscard]] virtual auto name() const -> const xtd::string&;
69 auto name(const xtd::string& value) -> renderer&;
70
71 [[nodiscard]] auto button_render() const noexcept -> const button_renderer&;
72 auto button_render(button_renderer value) -> renderer&;
73
74 [[nodiscard]] auto check_box_render() const noexcept -> const check_box_renderer&;
75 auto check_box_render(check_box_renderer value) -> renderer&;
76
77 [[nodiscard]] auto radio_button_render() const noexcept -> const radio_button_renderer&;
78 auto radio_button_render(radio_button_renderer value) -> renderer&;
80
82
84 auto draw_button(xtd::drawing::graphics g, const xtd::drawing::rectangle& bounds, const xtd::string& text, const xtd::drawing::font& font, xtd::forms::text_format_flags flags, const xtd::drawing::image& image, const xtd::drawing::rectangle& image_bounds, bool focused, xtd::forms::visual_styles::push_button_state state, const std::optional<xtd::drawing::color>& back_color, const std::optional<xtd::drawing::color>& fore_color) -> void;
85 auto draw_check_box(xtd::drawing::graphics g, const xtd::drawing::rectangle& bounds, const xtd::string& text, const xtd::drawing::font& font, xtd::forms::text_format_flags flags, const xtd::drawing::image& image, const xtd::drawing::rectangle& image_bounds, bool focused, xtd::forms::visual_styles::check_box_state state, const std::optional<xtd::drawing::color>& back_color, const std::optional<xtd::drawing::color>& fore_color) -> void;
86 auto draw_radio_button(xtd::drawing::graphics g, const xtd::drawing::rectangle& bounds, const xtd::string& text, const xtd::drawing::font& font, xtd::forms::text_format_flags flags, const xtd::drawing::image& image, const xtd::drawing::rectangle& image_bounds, bool focused, xtd::forms::visual_styles::radio_button_state state, const std::optional<xtd::drawing::color>& back_color, const std::optional<xtd::drawing::color>& fore_color) -> void;
87
91 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
95 [[nodiscard]] auto equals(const renderer& other) const noexcept -> bool override;
96
99 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
100
103 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
105
106 private:
107 static auto default_button_renderer(xtd::drawing::graphics g, const xtd::drawing::rectangle& bounds, const xtd::string& text, const xtd::drawing::font& font, xtd::forms::text_format_flags flags, const xtd::drawing::image& image, const xtd::drawing::rectangle& image_bounds, bool focused, xtd::forms::visual_styles::push_button_state state, const std::optional<xtd::drawing::color>& back_color, const std::optional<xtd::drawing::color>& fore_color) -> void;
108 static auto default_check_box_renderer(xtd::drawing::graphics g, const xtd::drawing::rectangle& bounds, const xtd::string& text, const xtd::drawing::font& font, xtd::forms::text_format_flags flags, const xtd::drawing::image& image, const xtd::drawing::rectangle& image_bounds, bool focused, xtd::forms::visual_styles::check_box_state state, const std::optional<xtd::drawing::color>& back_color, const std::optional<xtd::drawing::color>& fore_color) -> void;
109 static auto default_radio_button_renderer(xtd::drawing::graphics g, const xtd::drawing::rectangle& bounds, const xtd::string& text, const xtd::drawing::font& font, xtd::forms::text_format_flags flags, const xtd::drawing::image& image, const xtd::drawing::rectangle& image_bounds, bool focused, xtd::forms::visual_styles::radio_button_state state, const std::optional<xtd::drawing::color>& back_color, const std::optional<xtd::drawing::color>& fore_color) -> void;
110
111 xtd::sptr<data> data_;
112 };
113 }
114}
Contains xtd::forms::visual_styles::check_box_state enum class.
Defines a particular format for text, including font face, size, and style attributes....
Definition font.hpp:45
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.hpp:67
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.hpp:49
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
auto equals(const renderer &other) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
auto to_string() const noexcept -> xtd::string override
Returns a string containing the name, alpha codes and numeric code of the country.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:26
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
@ flags
Enum flags attribute.
Definition enum_attribute.hpp:26
@ g
The G key.
Definition console_key.hpp:100
text_format_flags
Specifies the display and layout information for text strings.
Definition text_format_flags.hpp:22
push_button_state
Specifies the visual state of a button that is drawn with visual styles.
Definition push_button_state.hpp:24
radio_button_state
Specifies the visual state of a radio button that is drawn with visual styles.
Definition radio_button_state.hpp:24
check_box_state
Specifies the visual state of a check box that is drawn with visual styles.
Definition check_box_state.hpp:24
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms::visual_styles namespace contains classes for rendering controls and other windows use...
Definition check_box_state.hpp:12
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::visual_styles::push_button_state enum class.
Contains xtd::forms::visual_styles::radio_button_state enum class.
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44
Contains xtd::forms::text_format_flags enum class.