File indexing completed on 2024-04-28 04:32:36

0001 /*
0002     SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef OKULAR_ANNOTATIONS_P_H
0008 #define OKULAR_ANNOTATIONS_P_H
0009 
0010 #include "annotations.h"
0011 #include "area.h"
0012 
0013 // qt/kde includes
0014 #include <QColor>
0015 #include <QDateTime>
0016 #include <QString>
0017 #include <QVariant>
0018 
0019 class QTransform;
0020 
0021 namespace Okular
0022 {
0023 class PagePrivate;
0024 
0025 class AnnotationPrivate
0026 {
0027 public:
0028     AnnotationPrivate();
0029 
0030     OKULARCORE_EXPORT static AnnotationPrivate *get(Annotation *a);
0031 
0032     virtual ~AnnotationPrivate();
0033 
0034     AnnotationPrivate(const AnnotationPrivate &) = delete;
0035     AnnotationPrivate &operator=(const AnnotationPrivate &) = delete;
0036 
0037     /**
0038      * Transforms the annotation coordinates with the transformation
0039      * defined by @p matrix.
0040      */
0041     void annotationTransform(const QTransform &matrix);
0042 
0043     virtual void transform(const QTransform &matrix);
0044     virtual void baseTransform(const QTransform &matrix);
0045     virtual void resetTransformation();
0046     virtual void translate(const NormalizedPoint &coord);
0047     virtual void adjust(const NormalizedPoint &deltaCoord1, const NormalizedPoint &deltaCoord2);
0048     virtual bool openDialogAfterCreation() const;
0049     virtual void setAnnotationProperties(const QDomNode &node);
0050     virtual bool canBeResized() const;
0051     virtual AnnotationPrivate *getNewAnnotationPrivate() = 0;
0052 
0053     /**
0054      * Determines the distance of the closest point of the annotation to the
0055      * given point @p x @p y @p xScale @p yScale
0056      * @since 0.17
0057      */
0058     virtual double distanceSqr(double x, double y, double xScale, double yScale) const;
0059 
0060     PagePrivate *m_page;
0061 
0062     QString m_author;
0063     QString m_contents;
0064     QString m_uniqueName;
0065     QDateTime m_modifyDate;
0066     QDateTime m_creationDate;
0067 
0068     int m_flags;
0069     NormalizedRect m_boundary;
0070     NormalizedRect m_transformedBoundary;
0071 
0072     Okular::Annotation::Style m_style;
0073     Okular::Annotation::Window m_window;
0074     QList<Okular::Annotation::Revision> m_revisions;
0075 
0076     Annotation::DisposeDataFunction m_disposeFunc;
0077     QVariant m_nativeId;
0078 };
0079 
0080 }
0081 
0082 #endif