14#include <AUI/Enum/VerticalAlign.h>
15#include <AUI/Enum/TextTransform.h>
16#include "AUI/Platform/AWindowBase.h"
18#include "AUI/Render/IRenderer.h"
19#include "AUI/Common/AString.h"
20#include "AUI/Image/IDrawable.h"
21#include "AUI/Enum/WordBreak.h"
22#include "AUI/Font/IFontView.h"
23#include <AUI/Util/ADataBinding.h>
24#include <AUI/Common/IStringable.h>
25#include <AUI/Util/Declarative.h>
40 &AAbstractLabel::mText,
41 &AAbstractLabel::setText,
48 void render(ARenderContext context)
override;
49 void doRenderText(IRenderer& render);
53 const _<IDrawable>& getIcon()
const {
59 void setIcon(
const _<IDrawable>& drawable) {
64 void setIconColor(
const AColor& iconColor) {
65 mIconColor = iconColor;
68 void doPrerender(IRenderer& render);
72 void onDpiChanged()
override;
74 void setText(AString newText);
76 void invalidateFont()
override;
79 if (mVerticalAlign == verticalAlign) {
82 mVerticalAlign = verticalAlign;
87 if (mTextOverflow == textOverflow) {
90 mTextOverflow = textOverflow;
91 markMinContentSizeInvalid();
95 if (mTextTransform == textTransform) {
98 mTextTransform = textTransform;
102 void setSize(glm::ivec2 size)
override;
107 _<IRenderer::IPrerenderedString> mPrerendered;
109 const _<IRenderer::IPrerenderedString>& getPrerendered() {
113 void commitStyle()
override;
118 int mTextLeftOffset = 0;
119 bool mIsTextTooLarge =
false;
127 AColor mIconColor = {1, 1, 1, 1};
129 glm::ivec2 getIconSize()
const;
136 AString getTransformedText();
138 void processTextOverflow(AString& text);
140 template<
class Iterator>
141 Iterator findFirstOverflowedIndex(
const Iterator& begin,
const Iterator& end,
int overflowingWidth);
143 template<
class Iterator>
144 void processTextOverflow(Iterator begin, Iterator end,
int overflowingWidth);
163 return &AAbstractLabel::setText;
Represents an abstract text display view.
Definition AAbstractLabel.h:30
auto text() const
Label's text property.
Definition AAbstractLabel.h:37
Represents a Unicode character string.
Definition AString.h:37
virtual int getContentMinimumHeight()
Definition AView.cpp:252
virtual bool consumesClick(const glm::ivec2 &pos)
Determines whether this AView processes this click or passes it thru.
Definition AView.cpp:540
void redraw()
Request window manager to redraw this AView.
Definition AView.cpp:68
virtual int getContentMinimumWidth()
Definition AView.cpp:248
virtual void render(ARenderContext ctx)
Draws this AView. Noone should call this function except rendering routine.
Definition AView.cpp:142
virtual void invalidateAllStyles()
Invalidates all styles, causing to iterate over all rules in global and parent stylesheets.
Definition AView.cpp:179
Interface of a AView that works with fonts (i.e., ALabel, ATextField, AText, etc.....
Definition IFontView.h:19
Object that can be converted to string.
Definition IStringable.h:29
virtual AString toString() const =0
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
VerticalAlign
Controls the text vertical alignment of AView.
Definition VerticalAlign.h:24
TextTransform
Controls the text transform of AView.
Definition TextTransform.h:23
ATextOverflow
Controls behavior of the overflowed text. Relevant to AAbstractLabel and its derivatives only.
Definition AOverflow.h:47
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348
Defines how View handles properties of FieldType type.
Definition ADataBinding.h:37
static void(View::*)(const FieldType &v) getSetter()
Returns setter for ADataBinding (deprecated)
Definition ADataBinding.h:63
static void setup(const _< View > &view)
Called then view linked with field.
Definition ADataBinding.h:43
static auto property(const _< View > &view)
Returns property definition for FieldType.
Definition ADataBinding.h:49
static ASignal< FieldType >View::* getGetter()
Returns getter for ADataBinding (deprecated)
Definition ADataBinding.h:55
Property implementation to use with custom getter/setter.
Definition AProperty.h:308