xtd 1.0.0
Loading...
Searching...
No Matches
link_label.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "cursors.hpp"
6#include "label.hpp"
7#include "link.hpp"
8#include "link_area.hpp"
9#include "link_behavior.hpp"
11#include <xtd/drawing/system_colors>
12#include <xtd/any>
13#include <tuple>
14
16namespace xtd {
18 namespace forms {
44 struct data;
45
46 public:
48
56
58 class link_collection : public xtd::forms::layout::arranged_element_collection<xtd::forms::link_label::link> {
59 public:
61
66
68
72 explicit link_collection() = default;
74
76 explicit link_collection(const base& collection);
77 link_collection(const link_collection& collection);
78 link_collection& operator =(const link_collection& collection);
80
82
84 using base::operator [];
85 using base::operator ();
90 [[nodiscard]] auto operator [](const xtd::string& name) const noexcept -> const_reference;
95 [[nodiscard]] auto operator [](const xtd::string& name) noexcept -> reference;
96
101 [[nodiscard]] auto operator ()(const xtd::string& name) const noexcept -> const_reference;
106 [[nodiscard]] auto operator ()(const xtd::string& name) noexcept -> reference;
108 };
109
111
116
118
126 [[nodiscard]] auto active_link_color() const noexcept ->xtd::drawing::color;
134 auto active_link_color(const xtd::drawing::color& value) -> link_label&;
135
141 [[nodiscard]] auto disabled_link_color() const noexcept -> xtd::drawing::color;
148 auto disabled_link_color(const xtd::drawing::color& value) -> link_label&;
149
156 [[nodiscard]] auto link_area() const noexcept -> xtd::forms::link_area;
165
169 [[nodiscard]] auto link_behavior() const noexcept -> xtd::forms::link_behavior;
175
182 [[nodiscard]] auto link_color() const noexcept -> xtd::drawing::color;
190 auto link_color(const xtd::drawing::color& value) -> link_label&;
191
197 [[nodiscard]] auto links() const noexcept -> const link_collection&;
203 [[nodiscard]] auto links() -> link_collection&;
210 auto links(const link_collection& value) -> link_label&;
211
214 [[nodiscard]] auto override_cursor() const noexcept -> xtd::forms::cursor;
218 auto override_cursor(const xtd::forms::cursor& value) -> link_label&;
219
226 [[nodiscard]] xtd::drawing::color visited_link_color() const noexcept;
234 auto visited_link_color(const xtd::drawing::color& value) -> link_label&;
236
238
242 [[nodiscard]] static auto create() -> link_label;
246 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> link_label;
251 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
257 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
261 [[nodiscard]] static auto create(const xtd::string& text) -> link_label;
266 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location) -> link_label;
272 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
279 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
284 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links) -> link_label;
290 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links, const xtd::drawing::point& location) -> link_label;
297 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
305 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
309 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> link_label;
314 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> link_label;
320 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
327 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
332 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text) -> link_label;
338 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location) -> link_label;
345 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
353 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
358 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const link_collection& links) -> link_label;
365 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const link_collection& links, const xtd::drawing::point& location) -> link_label;
373 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const link_collection& links, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
382 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const link_collection& links, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
384
386
393
394 protected:
396
398 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
399
400 auto on_cursor_changed(const xtd::event_args& e) -> void override;
401 auto on_mouse_click(const xtd::forms::mouse_event_args& e) -> void override;
402 auto on_mouse_down(const xtd::forms::mouse_event_args& e) -> void override;
403 auto on_mouse_up(const xtd::forms::mouse_event_args& e) -> void override;
404 auto on_mouse_move(const xtd::forms::mouse_event_args& e) -> void override;
405 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
406 auto on_text_align_changed(const xtd::event_args& e) -> void override;
407 auto on_text_changed(const xtd::event_args& e) -> void override;
408
411 [[nodiscard]] auto point_in_link(const xtd::drawing::point& point) -> xtd::forms::link_label::link&;
413
414 private:
415 [[nodiscard]] auto get_text_location(xtd::usize line) const noexcept -> xtd::drawing::point;
416 [[nodiscard]] auto generate_text_rects() const noexcept -> xtd::array<std::tuple<xtd::drawing::rectangle, bool>>;
417 [[nodiscard]] auto link_font() const noexcept -> xtd::drawing::font;
418
419 xtd::sptr<data> data_;
420 };
421 }
422}
423
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Represents an event.
Definition event.hpp:23
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto font() const noexcept -> xtd::drawing::font
Gets the font of the text displayed by the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Represents the image used to paint the mouse pointer.
Definition cursor.hpp:40
Represents a standard Windows label.
Definition label.hpp:38
Represents a collection of objects.
Definition arranged_element_collection.hpp:45
xtd::forms::link_label::link & reference
Definition arranged_element_collection.hpp:88
auto operator=(const arranged_element_collection &other) -> arranged_element_collection &
Definition arranged_element_collection.hpp:406
const xtd::forms::link_label::link & const_reference
Definition arranged_element_collection.hpp:90
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.hpp:34
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.hpp:26
Contains xtd::forms::cursors factory.
xtd::delegate< void(xtd::object &sender, xtd::forms::link_label_clicked_event_args &e)> link_label_clicked_event_handler
Represents the method that will handle the xtd::forms::link_label::link_clicked event of a xtd::forms...
Definition link_label_clicked_event_handler.hpp:27
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::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
@ e
The E key.
Definition keys.hpp:207
Contains xtd::forms::label control.
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
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