AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
IFontView.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 "AFontStyle.h"
15
19class API_AUI_VIEWS IFontView {
20public:
21 virtual ~IFontView();
22
23 [[nodiscard]]
24 AFontStyle& getFontStyle() {
25 return mFontStyle;
26 }
27
28 [[nodiscard]]
29 const AColor& getTextColor() const {
30 return mColor;
31 }
32
33 virtual void invalidateFont() = 0;
34
35 void setTextColor(AColor color) {
36 mColor = color;
37 }
38
39protected:
40 void invalidateAllStylesFont();
41 void commitStyleFont();
42
43private:
44 AColor mColor;
45 AFontStyle mFontStyle, mPrevFontStyle { .font = nullptr };
46};
Represents a 4-component floating point color.
Definition: AColor.h:27
Interface of a AView that works with fonts (i.e., ALabel, ATextField, AText, etc.....
Definition: IFontView.h:19
Definition: AFontStyle.h:24