Krita Source Code Documentation
Loading...
Searching...
No Matches
TextPropertiesCanvasObserver.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef TEXTPROPERTIESMANAGER_H
7#define TEXTPROPERTIESMANAGER_H
8
9#include <QObject>
11
12#include <kis_canvas2.h>
13#include <KoResource.h>
16
29{
30 Q_OBJECT
31 Q_PROPERTY(qreal dpi READ dpi() NOTIFY dpiChanged)
32 Q_PROPERTY(QStringList locales READ locales() NOTIFY localesChanged)
36 /*
37 * \qmlproperty hasFocus
38 * whether the related widget has foxus. Used to use to figure out whether
39 * we want to let the current signal compressor go on(hasFocus = true), or
40 * whether we want to retrieve the new text property data from the canvas
41 * resource provider (hasFocus = false).
42 */
43 Q_PROPERTY(bool hasFocus READ hasFocus WRITE setHasFocus NOTIFY hasFocusChanged)
44public:
45 explicit TextPropertiesCanvasObserver(QObject *parent = nullptr);
47
48 QString observerName() override { return "TextPropertiesCanvasObserver"; }
49 void setViewManager(KisViewManager *kisview) override;
50 void setCanvas(KoCanvasBase *canvas) override;
51 void unsetCanvas() override;
52
53 qreal dpi() const;
54 QStringList locales() const;
58
59 bool hasFocus() const;
60 void setHasFocus(const bool focus);
61
62public Q_SLOTS:
67
69
70 void applyPreset(KoResourceSP resource);
72 void editPreset(KoResourceSP resource);
73 void cloneAndEditPreset(KoResourceSP resource);
74Q_SIGNALS:
75 void dpiChanged();
81private:
82 struct Private;
83 const QScopedPointer<Private> d;
85};
86
87#endif // TEXTPROPERTIESMANAGER_H
The KisMainwindowObserver class is an interface for dock widgets that want to keep track of the main ...
The KoSvgTextPropertiesModel class.
The TextPropertiesCanvasObserver class.
TextPropertyConfigModel * textPropertyConfig
const QScopedPointer< Private > d
void cloneAndEditPreset(KoResourceSP resource)
void setCanvas(KoCanvasBase *canvas) override
localesChangedKoSvgTextPropertiesModel * textProperties
KoSvgTextPropertiesModel * characterProperties
void setViewManager(KisViewManager *kisview) override