Krita Source Code Documentation
Loading...
Searching...
No Matches
KoCssStylePreset.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 KOCSSSTYLEPRESET_H
7#define KOCSSSTYLEPRESET_H
8
9#include <KoResource.h>
10#include <KoSvgTextProperties.h>
11#include <kritaflake_export.h>
12
15
23class KRITAFLAKE_EXPORT KoCssStylePreset : public KoResource
24{
25public:
26 KoCssStylePreset(const QString &filename);
30
32 KoSvgTextProperties properties(int ppi = 72, bool removeKraProps = false) const;
33
35 void setProperties(const KoSvgTextProperties &properties);
36
38 QString description() const;
39 void setDescription(const QString &desc);
40
42 QString styleType() const;
43 void setStyleType(const QString &type);
44
46 QString sampleText() const;
47
49 void setSampleText(const QString &text);
50
52 QString beforeText() const;
53
55 void setBeforeText(const QString &text);
56
58 QString afterText() const;
59
61 void setAfterText(const QString &text);
62
64 QString sampleSvg() const;
65
72 int storedPPIResolution() const;
73
74 void setStoredPPIResolution(const int ppi);
75
80 KoShape* generateSampleShape() const;
81
84 Qt::Alignment alignSample() const;
85
94 QString primaryFontFamily() const;
95
96 void updateAlignSample();
97
98 // KoResource interface
99public:
100 KoResourceSP clone() const override;
101 bool loadFromDevice(QIODevice *dev, KisResourcesInterfaceSP resourcesInterface) override;
102 bool saveToDevice(QIODevice *dev) const override;
103 QString defaultFileExtension() const override;
104 void updateThumbnail() override;
105 QPair<QString, QString> resourceType() const override;
106private:
107 struct Private;
108 QScopedPointer<Private> d;
109};
110
111#endif // KOCSSSTYLEPRESET_H
QSharedPointer< KoCssStylePreset > KoCssStylePresetSP
The KoCssStylePreset class.
QScopedPointer< Private > d
KoCssStylePreset & operator=(const KoCssStylePreset &rhs)=delete
virtual QPair< QString, QString > resourceType() const =0
virtual KoResourceSP clone() const =0
virtual QString defaultFileExtension() const
virtual bool saveToDevice(QIODevice *dev) const
virtual void updateThumbnail()
updateThumbnail updates the thumbnail for this resource. Reimplement if your thumbnail is something e...
virtual bool loadFromDevice(QIODevice *dev, KisResourcesInterfaceSP resourcesInterface)=0