Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Remove KoTextShapeDataBase

Dmitry Kazakov4f3910c4ec40
diff --git a/libs/flake/CMakeLists.txt b/libs/flake/CMakeLists.txt
index 011e658449..f607626df0 100644
--- a/libs/flake/CMakeLists.txt
+++ b/libs/flake/CMakeLists.txt
@@ -106,7 +106,6 @@ set(kritaflake_SRCS
KoSharedSavingData.cpp
KoViewConverter.cpp
KoViewTransformStillPoint.cpp
- KoTextShapeDataBase.cpp
KoClipMaskApplicatorBase.cpp
${__per_arch_alpha_applicator_factory_objs}
KoClipMaskPainter.cpp
diff --git a/libs/flake/KoTextShapeDataBase.cpp b/libs/flake/KoTextShapeDataBase.cpp
deleted file mode 100644
index 3989791490..0000000000
--- a/libs/flake/KoTextShapeDataBase.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2006, 2009-2010 Thomas Zander <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoTextShapeDataBase.h"
-#include "KoTextShapeDataBase_p.h"
-
-#include <QTextDocument>
-
-KoTextShapeDataBasePrivate::KoTextShapeDataBasePrivate()
- : textAlignment(Qt::AlignLeft | Qt::AlignTop)
- , resizeMethod(KoTextShapeDataBase::NoResize)
-{
-}
-
-KoTextShapeDataBasePrivate::KoTextShapeDataBasePrivate(const KoTextShapeDataBasePrivate &rhs)
- : document(rhs.document->clone()),
- margins(rhs.margins),
- textAlignment(rhs.textAlignment),
- resizeMethod(rhs.resizeMethod)
-{
-}
-
-KoTextShapeDataBasePrivate::~KoTextShapeDataBasePrivate()
-{
-}
-
-KoTextShapeDataBase::KoTextShapeDataBase(KoTextShapeDataBasePrivate *dd)
- : d_ptr(dd)
-{
-}
-
-KoTextShapeDataBase::~KoTextShapeDataBase()
-{
- delete d_ptr;
-}
-
-QTextDocument *KoTextShapeDataBase::document() const
-{
- Q_D(const KoTextShapeDataBase);
- return d->document.data();
-}
-
-void KoTextShapeDataBase::setShapeMargins(const KoInsets &margins)
-{
- Q_D(KoTextShapeDataBase);
- d->margins = margins;
-}
-
-KoInsets KoTextShapeDataBase::shapeMargins() const
-{
- Q_D(const KoTextShapeDataBase);
- return d->margins;
-}
-
-void KoTextShapeDataBase::setVerticalAlignment(Qt::Alignment alignment)
-{
- Q_D(KoTextShapeDataBase);
- d->textAlignment = (d->textAlignment & Qt::AlignHorizontal_Mask)
- | (alignment & Qt::AlignVertical_Mask);
-}
-
-Qt::Alignment KoTextShapeDataBase::verticalAlignment() const
-{
- Q_D(const KoTextShapeDataBase);
- return d->textAlignment & Qt::AlignVertical_Mask;
-}
-
-void KoTextShapeDataBase::setResizeMethod(KoTextShapeDataBase::ResizeMethod method)
-{
- Q_D(KoTextShapeDataBase);
- if (d->resizeMethod == method)
- return;
- d->resizeMethod = method;
-}
-
-KoTextShapeDataBase::ResizeMethod KoTextShapeDataBase::resizeMethod() const
-{
- Q_D(const KoTextShapeDataBase);
- return d->resizeMethod;
-}
diff --git a/libs/flake/KoTextShapeDataBase.h b/libs/flake/KoTextShapeDataBase.h
deleted file mode 100644
index c54d8b1c04..0000000000
--- a/libs/flake/KoTextShapeDataBase.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2006-2010 Thomas Zander <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#ifndef KOTEXTSHAPEDATABASE_H
-#define KOTEXTSHAPEDATABASE_H
-
-#include "kritaflake_export.h"
-
-#include "KoShapeUserData.h"
-
-class KoTextShapeDataBasePrivate;
-#include <QDomDocument>
-class KoShapeLoadingContext;
-class KoShapeSavingContext;
-struct KoInsets;
-
-class QTextDocument;
-
-/**
- * \internal
- */
-class KRITAFLAKE_EXPORT KoTextShapeDataBase : public KoShapeUserData
-{
- Q_OBJECT
-public:
- /// constructor
- KoTextShapeDataBase();
- ~KoTextShapeDataBase() override;
-
- /// return the document
- QTextDocument *document() const;
-
- /**
- * Set the margins that will make the shapes text area smaller.
- * The shape that owns this textShapeData object will layout text in an area
- * confined by the shape size made smaller by the margins set here.
- * @param margins the margins that shrink the text area.
- */
- void setShapeMargins(const KoInsets &margins);
- /**
- * returns the currently set margins for the shape.
- */
- KoInsets shapeMargins() const;
-
- /** Sets the vertical alignment of all the text inside the shape. */
- void setVerticalAlignment(Qt::Alignment alignment);
-
- /** Returns the vertical alignment of all the text in the shape */
- Qt::Alignment verticalAlignment() const;
-
- /**
- * Enum to describe the text document's automatic resizing behaviour.
- */
- enum ResizeMethod {
- /// Resize the shape to fit the content. This makes sure that the text shape takes op
- /// only as much space as absolutely necessary to fit the entire text into its boundaries.
- AutoResize,
- /// Specifies whether or not to automatically increase the width of the drawing object
- /// if text is added to fit the entire width of the text into its boundaries.
- /// Compared to AutoResize above this only applied to the width whereas the height is
- /// not resized. Also this only grows but does not shrink again if text is removed again.
- AutoGrowWidth,
- /// Specifies whether or not to automatically increase the height of the drawing object
- /// if text is added to fit the entire height of the text into its boundaries.
- AutoGrowHeight,
- /// This combines the AutoGrowWidth and AutoGrowHeight and automatically increase width
- /// and height to fit the entire text into its boundaries.
- AutoGrowWidthAndHeight,
- /// Shrink the content displayed within the shape to match into the shape's boundaries. This
- /// will scale the content down as needed to display the whole document.
- ShrinkToFitResize,
- /// Deactivates auto-resizing. This is the default resizing method.
- NoResize
- };
-
- /**
- * Specifies how the document should be resized upon a change in the document.
- *
- * If auto-resizing is turned on, text will not be wrapped unless enforced by e.g. a newline.
- *
- * By default, NoResize is set.
- */
- void setResizeMethod(ResizeMethod method);
-
- /**
- * Returns the auto-resizing mode. By default, this is NoResize.
- *
- * @see setResizeMethod
- */
- ResizeMethod resizeMethod() const;
-
-protected:
- /// constructor
- KoTextShapeDataBase(KoTextShapeDataBasePrivate *);
-
- KoTextShapeDataBasePrivate *d_ptr;
-
-private:
- Q_DECLARE_PRIVATE(KoTextShapeDataBase)
-};
-
-#endif
-
diff --git a/libs/flake/KoTextShapeDataBase_p.h b/libs/flake/KoTextShapeDataBase_p.h
deleted file mode 100644
index 160548e107..0000000000
--- a/libs/flake/KoTextShapeDataBase_p.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2006-2010 Thomas Zander <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#ifndef KOTEXTSHAPEDATABASE_P_H
-#define KOTEXTSHAPEDATABASE_P_H
-
-#include "KoInsets.h"
-
-class QTextDocument;
-
-/// \internal
-class KRITAFLAKE_EXPORT KoTextShapeDataBasePrivate
-{
-public:
- KoTextShapeDataBasePrivate();
- virtual ~KoTextShapeDataBasePrivate();
-
- KoTextShapeDataBasePrivate(const KoTextShapeDataBasePrivate &rhs);
-
- QScopedPointer<QTextDocument> document;
- KoInsets margins;
- Qt::Alignment textAlignment;
- KoTextShapeDataBase::ResizeMethod resizeMethod;
-};
-
-#endif
-