AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ACircleProgressBar.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#include <AUI/View/AViewContainer.h>
15#include <AUI/Traits/values.h>
16
26class API_AUI_VIEWS ACircleProgressBar: public AViewContainerBase {
27public:
28 class Inner: public AView {
29 public:
30 ~Inner() override;
31 };
32 ~ACircleProgressBar() override;
33
38 void setValue(aui::float_within_0_1 value) {
39 mValue = value;
40 redraw();
41
42 emit valueChanged(value);
43 }
44
45 [[nodiscard]]
46 aui::float_within_0_1 value() const noexcept {
47 return mValue;
48 }
49
50 [[nodiscard]]
51 const _<Inner>& innerView() const noexcept {
52 return mInner;
53 }
54
55public:
56 ACircleProgressBar();
57
58 void render(ARenderContext context) override;
59
60private:
61 aui::float_within_0_1 mValue = 0.f;
62 _<Inner> mInner;
63
64
65signals:
67};
68
69
Definition ACircleProgressBar.h:28
void setValue(aui::float_within_0_1 value)
Definition ACircleProgressBar.h:38
void render(ARenderContext context) override
Draws this AView. Noone should call this function except rendering routine.
Definition AViewContainerBase.cpp:235
void redraw()
Request window manager to redraw this AView.
Definition AView.cpp:68
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348
#define emit
emits the specified signal in context of this object.
Definition AObject.h:310