Krita Source Code Documentation
Loading...
Searching...
No Matches
KoTosContainer.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2010 Thomas Zander <zander@kde.org>
3 * SPDX-FileCopyrightText: 2010 KO GmbH <boud@kogmbh.com>
4 * SPDX-FileCopyrightText: 2010 Thorsten Zachmann <zachmann@kde.org>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8
9#ifndef KOTOSCONTAINER_H
10#define KOTOSCONTAINER_H
11
12#include "KoShapeContainer.h"
13
14#include "kritaflake_export.h"
15
17
18
24class KRITAFLAKE_EXPORT KoTosContainer : public KoShapeContainer
25{
26public:
28 ~KoTosContainer() override;
29
30 // reimplemented
31 void paintComponent(QPainter &painter) const override;
32
33 // reimplemented
34 virtual bool loadText(const QDomElement &element);
35
36
42 TextFollowsPreferredTextRect
43 };
44
51 void setResizeBehavior(ResizeBehavior resizeBehavior);
52
56 ResizeBehavior resizeBehavior() const;
57
59 void setTextAlignment(Qt::Alignment alignment);
60
62 Qt::Alignment textAlignment() const;
63
68 void setPlainText(const QString &text);
69
76 KoShape *createTextShape(KoDocumentResourceManager *documentResources = 0);
77
78 void setRunThrough(short int runThrough) override;
79
80protected:
82
89 void setPreferredTextRect(const QRectF &rect);
90
94 QRectF preferredTextRect() const;
95
101 KoShape *textShape() const;
102
103 void shapeChanged(ChangeType type, KoShape *shape = 0) override;
104
105private:
106 class Private;
107 QSharedDataPointer<Private> d;
108};
109
110#endif
virtual void paintComponent(QPainter &painter) const =0
Paint the component Implement this method to allow the shape to paint itself, just like the KoShape::...
void shapeChanged(ChangeType type, KoShape *shape=0) override
virtual void setRunThrough(short int runThrough)
Definition KoShape.cpp:967
QSharedDataPointer< Private > d
ResizeBehavior
different kinds of resizing behavior to determine how to treat text overflow
@ FollowTextSize
Content shape will get resized if text grows/shrinks.
@ TextFollowsSize
Text area is same size as content, extra text will be clipped.
@ IndependentSizes
The text can get bigger than the content.