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 [];
89 [[nodiscard]] auto operator [](const xtd::string& name) const noexcept -> const_reference;
94 [[nodiscard]] auto operator [](const xtd::string& name) noexcept -> reference;
96 };
97
99
104
106
114 [[nodiscard]] auto active_link_color() const noexcept ->xtd::drawing::color;
122 auto active_link_color(const xtd::drawing::color& value) -> link_label&;
123
129 [[nodiscard]] auto disabled_link_color() const noexcept -> xtd::drawing::color;
136 auto disabled_link_color(const xtd::drawing::color& value) -> link_label&;
137
144 [[nodiscard]] auto link_area() const noexcept -> xtd::forms::link_area;
153
157 [[nodiscard]] auto link_behavior() const noexcept -> xtd::forms::link_behavior;
163
170 [[nodiscard]] auto link_color() const noexcept -> xtd::drawing::color;
178 auto link_color(const xtd::drawing::color& value) -> link_label&;
179
185 [[nodiscard]] auto links() const noexcept -> const link_collection&;
191 [[nodiscard]] auto links() -> link_collection&;
198 auto links(const link_collection& value) -> link_label&;
199
202 [[nodiscard]] auto override_cursor() const noexcept -> xtd::forms::cursor;
206 auto override_cursor(const xtd::forms::cursor& value) -> link_label&;
207
214 [[nodiscard]] xtd::drawing::color visited_link_color() const noexcept;
222 auto visited_link_color(const xtd::drawing::color& value) -> link_label&;
224
226
230 [[nodiscard]] static auto create() -> link_label;
234 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> link_label;
239 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
245 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
249 [[nodiscard]] static auto create(const xtd::string& text) -> link_label;
254 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location) -> link_label;
260 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
267 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> link_label;
272 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links) -> link_label;
278 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links, const xtd::drawing::point& location) -> link_label;
285 [[nodiscard]] static auto create(const xtd::string& text, const link_collection& links, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
293 [[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;
297 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> link_label;
302 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> link_label;
308 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> link_label;
315 [[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;
320 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text) -> link_label;
326 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location) -> link_label;
333 [[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;
341 [[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;
346 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const link_collection& links) -> link_label;
353 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const link_collection& links, const xtd::drawing::point& location) -> link_label;
361 [[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;
370 [[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;
372
374
381
382 protected:
384
386 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
387
388 auto on_cursor_changed(const xtd::event_args& e) -> void override;
389 auto on_mouse_click(const xtd::forms::mouse_event_args& e) -> void override;
390 auto on_mouse_down(const xtd::forms::mouse_event_args& e) -> void override;
391 auto on_mouse_up(const xtd::forms::mouse_event_args& e) -> void override;
392 auto on_mouse_move(const xtd::forms::mouse_event_args& e) -> void override;
393 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
394 auto on_text_align_changed(const xtd::event_args& e) -> void override;
395 auto on_text_changed(const xtd::event_args& e) -> void override;
396
399 [[nodiscard]] auto point_in_link(const xtd::drawing::point& point) -> xtd::forms::link_label::link&;
401
402 private:
403 [[nodiscard]] auto get_text_location(xtd::usize line) const noexcept -> xtd::drawing::point;
404 [[nodiscard]] auto generate_text_rects() const noexcept -> xtd::array<std::tuple<xtd::drawing::rectangle, bool>>;
405 [[nodiscard]] auto link_font() const noexcept -> xtd::drawing::font;
406
407 xtd::sptr<data> data_;
408 };
409 }
410}
411
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:41
xtd::forms::link_label::link & reference
Definition arranged_element_collection.hpp:84
auto operator=(const arranged_element_collection &other) -> arranged_element_collection &
Definition arranged_element_collection.hpp:430
const xtd::forms::link_label::link & const_reference
Definition arranged_element_collection.hpp:86
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