2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2005 Enrico Ros <eros.kde@email.it>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2005-02-12 17:42:54 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#ifndef _OKULAR_ANNOTATIONS_H_
|
|
|
|
#define _OKULAR_ANNOTATIONS_H_
|
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QDateTime>
|
|
|
|
#include <QDomDocument>
|
|
|
|
#include <QDomElement>
|
|
|
|
#include <QFont>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QString>
|
2006-09-21 08:45:36 +00:00
|
|
|
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "area.h"
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_export.h"
|
2005-02-12 17:42:54 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular
|
|
|
|
{
|
2012-08-16 09:53:58 +00:00
|
|
|
class Action;
|
2005-04-04 23:53:45 +00:00
|
|
|
class Annotation;
|
2007-05-04 20:45:45 +00:00
|
|
|
class AnnotationObjectRect;
|
2007-05-04 20:24:12 +00:00
|
|
|
class AnnotationPrivate;
|
2007-07-17 18:10:25 +00:00
|
|
|
class Document;
|
2008-04-13 16:34:33 +00:00
|
|
|
class EmbeddedFile;
|
2007-07-17 18:10:25 +00:00
|
|
|
class Page;
|
2007-07-17 20:04:30 +00:00
|
|
|
class PagePrivate;
|
2008-04-13 20:00:06 +00:00
|
|
|
class Sound;
|
2008-08-23 00:07:59 +00:00
|
|
|
class Movie;
|
2007-05-04 20:24:12 +00:00
|
|
|
class TextAnnotationPrivate;
|
|
|
|
class LineAnnotationPrivate;
|
|
|
|
class GeomAnnotationPrivate;
|
|
|
|
class HighlightAnnotationPrivate;
|
|
|
|
class StampAnnotationPrivate;
|
|
|
|
class InkAnnotationPrivate;
|
2008-04-05 14:46:07 +00:00
|
|
|
class CaretAnnotationPrivate;
|
2008-04-13 16:34:33 +00:00
|
|
|
class FileAttachmentAnnotationPrivate;
|
2008-04-13 20:00:06 +00:00
|
|
|
class SoundAnnotationPrivate;
|
2008-08-23 00:07:59 +00:00
|
|
|
class MovieAnnotationPrivate;
|
2012-08-16 09:53:58 +00:00
|
|
|
class ScreenAnnotationPrivate;
|
|
|
|
class WidgetAnnotationPrivate;
|
2015-08-04 09:11:29 +00:00
|
|
|
class RichMediaAnnotationPrivate;
|
2005-04-04 23:53:45 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* @short Helper class for (recursive) annotation retrieval/storage.
|
2005-04-04 23:53:45 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT AnnotationUtils
|
2005-04-04 23:53:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Restore an annotation (with revisions if needed) from the dom @p element.
|
|
|
|
*
|
|
|
|
* Returns a pointer to the complete annotation or 0 if element is invalid.
|
|
|
|
*/
|
|
|
|
static Annotation *createAnnotation(const QDomElement &element);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Saves the @p annotation as a child of @p element taking
|
|
|
|
* care of saving all revisions if it has any.
|
|
|
|
*/
|
|
|
|
static void storeAnnotation(const Annotation *annotation, QDomElement &element, QDomDocument &document);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the child element with the given @p name from the direct
|
|
|
|
* children of @p parentNode or a null element if not found.
|
|
|
|
*/
|
2005-04-07 19:27:54 +00:00
|
|
|
static QDomElement findChildElement(const QDomNode &parentNode, const QString &name);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the geometry of the given @p annotation scaled by
|
|
|
|
* @p scaleX and @p scaleY.
|
|
|
|
*/
|
|
|
|
static QRect annotationGeometry(const Annotation *annotation, double scaleX, double scaleY);
|
2021-10-01 16:04:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a pixmap for a stamp symbol
|
|
|
|
*
|
|
|
|
* @p name Name of a Okular stamp symbol, icon or path to an image
|
2021-10-01 16:55:19 +00:00
|
|
|
* @p size Size of the pixmap side
|
|
|
|
* @p keepAspectRatio Whether to keep aspect ratio of the stamp or not
|
|
|
|
*
|
|
|
|
* @since 21.12
|
2021-10-01 16:04:50 +00:00
|
|
|
*/
|
|
|
|
static QPixmap loadStamp(const QString &nameOrPath, int size, bool keepAspectRatio = true);
|
2005-04-04 23:53:45 +00:00
|
|
|
};
|
2005-03-24 18:51:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @short Annotation struct holds properties shared by all annotations.
|
|
|
|
*
|
|
|
|
* An Annotation is an object (text note, highlight, sound, popup window, ..)
|
2006-09-21 08:45:36 +00:00
|
|
|
* contained by a Page in the document.
|
2005-03-24 18:51:24 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Annotation
|
2005-04-04 23:53:45 +00:00
|
|
|
{
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2007-05-04 20:45:45 +00:00
|
|
|
friend class AnnotationObjectRect;
|
2007-07-17 18:10:25 +00:00
|
|
|
friend class Document;
|
2013-04-05 22:22:48 +00:00
|
|
|
friend class DocumentPrivate;
|
2013-06-23 17:19:25 +00:00
|
|
|
friend class ObjectRect;
|
2007-07-17 18:10:25 +00:00
|
|
|
friend class Page;
|
2007-07-17 20:04:30 +00:00
|
|
|
friend class PagePrivate;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2007-05-04 20:45:45 +00:00
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
public:
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Describes the type of annotation as defined in PDF standard.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
enum SubType {
|
|
|
|
AText = 1, ///< A textual annotation
|
|
|
|
ALine = 2, ///< A line annotation
|
|
|
|
AGeom = 3, ///< A geometrical annotation
|
|
|
|
AHighlight = 4, ///< A highlight annotation
|
|
|
|
AStamp = 5, ///< A stamp annotation
|
|
|
|
AInk = 6, ///< An ink annotation
|
2008-04-05 14:46:07 +00:00
|
|
|
ACaret = 8, ///< A caret annotation
|
2008-04-13 16:34:33 +00:00
|
|
|
AFileAttachment = 9, ///< A file attachment annotation
|
2008-04-13 20:00:06 +00:00
|
|
|
ASound = 10, ///< A sound annotation
|
2008-08-23 00:07:59 +00:00
|
|
|
AMovie = 11, ///< A movie annotation
|
2012-08-16 09:53:58 +00:00
|
|
|
AScreen = 12, ///< A screen annotation
|
|
|
|
AWidget = 13, ///< A widget annotation
|
2015-08-04 09:11:29 +00:00
|
|
|
ARichMedia = 14, ///< A rich media annotation
|
2006-12-11 07:59:02 +00:00
|
|
|
A_BASE = 0 ///< The annotation base class
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Describes additional properties of an annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
enum Flag {
|
|
|
|
Hidden = 1, ///< Is not shown in the document
|
|
|
|
FixedSize = 2, ///< Has a fixed size
|
|
|
|
FixedRotation = 4, ///< Has a fixed rotation
|
|
|
|
DenyPrint = 8, ///< Cannot be printed
|
|
|
|
DenyWrite = 16, ///< Cannot be changed
|
|
|
|
DenyDelete = 32, ///< Cannot be deleted
|
|
|
|
ToggleHidingOnMouse = 64, ///< Can be hidden/shown by mouse click
|
2009-12-31 09:56:31 +00:00
|
|
|
External = 128, ///< Is stored external
|
2012-05-13 18:10:55 +00:00
|
|
|
ExternallyDrawn = 256, ///< Is drawn externally (by the generator which provided it) @since 0.10 (KDE 4.4)
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
BeingMoved = 512, ///< Is being moved (mouse drag and drop). If ExternallyDrawn, the generator must not draw it @since 0.15 (KDE 4.9)
|
|
|
|
BeingResized = 1024 ///< Is being resized (mouse drag and drop). If ExternallyDrawn, the generator must not draw it @since 1.1.0
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Describes possible line styles for @see ALine annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
enum LineStyle {
|
|
|
|
Solid = 1, ///< A solid line
|
|
|
|
Dashed = 2, ///< A dashed line
|
|
|
|
Beveled = 4, ///< A beveled line
|
2018-11-14 19:12:15 +00:00
|
|
|
Inset = 8, ///< An inset line
|
2006-12-05 11:05:50 +00:00
|
|
|
Underline = 16 ///< An underline
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Describes possible line effects for @see ALine annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
enum LineEffect {
|
|
|
|
NoEffect = 1, ///< No effect
|
|
|
|
Cloudy = 2 ///< The cloudy effect
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Describes the scope of revision information.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
enum RevisionScope {
|
|
|
|
Reply = 1, ///< Belongs to a reply
|
|
|
|
Group = 2, ///< Belongs to a group
|
|
|
|
Delete = 4 ///< Belongs to a deleted paragraph
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Describes the type of revision information.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
enum RevisionType {
|
|
|
|
None = 1, ///< Not specified
|
|
|
|
Marked = 2, ///< Is marked
|
|
|
|
Unmarked = 4, ///< Is unmarked
|
|
|
|
Accepted = 8, ///< Has been accepted
|
|
|
|
Rejected = 16, ///< Was rejected
|
|
|
|
Cancelled = 32, ///< Has been cancelled
|
|
|
|
Completed = 64 ///< Has been completed
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-08-16 09:53:58 +00:00
|
|
|
* Describes the type of additional actions.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2012-08-16 09:53:58 +00:00
|
|
|
* @since 0.16 (KDE 4.10)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2012-08-16 09:53:58 +00:00
|
|
|
enum AdditionalActionType {
|
2018-05-30 08:04:06 +00:00
|
|
|
PageOpening, ///< Performed when the page containing the annotation is opened.
|
|
|
|
PageClosing, ///< Performed when the page containing the annotation is closed.
|
|
|
|
CursorEntering, ///< Performed when the cursor enters the annotation's active area @since 1.5
|
|
|
|
CursorLeaving, ///< Performed when the cursor exists the annotation's active area @since 1.5
|
|
|
|
MousePressed, ///< Performed when the mouse button is pressed inside the annotation's active area @since 1.5
|
|
|
|
MouseReleased, ///< Performed when the mouse button is released inside the annotation's active area @since 1.5
|
|
|
|
FocusIn, ///< Performed when the annotation receives the input focus @since 1.5
|
|
|
|
FocusOut, ///< Performed when the annotation loses the input focus @since 1.5
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2008-04-13 13:45:32 +00:00
|
|
|
* A function to be called when the annotation is destroyed.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @warning the function must *not* call any virtual function,
|
|
|
|
* nor subcast.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @since 0.7 (KDE 4.1)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2008-04-13 13:45:32 +00:00
|
|
|
typedef void (*DisposeDataFunction)(const Okular::Annotation *);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Destroys the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
virtual ~Annotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Sets the @p author of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setAuthor(const QString &author);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the author of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
QString author() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Sets the @p contents of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setContents(const QString &contents);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the contents of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
QString contents() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 21:07:51 +00:00
|
|
|
* Sets the unique @p name of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setUniqueName(const QString &name);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the unique name of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
QString uniqueName() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Sets the last modification @p date of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2006-12-05 11:05:50 +00:00
|
|
|
* The date must be before or equal to QDateTime::currentDateTime()
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setModificationDate(const QDateTime &date);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the last modification date of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
QDateTime modificationDate() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Sets the creation @p date of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2006-12-05 11:05:50 +00:00
|
|
|
* The date must be before or equal to @see modificationDate()
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setCreationDate(const QDateTime &date);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the creation date of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
QDateTime creationDate() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Sets the @p flags of the annotation.
|
2007-05-27 09:59:52 +00:00
|
|
|
* @see @ref Flag
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setFlags(int flags);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the flags of the annotation.
|
2007-05-27 09:59:52 +00:00
|
|
|
* @see @ref Flag
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
int flags() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Sets the bounding @p rectangle of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
void setBoundingRectangle(const NormalizedRect &rectangle);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the bounding rectangle of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
NormalizedRect boundingRectangle() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns the transformed bounding rectangle of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2006-12-05 11:05:50 +00:00
|
|
|
* This rectangle must be used when showing annotations on screen
|
|
|
|
* to have them rotated correctly.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
NormalizedRect transformedBoundingRectangle() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2007-07-17 18:10:25 +00:00
|
|
|
* Move the annotation by the specified coordinates.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-05-01 20:59:51 +00:00
|
|
|
* @see canBeMoved()
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2007-07-17 18:10:25 +00:00
|
|
|
void translate(const NormalizedPoint &coord);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
* Adjust the annotation by the specified coordinates.
|
|
|
|
* Adds coordinates of @p deltaCoord1 to annotations top left corner,
|
|
|
|
* and @p deltaCoord2 to the bottom right.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
* @see canBeResized()
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
void adjust(const NormalizedPoint &deltaCoord1, const NormalizedPoint &deltaCoord2);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* The Style class contains all information about style of the
|
|
|
|
* annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Style
|
2020-07-10 22:15:05 +00:00
|
|
|
{
|
2006-12-05 11:05:50 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new style.
|
|
|
|
*/
|
|
|
|
Style();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the style.
|
|
|
|
*/
|
|
|
|
~Style();
|
|
|
|
|
|
|
|
Style(const Style &other);
|
|
|
|
Style &operator=(const Style &other);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p color of the style.
|
|
|
|
*/
|
|
|
|
void setColor(const QColor &color);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the color of the style.
|
|
|
|
*/
|
|
|
|
QColor color() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p opacity of the style.
|
|
|
|
*/
|
|
|
|
void setOpacity(double opacity);
|
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Returns the opacity of the style.
|
|
|
|
*/
|
2018-05-30 08:04:06 +00:00
|
|
|
double opacity() const;
|
2012-08-16 09:53:58 +00:00
|
|
|
|
2008-04-13 13:45:32 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p width of the style.
|
|
|
|
*/
|
|
|
|
void setWidth(double width);
|
|
|
|
|
2006-12-05 11:05:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the width of the style.
|
|
|
|
*/
|
|
|
|
double width() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the line @p style of the style.
|
|
|
|
*/
|
|
|
|
void setLineStyle(LineStyle style);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the line style of the style.
|
|
|
|
*/
|
|
|
|
LineStyle lineStyle() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the x-corners of the style.
|
|
|
|
*/
|
|
|
|
void setXCorners(double xCorners);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the x-corners of the style.
|
|
|
|
*/
|
|
|
|
double xCorners() const;
|
|
|
|
|
|
|
|
/**
|
2006-12-05 21:07:51 +00:00
|
|
|
* Sets the y-corners of the style.
|
2006-12-05 11:05:50 +00:00
|
|
|
*/
|
|
|
|
void setYCorners(double yCorners);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the y-corners of the style.
|
|
|
|
*/
|
|
|
|
double yCorners() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p marks of the style.
|
|
|
|
*/
|
|
|
|
void setMarks(int marks);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the marks of the style.
|
|
|
|
*/
|
|
|
|
int marks() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p spaces of the style.
|
|
|
|
*/
|
|
|
|
void setSpaces(int spaces);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the spaces of the style.
|
|
|
|
*/
|
|
|
|
int spaces() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the line @p effect of the style.
|
|
|
|
*/
|
|
|
|
void setLineEffect(LineEffect effect);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the line effect of the style.
|
|
|
|
*/
|
|
|
|
LineEffect lineEffect() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the effect @p intensity of the style.
|
|
|
|
*/
|
|
|
|
void setEffectIntensity(double intensity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the effect intensity of the style.
|
|
|
|
*/
|
|
|
|
double effectIntensity() const;
|
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
private:
|
2006-12-18 07:28:02 +00:00
|
|
|
class Private;
|
|
|
|
Private *const d;
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns a reference to the style object of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
Style &style();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* Returns a const reference to the style object of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
const Style &style() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* The Window class contains all information about the popup window
|
|
|
|
* of the annotation that is used to edit the content and properties.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Window
|
2020-07-10 22:15:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-05 11:05:50 +00:00
|
|
|
/**
|
|
|
|
* Creates a new window.
|
|
|
|
*/
|
|
|
|
Window();
|
|
|
|
|
2007-07-17 18:10:25 +00:00
|
|
|
/**
|
|
|
|
* Destroys the window.
|
|
|
|
*/
|
2006-12-18 07:28:02 +00:00
|
|
|
~Window();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-07-17 18:10:25 +00:00
|
|
|
Window(const Window &other);
|
|
|
|
Window &operator=(const Window &other);
|
|
|
|
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p flags of the window.
|
|
|
|
*/
|
|
|
|
void setFlags(int flags);
|
|
|
|
|
2006-12-05 11:05:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the flags of the window.
|
|
|
|
*/
|
|
|
|
int flags() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the top-left @p point of the window.
|
|
|
|
*/
|
|
|
|
void setTopLeft(const NormalizedPoint &point);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the top-left point of the window.
|
|
|
|
*/
|
|
|
|
NormalizedPoint topLeft() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p width of the window.
|
|
|
|
*/
|
|
|
|
void setWidth(int width);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the width of the window.
|
|
|
|
*/
|
|
|
|
int width() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p height of the window.
|
|
|
|
*/
|
|
|
|
void setHeight(int height);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the height of the window.
|
|
|
|
*/
|
|
|
|
int height() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p title of the window.
|
|
|
|
*/
|
|
|
|
void setTitle(const QString &title);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the title of the window.
|
|
|
|
*/
|
|
|
|
QString title() const;
|
|
|
|
|
2008-04-13 13:45:32 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p summary of the window.
|
|
|
|
*/
|
|
|
|
void setSummary(const QString &summary);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the summary of the window.
|
|
|
|
*/
|
|
|
|
QString summary() const;
|
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
private:
|
2006-12-18 07:28:02 +00:00
|
|
|
class Private;
|
|
|
|
Private *const d;
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns a reference to the window object of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-18 07:28:02 +00:00
|
|
|
Window &window();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns a const reference to the window object of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-05 11:05:50 +00:00
|
|
|
const Window &window() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-05 11:05:50 +00:00
|
|
|
* The Revision class contains all information about the revision
|
|
|
|
* of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2020-09-10 18:51:52 +00:00
|
|
|
class OKULARCORE_EXPORT Revision
|
2020-07-10 22:15:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-04-13 13:45:32 +00:00
|
|
|
/**
|
|
|
|
* Creates a new revision.
|
|
|
|
*/
|
|
|
|
Revision();
|
|
|
|
|
2008-05-01 20:59:51 +00:00
|
|
|
/**
|
|
|
|
* Destroys the revision.
|
|
|
|
*/
|
|
|
|
~Revision();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-05-01 20:59:51 +00:00
|
|
|
Revision(const Revision &other);
|
2006-12-18 07:28:02 +00:00
|
|
|
Revision &operator=(const Revision &other);
|
2008-05-01 20:59:51 +00:00
|
|
|
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p annotation the revision belongs to.
|
|
|
|
*/
|
|
|
|
void setAnnotation(Annotation *annotation);
|
|
|
|
|
2010-12-27 22:16:11 +00:00
|
|
|
/**
|
|
|
|
* Returns the annotation the revision belongs to.
|
|
|
|
*/
|
|
|
|
Annotation *annotation() const;
|
|
|
|
|
2006-12-05 11:05:50 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p scope of the revision.
|
|
|
|
* @see RevisionScope
|
|
|
|
*/
|
2007-07-22 22:52:47 +00:00
|
|
|
void setScope(RevisionScope scope);
|
2006-12-05 11:05:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the scope of the revision.
|
|
|
|
*/
|
|
|
|
RevisionScope scope() const;
|
|
|
|
|
2013-04-05 22:22:48 +00:00
|
|
|
/**
|
2013-04-05 22:28:39 +00:00
|
|
|
* Sets the @p type of the revision.
|
|
|
|
* @see RevisionType
|
|
|
|
*/
|
|
|
|
void setType(RevisionType type);
|
2013-04-05 22:22:48 +00:00
|
|
|
|
|
|
|
/**
|
2013-04-05 22:28:39 +00:00
|
|
|
* Returns the type of the revision.
|
|
|
|
*/
|
|
|
|
RevisionType type() const;
|
2006-12-18 07:28:02 +00:00
|
|
|
|
2007-05-04 20:24:12 +00:00
|
|
|
private:
|
2006-12-18 07:28:02 +00:00
|
|
|
class Private;
|
|
|
|
Private *const d;
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-18 13:32:45 +00:00
|
|
|
* Returns a reference to the revision list of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2022-03-19 18:14:39 +00:00
|
|
|
QList<Revision> &revisions();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns a reference to the revision list of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2022-03-19 18:14:39 +00:00
|
|
|
const QList<Revision> &revisions() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the "native" @p id of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* This is for use of the Generator, that can optionally store an
|
|
|
|
* handle (a pointer, an identifier, etc) of the "native" annotation
|
|
|
|
* object, if any.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @note Okular makes no use of this
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @since 0.7 (KDE 4.1)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
void setNativeId(const QVariant &id);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns the "native" id of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @since 0.7 (KDE 4.1)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2008-04-13 13:45:32 +00:00
|
|
|
QVariant nativeId() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-13 13:45:32 +00:00
|
|
|
* Sets a function to be called when the annotation is destroyed.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @warning the function must *not* call any virtual function,
|
|
|
|
* nor subcast.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @since 0.7 (KDE 4.1)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2008-04-13 13:45:32 +00:00
|
|
|
void setDisposeDataFunction(DisposeDataFunction func);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2012-09-27 10:43:06 +00:00
|
|
|
* Returns whether the annotation can be moved.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2008-04-13 13:45:32 +00:00
|
|
|
* @since 0.7 (KDE 4.1)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2008-05-01 20:59:51 +00:00
|
|
|
bool canBeMoved() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2012-09-27 10:43:06 +00:00
|
|
|
* Returns whether the annotation can be resized.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 22:16:06 +00:00
|
|
|
bool canBeResized() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2012-09-27 10:43:06 +00:00
|
|
|
* Returns whether the annotation dialog should be open after creation of the annotation or not
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2010-12-27 22:16:11 +00:00
|
|
|
* @since 0.13 (KDE 4.7)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2010-12-27 22:16:11 +00:00
|
|
|
bool openDialogAfterCreation() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns the sub type of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2007-07-22 22:52:47 +00:00
|
|
|
virtual SubType subType() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Stores the annotation as xml in @p document under the given parent @p node.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
virtual void store(QDomNode &node, QDomDocument &document) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2013-04-05 22:28:39 +00:00
|
|
|
* Retrieve the QDomNode representing this annotation's properties
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2013-04-05 22:28:39 +00:00
|
|
|
* @since 0.17 (KDE 4.11)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2013-04-05 22:28:39 +00:00
|
|
|
QDomNode getAnnotationPropertiesDomNode() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2013-04-05 22:28:39 +00:00
|
|
|
* Sets annotations internal properties according to the contents of @p node
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2013-04-05 22:28:39 +00:00
|
|
|
* @since 0.17 (KDE 4.11)
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2013-04-05 22:28:39 +00:00
|
|
|
void setAnnotationProperties(const QDomNode &node);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-05-04 20:24:12 +00:00
|
|
|
protected:
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2021-08-21 23:14:34 +00:00
|
|
|
explicit Annotation(AnnotationPrivate &dd);
|
2007-05-04 20:24:12 +00:00
|
|
|
Annotation(AnnotationPrivate &dd, const QDomNode &description);
|
|
|
|
Q_DECLARE_PRIVATE(Annotation)
|
|
|
|
AnnotationPrivate *d_ptr;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
private:
|
2006-12-18 13:32:45 +00:00
|
|
|
Q_DISABLE_COPY(Annotation)
|
2005-03-24 18:51:24 +00:00
|
|
|
};
|
|
|
|
|
2012-05-13 22:50:41 +00:00
|
|
|
/**
|
|
|
|
* @short Native annotation interface
|
|
|
|
*
|
|
|
|
* Generators can subclass it to provide native annotation support.
|
|
|
|
* Generators can use Annotation::setNativeId to store per-annotation data.
|
|
|
|
*
|
|
|
|
* @since 0.15 (KDE 4.9)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT AnnotationProxy
|
2012-05-13 22:50:41 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum Capability {
|
|
|
|
Addition, ///< Generator can create native annotations
|
|
|
|
Modification, ///< Generator can edit native annotations
|
|
|
|
Removal ///< Generator can remove native annotations
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2020-02-21 15:11:42 +00:00
|
|
|
AnnotationProxy();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-05-13 22:50:41 +00:00
|
|
|
/**
|
|
|
|
* Destroys the annotation proxy.
|
|
|
|
*/
|
|
|
|
virtual ~AnnotationProxy();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2020-02-21 15:11:42 +00:00
|
|
|
AnnotationProxy(const AnnotationProxy &) = delete;
|
|
|
|
AnnotationProxy &operator=(const AnnotationProxy &) = delete;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-05-13 22:50:41 +00:00
|
|
|
/**
|
|
|
|
* Query for the supported capabilities.
|
|
|
|
*/
|
|
|
|
virtual bool supports(Capability capability) const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-05-13 22:50:41 +00:00
|
|
|
/**
|
|
|
|
* Called when a new @p annotation is added to a @p page.
|
|
|
|
*
|
|
|
|
* @note Only called if supports(Addition) == true
|
|
|
|
*/
|
|
|
|
virtual void notifyAddition(Annotation *annotation, int page) = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-05-13 22:50:41 +00:00
|
|
|
/**
|
|
|
|
* Called after an existing @p annotation at a given @p page is modified.
|
2013-04-05 22:22:48 +00:00
|
|
|
*
|
2012-05-13 22:50:41 +00:00
|
|
|
* Generator can call @p annotation getters to get the new values.
|
2019-01-11 07:09:34 +00:00
|
|
|
* @p appearanceChanged tells if a non-visible property was modified
|
2012-05-13 22:50:41 +00:00
|
|
|
*
|
|
|
|
* @note Only called if supports(Modification) == true
|
|
|
|
*/
|
|
|
|
virtual void notifyModification(const Annotation *annotation, int page, bool appearanceChanged) = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-05-13 22:50:41 +00:00
|
|
|
/**
|
|
|
|
* Called when an existing @p annotation at a given @p page is removed.
|
|
|
|
*
|
|
|
|
* @note Only called if supports(Removal) == true
|
|
|
|
*/
|
|
|
|
virtual void notifyRemoval(Annotation *annotation, int page) = 0;
|
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT TextAnnotation : public Annotation
|
2006-12-11 07:59:02 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Describes the type of the text.
|
|
|
|
*/
|
|
|
|
enum TextType {
|
|
|
|
Linked, ///< The annotation is linked to a text
|
|
|
|
InPlace ///< The annotation is located next to the text
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Describes the style of the text.
|
|
|
|
*/
|
|
|
|
enum InplaceIntent {
|
|
|
|
Unknown, ///< Unknown style
|
|
|
|
Callout, ///< Callout style
|
|
|
|
TypeWriter ///< Type writer style
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new text annotation.
|
|
|
|
*/
|
|
|
|
TextAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new text annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit TextAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Destroys the text annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~TextAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the text @p type of the text annotation.
|
|
|
|
* @see TextType
|
|
|
|
*/
|
|
|
|
void setTextType(TextType type);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the text type of the text annotation.
|
|
|
|
*/
|
|
|
|
TextType textType() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p icon of the text annotation.
|
|
|
|
*/
|
|
|
|
void setTextIcon(const QString &icon);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the icon of the text annotation.
|
|
|
|
*/
|
|
|
|
QString textIcon() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p font of the text annotation.
|
|
|
|
*/
|
|
|
|
void setTextFont(const QFont &font);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the font of the text annotation.
|
|
|
|
*/
|
|
|
|
QFont textFont() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2018-10-03 14:31:40 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p color of inplace text.
|
|
|
|
*
|
|
|
|
* @since 1.6
|
|
|
|
*/
|
|
|
|
void setTextColor(const QColor &color);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2018-10-03 14:31:40 +00:00
|
|
|
/**
|
|
|
|
* Returns the color of inplace text.
|
|
|
|
*
|
|
|
|
* @since 1.6
|
|
|
|
*/
|
|
|
|
QColor textColor() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the inplace @p alignment of the text annotation.
|
2020-08-21 13:35:32 +00:00
|
|
|
* 0:left, 1:center, 2:right
|
2006-12-11 07:59:02 +00:00
|
|
|
*/
|
|
|
|
void setInplaceAlignment(int alignment);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the inplace alignment of the text annotation.
|
2020-08-21 13:35:32 +00:00
|
|
|
* 0:left, 1:center, 2:right
|
2006-12-11 07:59:02 +00:00
|
|
|
*/
|
|
|
|
int inplaceAlignment() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the inplace callout @p point at @p index.
|
|
|
|
*
|
|
|
|
* @p index must be between 0 and 2.
|
|
|
|
*/
|
|
|
|
void setInplaceCallout(const NormalizedPoint &point, int index);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the inplace callout point for @p index.
|
|
|
|
*
|
|
|
|
* @p index must be between 0 and 2.
|
|
|
|
*/
|
|
|
|
NormalizedPoint inplaceCallout(int index) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the transformed (e.g. rotated) inplace callout point for @p index.
|
|
|
|
*
|
|
|
|
* @p index must be between 0 and 2.
|
|
|
|
*/
|
|
|
|
NormalizedPoint transformedInplaceCallout(int index) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the inplace @p intent of the text annotation.
|
|
|
|
* @see InplaceIntent
|
|
|
|
*/
|
|
|
|
void setInplaceIntent(InplaceIntent intent);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the inplace intent of the text annotation.
|
|
|
|
*/
|
|
|
|
InplaceIntent inplaceIntent() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the text annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Stores the text annotation as xml in @p document under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
private:
|
2007-05-04 20:24:12 +00:00
|
|
|
Q_DECLARE_PRIVATE(TextAnnotation)
|
2006-12-18 13:32:45 +00:00
|
|
|
Q_DISABLE_COPY(TextAnnotation)
|
2005-03-24 18:51:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT LineAnnotation : public Annotation
|
2005-04-04 23:53:45 +00:00
|
|
|
{
|
2006-12-11 07:59:02 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Describes the line ending style.
|
|
|
|
*/
|
|
|
|
enum TermStyle {
|
|
|
|
Square, ///< Using a square
|
|
|
|
Circle, ///< Using a circle
|
|
|
|
Diamond, ///< Using a diamond
|
|
|
|
OpenArrow, ///< Using an open arrow
|
|
|
|
ClosedArrow, ///< Using a closed arrow
|
|
|
|
None, ///< No special ending style
|
|
|
|
Butt, ///< Using a butt ending
|
|
|
|
ROpenArrow, ///< Using an arrow opened at the right side
|
|
|
|
RClosedArrow, ///< Using an arrow closed at the right side
|
|
|
|
Slash ///< Using a slash
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Describes the line intent.
|
|
|
|
*/
|
|
|
|
enum LineIntent {
|
|
|
|
Unknown, ///< Unknown intent
|
|
|
|
Arrow, ///< Arrow intent
|
|
|
|
Dimension, ///< Dimension intent
|
|
|
|
PolygonCloud ///< Polygon cloud intent
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new line annotation.
|
|
|
|
*/
|
|
|
|
LineAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new line annotation from the xml @p description
|
|
|
|
*/
|
2007-01-04 15:22:28 +00:00
|
|
|
explicit LineAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Destroys the line annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~LineAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the normalized line @p points of the line annotation.
|
2022-03-19 00:00:01 +00:00
|
|
|
*
|
|
|
|
* @since 22.08
|
2006-12-11 07:59:02 +00:00
|
|
|
*/
|
2022-03-19 00:00:01 +00:00
|
|
|
void setLinePoints(const QList<NormalizedPoint> &points);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the normalized line points of the line annotation.
|
2022-03-19 00:00:01 +00:00
|
|
|
*
|
|
|
|
* @since 22.08
|
2006-12-11 07:59:02 +00:00
|
|
|
*/
|
2022-03-19 00:00:01 +00:00
|
|
|
QList<NormalizedPoint> linePoints() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the transformed (e.g. rotated) normalized line points
|
|
|
|
* of the line annotation.
|
2022-03-19 00:00:01 +00:00
|
|
|
*
|
|
|
|
* @since 22.08
|
2006-12-11 07:59:02 +00:00
|
|
|
*/
|
2022-03-19 00:00:01 +00:00
|
|
|
QList<NormalizedPoint> transformedLinePoints() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the line starting @p style of the line annotation.
|
|
|
|
* @see TermStyle
|
|
|
|
*/
|
|
|
|
void setLineStartStyle(TermStyle style);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the line starting style of the line annotation.
|
|
|
|
*/
|
|
|
|
TermStyle lineStartStyle() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the line ending @p style of the line annotation.
|
|
|
|
* @see TermStyle
|
|
|
|
*/
|
|
|
|
void setLineEndStyle(TermStyle style);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the line ending style of the line annotation.
|
|
|
|
*/
|
|
|
|
TermStyle lineEndStyle() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets whether the line shall be @p closed.
|
|
|
|
*/
|
|
|
|
void setLineClosed(bool closed);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the line shall be closed.
|
|
|
|
*/
|
|
|
|
bool lineClosed() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the inner line @p color of the line annotation.
|
|
|
|
*/
|
|
|
|
void setLineInnerColor(const QColor &color);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the inner line color of the line annotation.
|
|
|
|
*/
|
|
|
|
QColor lineInnerColor() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the leading forward @p point of the line annotation.
|
|
|
|
*/
|
|
|
|
void setLineLeadingForwardPoint(double point);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the leading forward point of the line annotation.
|
|
|
|
*/
|
|
|
|
double lineLeadingForwardPoint() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the leading backward @p point of the line annotation.
|
|
|
|
*/
|
|
|
|
void setLineLeadingBackwardPoint(double point);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the leading backward point of the line annotation.
|
|
|
|
*/
|
|
|
|
double lineLeadingBackwardPoint() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets whether the caption shall be @p shown.
|
|
|
|
*/
|
|
|
|
void setShowCaption(bool shown);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the caption shall be shown.
|
|
|
|
*/
|
|
|
|
bool showCaption() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the line @p intent of the line annotation.
|
|
|
|
* @see LineIntent
|
|
|
|
*/
|
|
|
|
void setLineIntent(LineIntent intent);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the line intent of the line annotation.
|
|
|
|
*/
|
|
|
|
LineIntent lineIntent() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the line annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Stores the line annotation as xml in @p document under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
private:
|
2007-05-04 20:24:12 +00:00
|
|
|
Q_DECLARE_PRIVATE(LineAnnotation)
|
2006-12-18 13:32:45 +00:00
|
|
|
Q_DISABLE_COPY(LineAnnotation)
|
2005-03-24 18:51:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT GeomAnnotation : public Annotation
|
2005-04-04 23:53:45 +00:00
|
|
|
{
|
2006-12-11 07:59:02 +00:00
|
|
|
public:
|
|
|
|
// common enums
|
|
|
|
enum GeomType {
|
|
|
|
InscribedSquare, ///< Draw a square
|
|
|
|
InscribedCircle ///< Draw a circle
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new geometrical annotation.
|
|
|
|
*/
|
|
|
|
GeomAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new geometrical annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit GeomAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Destroys the geometrical annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~GeomAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the geometrical @p type of the geometrical annotation.
|
|
|
|
* @see GeomType
|
|
|
|
*/
|
|
|
|
void setGeometricalType(GeomType type);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the geometrical type of the geometrical annotation.
|
|
|
|
*/
|
|
|
|
GeomType geometricalType() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the inner @p color of the geometrical annotation.
|
|
|
|
*/
|
|
|
|
void setGeometricalInnerColor(const QColor &color);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the inner color of the geometrical annotation.
|
|
|
|
*/
|
|
|
|
QColor geometricalInnerColor() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the geometrical annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Stores the geometrical annotation as xml in @p document
|
|
|
|
* under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
private:
|
2007-05-04 20:24:12 +00:00
|
|
|
Q_DECLARE_PRIVATE(GeomAnnotation)
|
2006-12-18 13:32:45 +00:00
|
|
|
Q_DISABLE_COPY(GeomAnnotation)
|
2005-03-24 18:51:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT HighlightAnnotation : public Annotation
|
2005-04-04 23:53:45 +00:00
|
|
|
{
|
2020-07-10 22:15:05 +00:00
|
|
|
public:
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Describes the highlighting style of the annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-11 07:59:02 +00:00
|
|
|
enum HighlightType {
|
|
|
|
Highlight, ///< Highlights the text
|
|
|
|
Squiggly, ///< Squiggles the text
|
|
|
|
Underline, ///< Underlines the text
|
|
|
|
StrikeOut ///< Strikes out the text
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Creates a new highlight annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-11 07:59:02 +00:00
|
|
|
HighlightAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Creates a new highlight annotation from the xml @p description
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2007-01-04 15:22:28 +00:00
|
|
|
explicit HighlightAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Destroys the highlight annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~HighlightAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Sets the @p type of the highlight annotation.
|
|
|
|
* @see HighlightType
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-11 07:59:02 +00:00
|
|
|
void setHighlightType(HighlightType type);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns the type of the highlight annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-11 07:59:02 +00:00
|
|
|
HighlightType highlightType() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2019-07-21 17:59:58 +00:00
|
|
|
* @short Describes a highlight quad of a text markup annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2019-07-21 17:59:58 +00:00
|
|
|
* The Quad is a closed path of 4 NormalizedPoints.
|
|
|
|
* Another set of 4 NormalizedPoints can be generated with transform(),
|
|
|
|
* e. g. to get highlighting coordinates on a rotated PageViewItem.
|
|
|
|
* Additionally, Quad stores some geometry related style attributes.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2019-07-21 17:59:58 +00:00
|
|
|
* To enable correct rendering of the annotation,
|
|
|
|
* the points 0 and 1 must describe the bottom edge of the quad
|
|
|
|
* (relative to the text orientation).
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2019-07-21 17:59:58 +00:00
|
|
|
* @see NormalizedPoint
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Quad
|
2020-07-10 22:15:05 +00:00
|
|
|
{
|
2006-12-11 07:59:02 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new quad.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
Quad();
|
2006-12-11 07:59:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the quad.
|
|
|
|
*/
|
|
|
|
~Quad();
|
|
|
|
|
|
|
|
Quad(const Quad &other);
|
|
|
|
Quad &operator=(const Quad &other);
|
|
|
|
|
|
|
|
/**
|
2019-07-21 17:59:58 +00:00
|
|
|
* Sets the normalized @p point at @p index.
|
|
|
|
*
|
|
|
|
* @p index must be between 0 and 3.
|
2006-12-11 07:59:02 +00:00
|
|
|
*/
|
|
|
|
void setPoint(const NormalizedPoint &point, int index);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the normalized point at @p index.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2006-12-11 07:59:02 +00:00
|
|
|
* @p index must be between 0 and 3.
|
|
|
|
*/
|
|
|
|
NormalizedPoint point(int index) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the transformed (e.g. rotated) normalized point at @p index.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2006-12-11 07:59:02 +00:00
|
|
|
* @p index must be between 0 and 3.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
NormalizedPoint transformedPoint(int index) const;
|
2006-12-11 07:59:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether a cap should be used at the start.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void setCapStart(bool value);
|
2005-03-24 18:51:24 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns whether a cap should be used at the start.
|
|
|
|
*/
|
|
|
|
bool capStart() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether a cap should be used at the end.
|
|
|
|
*/
|
2007-01-04 15:22:28 +00:00
|
|
|
void setCapEnd(bool value);
|
2006-12-11 07:59:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether a cap should be used at the end.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
bool capEnd() const;
|
2006-12-11 07:59:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p width of the drawing feather.
|
|
|
|
*/
|
|
|
|
void setFeather(double width);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the width of the drawing feather.
|
|
|
|
*/
|
|
|
|
double feather() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Transforms the quad coordinates with the transformation defined
|
|
|
|
* by @p matrix.
|
2020-07-10 22:15:05 +00:00
|
|
|
*
|
2019-07-21 17:59:58 +00:00
|
|
|
* The transformed coordinates will be accessible with transformedPoint().
|
2006-12-11 07:59:02 +00:00
|
|
|
* The coordinates returned by point() are not affected.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void transform(const QTransform &matrix);
|
2006-12-11 07:59:02 +00:00
|
|
|
|
|
|
|
private:
|
2006-12-18 07:28:02 +00:00
|
|
|
class Private;
|
|
|
|
Private *const d;
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-09-27 10:43:06 +00:00
|
|
|
* Returns a reference to the quad list of the highlight annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2006-12-11 07:59:02 +00:00
|
|
|
QList<Quad> &highlightQuads();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2020-09-16 23:27:14 +00:00
|
|
|
/**
|
|
|
|
* Returns a const reference to the quad list of the highlight annotation.
|
|
|
|
* @since 20.12
|
|
|
|
*/
|
|
|
|
const QList<Quad> &highlightQuads() const;
|
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
/**
|
2008-04-05 14:46:07 +00:00
|
|
|
* Returns the sub type of the highlight annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2007-05-04 20:24:12 +00:00
|
|
|
* Stores the highlight annotation as xml in @p document
|
|
|
|
* under the given parent @p node.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
private:
|
2007-05-04 20:24:12 +00:00
|
|
|
Q_DECLARE_PRIVATE(HighlightAnnotation)
|
2006-12-18 13:32:45 +00:00
|
|
|
Q_DISABLE_COPY(HighlightAnnotation)
|
2005-03-24 18:51:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT StampAnnotation : public Annotation
|
2005-04-04 23:53:45 +00:00
|
|
|
{
|
2006-12-11 07:59:02 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new stamp annotation.
|
|
|
|
*/
|
|
|
|
StampAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a new stamp annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit StampAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Destroys the stamp annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~StampAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p name of the icon for the stamp annotation.
|
|
|
|
*/
|
|
|
|
void setStampIconName(const QString &name);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the name of the icon.
|
|
|
|
*/
|
|
|
|
QString stampIconName() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the stamp annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
/**
|
|
|
|
* Stores the stamp annotation as xml in @p document
|
|
|
|
* under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
private:
|
2007-05-04 20:24:12 +00:00
|
|
|
Q_DECLARE_PRIVATE(StampAnnotation)
|
2017-03-02 19:38:50 +00:00
|
|
|
Q_DISABLE_COPY(StampAnnotation)
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
2006-12-11 07:59:02 +00:00
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT InkAnnotation : public Annotation
|
2020-07-10 22:15:05 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-04-05 14:46:07 +00:00
|
|
|
* Creates a new ink annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2007-05-04 20:24:12 +00:00
|
|
|
InkAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-05 14:46:07 +00:00
|
|
|
* Creates a new ink annotation from the xml @p description
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2008-04-05 14:46:07 +00:00
|
|
|
explicit InkAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-05 14:46:07 +00:00
|
|
|
* Destroys the ink annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~InkAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the @p paths of points for the ink annotation.
|
2022-03-19 00:00:01 +00:00
|
|
|
*
|
|
|
|
* @since 22.08
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2022-03-19 00:00:01 +00:00
|
|
|
void setInkPaths(const QList<QList<NormalizedPoint>> &paths);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns the paths of points of the ink annotation.
|
2022-03-19 00:00:01 +00:00
|
|
|
*
|
|
|
|
* @since 22.08
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2022-03-19 00:00:01 +00:00
|
|
|
QList<QList<NormalizedPoint>> inkPaths() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Returns the paths of transformed (e.g. rotated) points of
|
|
|
|
* the ink annotation.
|
2022-03-19 00:00:01 +00:00
|
|
|
*
|
|
|
|
* @since 22.08
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2022-03-19 00:00:01 +00:00
|
|
|
QList<QList<NormalizedPoint>> transformedInkPaths() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-05 14:46:07 +00:00
|
|
|
* Returns the sub type of the ink annotation.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
|
|
|
/**
|
2006-12-11 07:59:02 +00:00
|
|
|
* Stores the ink annotation as xml in @p document
|
|
|
|
* under the given parent @p node.
|
2020-07-10 22:15:05 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2006-12-11 07:59:02 +00:00
|
|
|
private:
|
2007-05-04 20:24:12 +00:00
|
|
|
Q_DECLARE_PRIVATE(InkAnnotation)
|
2006-12-18 13:32:45 +00:00
|
|
|
Q_DISABLE_COPY(InkAnnotation)
|
2005-03-24 18:51:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT CaretAnnotation : public Annotation
|
2008-04-05 14:46:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-04-06 10:27:46 +00:00
|
|
|
/**
|
|
|
|
* Describes the highlighting style of the annotation.
|
|
|
|
*/
|
|
|
|
enum CaretSymbol {
|
|
|
|
None, ///< No symbol to be associated with the text
|
|
|
|
P ///< A 'paragraph' symbol
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Creates a new caret annotation.
|
|
|
|
*/
|
|
|
|
CaretAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Creates a new caret annotation from the xml @p description
|
|
|
|
*/
|
|
|
|
explicit CaretAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Destroys the caret annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~CaretAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p symbol for the caret annotation.
|
|
|
|
*/
|
2008-04-06 10:27:46 +00:00
|
|
|
void setCaretSymbol(CaretAnnotation::CaretSymbol symbol);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Returns the symbol of the annotation.
|
|
|
|
*/
|
2008-04-06 10:27:46 +00:00
|
|
|
CaretAnnotation::CaretSymbol caretSymbol() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the caret annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
/**
|
|
|
|
* Stores the caret annotation as xml in @p document
|
|
|
|
* under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-05 14:46:07 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(CaretAnnotation)
|
|
|
|
Q_DISABLE_COPY(CaretAnnotation)
|
|
|
|
};
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT FileAttachmentAnnotation : public Annotation
|
2008-04-13 16:34:33 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new file attachment annotation.
|
|
|
|
*/
|
|
|
|
FileAttachmentAnnotation();
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Creates a new file attachment annotation from the xml @p description
|
|
|
|
*/
|
|
|
|
explicit FileAttachmentAnnotation(const QDomNode &description);
|
2008-04-13 16:34:33 +00:00
|
|
|
/**
|
|
|
|
* Destroys the file attachment annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~FileAttachmentAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Gets the name of the icon.
|
|
|
|
*/
|
2008-04-13 16:34:33 +00:00
|
|
|
QString fileIconName() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the @p iconName of the icon for the file attachment annotation.
|
2008-04-13 20:11:50 +00:00
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
void setFileIconName(const QString &iconName);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Gets the embedded file object.
|
|
|
|
*/
|
2008-04-13 16:34:33 +00:00
|
|
|
EmbeddedFile *embeddedFile() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 16:34:33 +00:00
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the @p ef representing the embedded file of the file
|
2008-04-13 20:11:50 +00:00
|
|
|
* attachment annotation.
|
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
void setEmbeddedFile(EmbeddedFile *ef);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the file attachment annotation.
|
2008-04-13 16:34:33 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 16:34:33 +00:00
|
|
|
/**
|
2008-04-13 20:11:50 +00:00
|
|
|
* Stores the file attachment annotation as xml in @p document
|
2008-04-13 16:34:33 +00:00
|
|
|
* under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 16:34:33 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(FileAttachmentAnnotation)
|
|
|
|
Q_DISABLE_COPY(FileAttachmentAnnotation)
|
|
|
|
};
|
|
|
|
|
2008-04-13 20:00:06 +00:00
|
|
|
/**
|
|
|
|
* \short Sound annotation.
|
|
|
|
*
|
|
|
|
* The sound annotation represents a sound to be played when activated.
|
2008-04-13 20:11:50 +00:00
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
2008-04-13 20:00:06 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT SoundAnnotation : public Annotation
|
2008-04-13 20:00:06 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new sound annotation.
|
|
|
|
*/
|
|
|
|
SoundAnnotation();
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Creates a new sound annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit SoundAnnotation(const QDomNode &description);
|
2008-04-13 20:00:06 +00:00
|
|
|
/**
|
|
|
|
* Destroys the sound annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~SoundAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Gets the name of the icon.
|
|
|
|
*/
|
2008-04-13 20:00:06 +00:00
|
|
|
QString soundIconName() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the @p iconName of the icon for the sound annotation.
|
2008-04-13 20:11:50 +00:00
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
void setSoundIconName(const QString &iconName);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
|
|
|
* Gets the sound object.
|
|
|
|
*/
|
2008-04-13 20:00:06 +00:00
|
|
|
Sound *sound() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:11:50 +00:00
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the @p s representing the sound of the file
|
2008-04-13 20:11:50 +00:00
|
|
|
* attachment annotation.
|
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
void setSound(Sound *s);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:00:06 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the sound annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:00:06 +00:00
|
|
|
/**
|
|
|
|
* Stores the sound annotation as xml in @p document
|
|
|
|
* under the given parent @p node.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &node, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-04-13 20:00:06 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(SoundAnnotation)
|
|
|
|
Q_DISABLE_COPY(SoundAnnotation)
|
|
|
|
};
|
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* \short Movie annotation.
|
|
|
|
*
|
|
|
|
* The movie annotation represents a movie to be played when activated.
|
|
|
|
*
|
|
|
|
* @since 0.8 (KDE 4.2)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT MovieAnnotation : public Annotation
|
2008-08-23 00:07:59 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new movie annotation.
|
|
|
|
*/
|
|
|
|
MovieAnnotation();
|
|
|
|
/**
|
|
|
|
* Creates a new movie annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit MovieAnnotation(const QDomNode &description);
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Destroys the movie annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~MovieAnnotation() override;
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Gets the movie object.
|
|
|
|
*/
|
|
|
|
Movie *movie() const;
|
|
|
|
/**
|
|
|
|
* Sets the new @p movie object.
|
|
|
|
*/
|
|
|
|
void setMovie(Movie *movie);
|
|
|
|
/**
|
|
|
|
* Returns the sub type of the movie annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Stores the movie annotation as xml in @p document
|
|
|
|
* under the given @p parentNode.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &parentNode, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(MovieAnnotation)
|
|
|
|
Q_DISABLE_COPY(MovieAnnotation)
|
|
|
|
};
|
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* \short Screen annotation.
|
|
|
|
*
|
|
|
|
* The screen annotation specifies a region of a page upon which media clips
|
|
|
|
* may be played. It also serves as an object from which actions can be triggered.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT ScreenAnnotation : public Annotation
|
2012-08-16 09:53:58 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new screen annotation.
|
|
|
|
*/
|
|
|
|
ScreenAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Creates a new screen annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit ScreenAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Destroys the screen annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~ScreenAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the screen annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Stores the screen annotation as xml in @p document
|
|
|
|
* under the given @p parentNode.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &parentNode, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-09-27 10:43:06 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p action that is executed when the annotation is triggered.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
void setAction(Action *action);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-09-27 10:43:06 +00:00
|
|
|
/**
|
|
|
|
* Returns the action that is executed when the annotation is triggered or @c 0 if not action has been defined.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
Action *action() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Sets the additional @p action of the given @p type.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
void setAdditionalAction(AdditionalActionType type, Action *action);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Returns the additional action of the given @p type or @c 0 if no action has been defined.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
Action *additionalAction(AdditionalActionType type) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(ScreenAnnotation)
|
|
|
|
Q_DISABLE_COPY(ScreenAnnotation)
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \short Widget annotation.
|
|
|
|
*
|
|
|
|
* The widget annotation represents a widget on a page.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT WidgetAnnotation : public Annotation
|
2012-08-16 09:53:58 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new widget annotation.
|
|
|
|
*/
|
|
|
|
WidgetAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Creates a new widget annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit WidgetAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Destroys the widget annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~WidgetAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the widget annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Stores the widget annotation as xml in @p document
|
|
|
|
* under the given @p parentNode.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &parentNode, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Sets the additional @p action of the given @p type.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
void setAdditionalAction(AdditionalActionType type, Action *action);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
/**
|
|
|
|
* Returns the additional action of the given @p type or @c 0 if no action has been defined.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
Action *additionalAction(AdditionalActionType type) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-08-16 09:53:58 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(WidgetAnnotation)
|
|
|
|
Q_DISABLE_COPY(WidgetAnnotation)
|
|
|
|
};
|
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* \short RichMedia annotation.
|
|
|
|
*
|
|
|
|
* The rich media annotation represents an video or sound on a page.
|
|
|
|
*
|
|
|
|
* @since 1.0
|
|
|
|
*/
|
|
|
|
class OKULARCORE_EXPORT RichMediaAnnotation : public Annotation
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new rich media annotation.
|
|
|
|
*/
|
|
|
|
RichMediaAnnotation();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Creates a new rich media annotation from the xml @p description
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit RichMediaAnnotation(const QDomNode &description);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Destroys the rich media annotation.
|
|
|
|
*/
|
2019-12-18 11:51:13 +00:00
|
|
|
~RichMediaAnnotation() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Returns the sub type of the rich media annotation.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
SubType subType() const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Stores the rich media annotation as xml in @p document
|
|
|
|
* under the given @p parentNode.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
void store(QDomNode &parentNode, QDomDocument &document) const override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Gets the movie object.
|
|
|
|
*/
|
|
|
|
Movie *movie() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Sets the new @p movie object.
|
|
|
|
*/
|
|
|
|
void setMovie(Movie *movie);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
2019-12-20 15:40:59 +00:00
|
|
|
* Sets the @p embeddedFile representing the embedded file.
|
2015-08-04 09:11:29 +00:00
|
|
|
*/
|
2019-12-20 15:40:59 +00:00
|
|
|
void setEmbeddedFile(EmbeddedFile *embeddedFile);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
/**
|
|
|
|
* Gets the embedded file object.
|
|
|
|
*/
|
|
|
|
EmbeddedFile *embeddedFile() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-08-04 09:11:29 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(RichMediaAnnotation)
|
|
|
|
Q_DISABLE_COPY(RichMediaAnnotation)
|
|
|
|
};
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2005-02-12 17:42:54 +00:00
|
|
|
#endif
|