xtd 0.2.0
cursor.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.hpp"
6#include <xtd/drawing/bitmap>
7#include <xtd/drawing/point>
8#include <xtd/drawing/size>
9#include <xtd/any>
10#include <xtd/iequatable>
11#include <xtd/object>
12#include <cstdint>
13#include <memory>
14
16namespace xtd {
18 namespace forms {
20 class cursors;
22
40 class forms_export_ cursor : public object, public xtd::iequatable<cursor> {
41 struct data;
42
43 public:
45
48 static cursor none;
50
52
59 explicit cursor(intptr handle);
61
63 cursor(const cursor& value) = default;
64 cursor& operator =(const cursor& value) = default;
65 ~cursor();
67
69
74 intptr handle() const noexcept;
75
79 drawing::point hot_spot() const noexcept;
80
83 drawing::size size() const noexcept;
84
88 const xtd::any_object& tag() const noexcept;
89
93 void tag(xtd::any_object tag);
95
97
102 static xtd::forms::cursor current();
106 static void current(const xtd::forms::cursor& cursor);
107
111 static drawing::point position();
115 static void position(const drawing::point& position);
117
119
124 intptr copy_handle() const;
125
129 bool equals(const xtd::object& obj) const noexcept override;
133 bool equals(const cursor& value) const noexcept override;
134
137 xtd::size get_hash_code() const noexcept override;
138
141 xtd::string to_string() const noexcept override;
143
145
151 static cursor from_bitmap(const xtd::drawing::bitmap& bitmap, const xtd::drawing::point& hot_spot);
156 static cursor from_bitmap(const xtd::drawing::bitmap& bitmap);
157
160 static void hide();
161
164 static void show();
166
167 private:
168 friend class xtd::forms::cursors;
169 cursor(const xtd::drawing::bitmap& bitmap, const xtd::drawing::point& hot_spot);
170 cursor(intptr handle, bool destroyable, const xtd::string& name);
171
172 xtd::sptr<data> data_;
173 };
174 }
175}
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
Represents the image used to paint the mouse pointer.
Definition cursor.hpp:40
cursor()
Initializes a new instance of the cursor class.
intptr handle() const noexcept
Gets the handle of the cursor.
cursor(intptr handle)
Initializes a new instance of the Cursor class from the specified Windows handle.
static cursor none
Represent none cursor.
Definition cursor.hpp:48
Provides a collection of xtd::forms::cursor objects for use by a Windows Forms application.
Definition cursors.hpp:25
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
The xtd::shared_ptr_object is a shared pointer as std::shared_ptr.
Definition shared_ptr_object.hpp:30
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10