AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ACursor.h
1/*
2 * AUI Framework - Declarative UI toolkit for modern C++20
3 * Copyright (C) 2020-2024 Alex2772 and Contributors
4 *
5 * SPDX-License-Identifier: MPL-2.0
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 */
11
12#pragma once
13
14
15#include <variant>
16#include <AUI/Image/AImage.h>
17#include "AUI/Image/IDrawable.h"
18
19class AWindow;
20
26class API_AUI_VIEWS ACursor
27{
28private:
29 struct Custom;
30
31public:
32 enum System {
39
46
53
60
67
74 };
75
76 ACursor(System systemCursor): mValue(systemCursor) {}
77 explicit ACursor(aui::no_escape<AImage> image, int size = 16);
78 explicit ACursor(aui::non_null<_<IDrawable>> drawable, int size = 16);
79 explicit ACursor(AUrl imageUrl, int size = 16);
80
81 ~ACursor();
82
83 void applyNativeCursor(AWindow* pWindow) const;
84
85private:
86 std::variant<System, _<Custom>, _<IDrawable>> mValue;
87 int mSize;
88};
Represents cursor type.
Definition: ACursor.h:27
System
Definition: ACursor.h:32
@ MOVE
Something to be moved. Crosshair-like cursor.
Definition: ACursor.h:59
@ TEXT
'I' beam.
Definition: ACursor.h:52
@ DEFAULT
Default arrow.
Definition: ACursor.h:38
@ NS_RESIZE
Bidirectional resize cursor north-south.
Definition: ACursor.h:73
@ EW_RESIZE
Bidirectional resize cursor east-west. <->
Definition: ACursor.h:66
@ POINTER
Pointing finger.
Definition: ACursor.h:45
Uniform Resource Locator implementation.
Definition: AUrl.h:31
Represents a window in the underlying windowing system.
Definition: AWindow.h:45
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Definition: ACursorImpl.cpp:18
Does not allow escaping, allowing to accept lvalue ref, rvalue ref, shared_ptr and etc without overhe...
Definition: values.h:127
Definition: values.h:109