9#include "qml_material/util/corner.hpp"
10#include "qml_material/enum.hpp"
11#include "qml_material/token/token.hpp"
12#include "qml_material/core.hpp"
17class Util :
public QObject {
19 QML_NAMED_ELEMENT(UtilCpp)
21 Util(QObject* parent =
nullptr);
31 Q_INVOKABLE
void track(QVariant, Track);
33 Q_INVOKABLE
bool hasIcon(
const QJSValue& v)
const;
35 Q_INVOKABLE
void closePopup(QObject* obj)
const;
37 Q_INVOKABLE QColor transparent(QColor in,
float alpha)
const noexcept;
38 Q_INVOKABLE QColor hoverColor(QColor in)
const noexcept;
39 Q_INVOKABLE QColor pressColor(QColor in)
const noexcept;
41 Q_INVOKABLE qreal devicePixelRatio(QQuickItem* in)
const;
43 Q_INVOKABLE CornersGroup listCorners(qint32 idx, qint32 count, qint32 radius)
const noexcept;
44 Q_INVOKABLE CornersGroup tableCorners(qint32 row, qint32 column, qint32 rows, qint32 columns,
45 qint32 radius)
const noexcept;
46 Q_INVOKABLE CornersGroup tableWithHeaderCorners(qint32 row, qint32 column, qint32 rows,
47 qint32 columns, qint32 radius)
const noexcept;
50 Q_INVOKABLE CornersGroup cornerArray(QVariant in)
const noexcept;
51 Q_INVOKABLE CornersGroup corners(qreal in)
const noexcept;
52 Q_INVOKABLE CornersGroup corners(qreal, qreal)
const noexcept;
53 Q_INVOKABLE CornersGroup corners(qreal tl, qreal tr, qreal bl, qreal br)
const noexcept;
55 QString type_str(
const QJSValue&);
56 Q_INVOKABLE
void print_parents(
const QJSValue&);
58 Q_INVOKABLE qreal lightness(QColor color);
60 Q_INVOKABLE token::Elevation tokenElevation();
61 Q_INVOKABLE token::Shape tokenShape();
62 Q_INVOKABLE token::State tokenState();
63 Q_INVOKABLE QObject* createItem(
const QJSValue& url_or_comp,
const QVariantMap& props,
64 QObject* parent =
nullptr);
66 Q_INVOKABLE QObject* showPopup(
const QJSValue& url_or_comp,
const QVariantMap& props,
67 QObject* parent =
nullptr,
bool open_and_destry =
true);
69 Q_INVOKABLE QString paramsString(
const QVariantMap& props);
70 Q_INVOKABLE
void setCursor(QQuickItem* item, Qt::CursorShape shape);
72 Q_INVOKABLE
double clamp(
double t,
double low,
double high)
const;
73 Q_INVOKABLE
double teleportCurve(
double t,
double left,
double right)
const;
75 Q_INVOKABLE
void forceSetImplicitHeight(QQuickItem* item, qreal height);
76 Q_INVOKABLE
void forceSetImplicitWidth(QQuickItem* item, qreal width);
78 Q_INVOKABLE
void cellHoveredOn(QQuickItem* item,
bool hovered, qint32 row, qint32 column)
const;
79 Q_INVOKABLE QObject* getParent(QObject* obj)
const;
80 Q_INVOKABLE
bool disconnectAll(QObject* obj,
const QString&)
const;
83 Q_SLOT
void on_popup_closed();
86 usize m_tracked { 0 };
92auto qml_dyn_count() -> std::atomic<i32>&;
93auto createItem(QQmlEngine* engine,
const QJSValue& url_or_comp,
const QVariantMap& props,
94 QObject* parent) -> QObject*;