okular
annotations.cpp
Go to the documentation of this file.
34 static bool isLeftOfVector( const NormalizedPoint& a, const NormalizedPoint& b, const NormalizedPoint& c )
45 static double distanceSqr( double x, double y, double xScale, double yScale, const QLinkedList<NormalizedPoint>& path )
157 const QRect rect = ann->transformedBoundingRectangle().geometry( (int)scaledWidth, (int)scaledHeight );
158 if ( ann->subType() == Annotation::AText && ( ( (TextAnnotation*)ann )->textType() == TextAnnotation::Linked ) )
503 QLinkedList< Annotation::Revision >::iterator it = m_revisions.begin(), end = m_revisions.end();
744 if ( d->m_style.width() != 1 || d->m_style.lineStyle() != Solid || d->m_style.xCorners() != 0 ||
786 QLinkedList< Revision >::const_iterator it = d->m_revisions.begin(), end = d->m_revisions.end();
1451 QLinkedList<NormalizedPoint>::const_iterator it = d->m_linePoints.begin(), end = d->m_linePoints.end();
1928 QList< Quad >::const_iterator it = d->m_highlightQuads.begin(), end = d->m_highlightQuads.end();
2000 q.setPoint( NormalizedPoint( qe.attribute( "ax", "0.0" ).toDouble(), qe.attribute( "ay", "0.0" ).toDouble() ), 0 );
2001 q.setPoint( NormalizedPoint( qe.attribute( "bx", "0.0" ).toDouble(), qe.attribute( "by", "0.0" ).toDouble() ), 1 );
2002 q.setPoint( NormalizedPoint( qe.attribute( "cx", "0.0" ).toDouble(), qe.attribute( "cy", "0.0" ).toDouble() ), 2 );
2003 q.setPoint( NormalizedPoint( qe.attribute( "dx", "0.0" ).toDouble(), qe.attribute( "dy", "0.0" ).toDouble() ), 3 );
2023 double HighlightAnnotationPrivate::distanceSqr( double x, double y, double xScale, double yScale )
2032 //this is the case, if the point is always on one side of each segments delimiting the polygon:
2215 QList< QLinkedList<NormalizedPoint> >::const_iterator pIt = d->m_inkPaths.begin(), pEnd = d->m_inkPaths.end();
void setLineStartStyle(TermStyle style)
Sets the line starting style of the line annotation.
Definition: annotations.cpp:1318
QDateTime modificationDate() const
Returns the last modification date of the annotation.
Definition: annotations.cpp:569
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
void setUniqueName(const QString &name)
Sets the unique name of the annotation.
Definition: annotations.cpp:551
Definition: page_p.h:44
static QDomElement findChildElement(const QDomNode &parentNode, const QString &name)
Returns the child element with the given name from the direct children of parentNode or a null elemen...
Definition: annotations.cpp:138
The Revision class contains all information about the revision of the annotation. ...
Definition: annotations.h:535
Definition: annotations.h:1315
NormalizedPoint inplaceCallout(int index) const
Returns the inplace callout point for index.
Definition: annotations.cpp:1075
void setAction(Action *action)
Sets the action that is executed when the annotation is triggered.
Definition: annotations.cpp:2838
Definition: page_p.h:55
SubType subType() const
Returns the sub type of the highlight annotation.
Definition: annotations.cpp:1950
void setTextFont(const QFont &font)
Sets the font of the text annotation.
Definition: annotations.cpp:1042
double lineLeadingForwardPoint() const
Returns the leading forward point of the line annotation.
Definition: annotations.cpp:1372
QDomNode appendChild(const QDomNode &newChild)
void append(const T &value)
SubType subType() const
Returns the sub type of the geometrical annotation.
Definition: annotations.cpp:1637
QString attribute(const QString &name, const QString &defValue) const
QDateTime creationDate() const
Returns the creation date of the annotation.
Definition: annotations.cpp:581
QString data() const
QColor geometricalInnerColor() const
Returns the inner color of the geometrical annotation.
Definition: annotations.cpp:1631
void transform(const QTransform &matrix)
Transforms the normalized rectangle with the operations defined by matrix.
Definition: area.cpp:259
void setSound(Sound *object)
Sets the object representing the sound of the file attachment annotation.
Definition: annotations.cpp:2651
void setLineClosed(bool closed)
Sets whether the line shall be closed.
Definition: annotations.cpp:1342
iterator begin()
QVariant nativeId() const
Returns the "native" id of the annotation.
Definition: annotations.cpp:681
void store(QDomNode &node, QDomDocument &document) const
Stores the file attachment annotation as xml in document under the given parent node.
Definition: annotations.cpp:2519
void store(QDomNode &node, QDomDocument &document) const
Stores the caret annotation as xml in document under the given parent node.
Definition: annotations.cpp:2445
Is being moved (mouse drag and drop). If ExternallyDrawn, the generator must not draw it...
Definition: annotations.h:136
SubType subType() const
Returns the sub type of the sound annotation.
Definition: annotations.cpp:2628
bool isElement() const
static CaretAnnotation::CaretSymbol caretSymbolFromString(const QString &symbol)
Definition: annotations.cpp:2378
void setGeometricalType(GeomType type)
Sets the geometrical type of the geometrical annotation.
Definition: annotations.cpp:1613
virtual void resetTransformation()
Definition: annotations.cpp:857
void setLineEffect(LineEffect effect)
Sets the line effect of the style.
Definition: annotations.cpp:303
QList< QLinkedList< NormalizedPoint > > transformedInkPaths() const
Returns the paths of transformed (e.g.
Definition: annotations.cpp:2190
void setHighlightType(HighlightType type)
Sets the type of the highlight annotation.
Definition: annotations.cpp:1894
bool showCaption() const
Returns whether the caption shall be shown.
Definition: annotations.cpp:1396
void setDisposeDataFunction(DisposeDataFunction func)
Sets a function to be called when the annotation is destroyed.
Definition: annotations.cpp:687
SubType subType() const
Returns the sub type of the movie annotation.
Definition: annotations.cpp:2725
void setModificationDate(const QDateTime &date)
Sets the last modification date of the annotation.
Definition: annotations.cpp:563
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
SubType subType() const
Returns the sub type of the screen annotation.
Definition: annotations.cpp:2815
QDomCDATASection toCDATASection() const
void store(QDomNode &node, QDomDocument &document) const
Stores the sound annotation as xml in document under the given parent node.
Definition: annotations.cpp:2618
Style & style()
Returns a reference to the style object of the annotation.
Definition: annotations.cpp:639
T & back()
void setCapEnd(bool value)
Sets whether a cap should be used at the end.
Definition: annotations.cpp:1833
void setCaretSymbol(CaretAnnotation::CaretSymbol symbol)
Sets the symbol for the caret annotation.
Definition: annotations.cpp:2428
virtual AnnotationPrivate * getNewAnnotationPrivate()=0
QLinkedList< NormalizedPoint > linePoints() const
Returns the normalized line points of the line annotation.
Definition: annotations.cpp:1306
void store(QDomNode &parentNode, QDomDocument &document) const
Stores the screen annotation as xml in document under the given parentNode.
Definition: annotations.cpp:2805
void annotationTransform(const QTransform &matrix)
Transforms the annotation coordinates with the transformation defined by matrix.
Definition: annotations.cpp:841
virtual ~AnnotationPrivate()
Definition: annotations.cpp:497
void store(QDomNode &node, QDomDocument &document) const
Stores the line annotation as xml in document under the given parent node.
Definition: annotations.cpp:1419
Action * additionalAction(AdditionalActionType type) const
Returns the additional action of the given type or 0 if no action has been defined.
Definition: annotations.cpp:2829
#define ADD_COORD(c1, c2)
SubType subType() const
Returns the sub type of the stamp annotation.
Definition: annotations.cpp:2095
double toDouble(bool *ok) const
virtual void setAnnotationProperties(const QDomNode &node)
Definition: annotations.cpp:875
bool capEnd() const
Returns whether a cap should be used at the end.
Definition: annotations.cpp:1838
void setContents(const QString &contents)
Sets the contents of the annotation.
Definition: annotations.cpp:539
iterator end()
void setLineInnerColor(const QColor &color)
Sets the inner line color of the line annotation.
Definition: annotations.cpp:1354
TextType textType() const
Returns the text type of the text annotation.
Definition: annotations.cpp:1024
Definition: annotations.h:1078
void setStampIconName(const QString &name)
Sets the name of the icon for the stamp annotation.
Definition: annotations.cpp:2083
Definition: annotations_p.h:28
Definition: annotations.h:856
NormalizedRect m_transformedBoundary
Definition: annotations_p.h:66
The Window class contains all information about the popup window of the annotation that is used to ed...
Definition: annotations.h:440
QColor lineInnerColor() const
Returns the inner line color of the line annotation.
Definition: annotations.cpp:1360
QDomNode nextSibling() const
Definition: annotations.h:1221
HighlightType highlightType() const
Returns the type of the highlight annotation.
Definition: annotations.cpp:1900
virtual bool openDialogAfterCreation() const
Definition: annotations.cpp:870
QDomElement toElement() const
int count(const T &value) const
static QRect annotationGeometry(const Annotation *annotation, double scaleX, double scaleY)
Returns the geometry of the given annotation scaled by scaleX and scaleY.
Definition: annotations.cpp:154
void setCapStart(bool value)
Sets whether a cap should be used at the start.
Definition: annotations.cpp:1823
void setAdditionalAction(AdditionalActionType type, Action *action)
Sets the additional action of the given type.
Definition: annotations.cpp:2921
void store(QDomNode &parentNode, QDomDocument &document) const
Stores the movie annotation as xml in document under the given parentNode.
Definition: annotations.cpp:2715
TermStyle lineStartStyle() const
Returns the line starting style of the line annotation.
Definition: annotations.cpp:1324
Action * action() const
Returns the action that is executed when the annotation is triggered or 0 if not action has been defi...
Definition: annotations.cpp:2846
void translate(const NormalizedPoint &coord)
Move the annotation by the specified coordinates.
Definition: annotations.cpp:622
FileAttachmentAnnotation()
Creates a new file attachment annotation.
Definition: annotations.cpp:2505
QFont font()
QString number(int n, int base)
void setNativeId(const QVariant &id)
Sets the "native" id of the annotation.
Definition: annotations.cpp:675
Action * additionalAction(AdditionalActionType type) const
Returns the additional action of the given type or 0 if no action has been defined.
Definition: annotations.cpp:2930
InplaceIntent inplaceIntent() const
Returns the inplace intent of the text annotation.
Definition: annotations.cpp:1099
SubType subType() const
Returns the sub type of the file attachment annotation.
Definition: annotations.cpp:2529
void(* DisposeDataFunction)(const Okular::Annotation *)
A function to be called when the annotation is destroyed.
Definition: annotations.h:203
Definition: annotations.h:1016
void setLineIntent(LineIntent intent)
Sets the line intent of the line annotation.
Definition: annotations.cpp:1402
GeomType geometricalType() const
Returns the geometrical type of the geometrical annotation.
Definition: annotations.cpp:1619
bool capStart() const
Returns whether a cap should be used at the start.
Definition: annotations.cpp:1828
bool hasAttribute(const QString &name) const
void setPoint(const NormalizedPoint &point, int index)
Sets the normalized point at index.
Definition: annotations.cpp:1799
static double distanceSqr(double x, double y, double xScale, double yScale, const QLinkedList< NormalizedPoint > &path)
Calculates distance of the given point x y xScale yScale to the path.
Definition: annotations.cpp:45
void setTextType(TextType type)
Sets the text type of the text annotation.
Definition: annotations.cpp:1018
void transform(const QTransform &matrix)
Transforms the quad coordinates with the transformation defined by matrix.
Definition: annotations.cpp:1853
virtual SubType subType() const =0
Returns the sub type of the annotation.
QDomNode getAnnotationPropertiesDomNode() const
Retrieve the QDomNode representing this annotation's properties.
Definition: annotations.cpp:801
void setEffectIntensity(double intensity)
Sets the effect intensity of the style.
Definition: annotations.cpp:313
void setInkPaths(const QList< QLinkedList< NormalizedPoint > > &paths)
Sets the paths of points for the ink annotation.
Definition: annotations.cpp:2178
void setAuthor(const QString &author)
Sets the author of the annotation.
Definition: annotations.cpp:527
void setAttribute(const QString &name, const QString &value)
virtual ~FileAttachmentAnnotation()
Destroys the file attachment annotation.
Definition: annotations.cpp:2515
Okular::Annotation::Window m_window
Definition: annotations_p.h:69
int toInt(bool *ok, int base) const
virtual void baseTransform(const QTransform &matrix)
Definition: annotations.cpp:852
static bool isLeftOfVector(const NormalizedPoint &a, const NormalizedPoint &b, const NormalizedPoint &c)
True, if point c lies to the left of the vector from a to b.
Definition: annotations.cpp:34
static QString caretSymbolToString(CaretAnnotation::CaretSymbol symbol)
Definition: annotations.cpp:2366
void setTopLeft(const NormalizedPoint &point)
Sets the top-left point of the window.
Definition: annotations.cpp:374
Quad & operator=(const Quad &other)
Definition: annotations.cpp:1791
double distanceSqr(double x, double y, double xScale, double yScale) const
Returns the distance of the point x y xScale yScale to the closest edge or 0 if the point is within t...
Definition: area.h:286
void store(QDomNode &node, QDomDocument &document) const
Stores the highlight annotation as xml in document under the given parent node.
Definition: annotations.cpp:1912
SubType subType() const
Returns the sub type of the ink annotation.
Definition: annotations.cpp:2196
static void storeAnnotation(const Annotation *annotation, QDomElement &element, QDomDocument &document)
Saves the annotation as a child of element taking care of saving all revisions if it has any...
Definition: annotations.cpp:128
void setSoundIconName(const QString &name)
Sets the name of the icon for the sound annotation.
Definition: annotations.cpp:2639
void setFileIconName(const QString &name)
Sets the name of the icon for the file attachment annotation.
Definition: annotations.cpp:2540
void setAnnotation(Annotation *annotation)
Sets the annotation the revision belongs to.
Definition: annotations.cpp:461
bool containsPoint(const QPointF &point, Qt::FillRule fillRule) const
SubType subType() const
Returns the sub type of the caret annotation.
Definition: annotations.cpp:2440
void setGeometricalInnerColor(const QColor &color)
Sets the inner color of the geometrical annotation.
Definition: annotations.cpp:1625
Definition: annotations.h:1265
void setShowCaption(bool shown)
Sets whether the caption shall be shown.
Definition: annotations.cpp:1390
double distanceSqr(double x, double y, double xScale, double yScale) const
Returns squared distance to point x y xScale yScale.
Definition: area.cpp:52
QRect geometry(int xScale, int yScale) const
Returns the rectangle that accrues when the normalized rectangle is multiplyed with the scaling xScal...
Definition: area.cpp:239
void setInplaceIntent(InplaceIntent intent)
Returns the inplace intent of the text annotation.
Definition: annotations.cpp:1093
Is drawn externally (by the generator which provided it)
Definition: annotations.h:135
LineIntent lineIntent() const
Returns the line intent of the line annotation.
Definition: annotations.cpp:1408
static double strokeDistance(double distance, double penWidth)
Given the squared distance from the idealized 0-width line and a pen width penWidth, (not squared!), returns the final distance.
Definition: annotations.cpp:84
void setLineEndStyle(TermStyle style)
Sets the line ending style of the line annotation.
Definition: annotations.cpp:1330
QDateTime fromString(const QString &string, Qt::DateFormat format)
const_iterator constBegin() const
void store(QDomNode &parentNode, QDomDocument &document) const
Stores the widget annotation as xml in document under the given parentNode.
Definition: annotations.cpp:2906
virtual double distanceSqr(double x, double y, double xScale, double yScale)
Determines the distance of the closest point of the annotation to the given point x y xScale yScale...
Definition: annotations.cpp:836
bool isNull() const
const_iterator constEnd() const
void store(QDomNode &node, QDomDocument &document) const
Stores the ink annotation as xml in document under the given parent node.
Definition: annotations.cpp:2201
SubType subType() const
Returns the sub type of the widget annotation.
Definition: annotations.cpp:2916
QList< Quad > & highlightQuads()
Returns a reference to the quad list of the highlight annotation.
Definition: annotations.cpp:1906
void setLineLeadingBackwardPoint(double point)
Sets the leading backward point of the line annotation.
Definition: annotations.cpp:1378
Window & window()
Returns a reference to the window object of the annotation.
Definition: annotations.cpp:651
double lineLeadingBackwardPoint() const
Returns the leading backward point of the line annotation.
Definition: annotations.cpp:1384
QLinkedList< NormalizedPoint > transformedLinePoints() const
Returns the transformed (e.g.
Definition: annotations.cpp:1312
static Annotation * createAnnotation(const QDomElement &element)
Restore an annotation (with revisions if needed) from the dom element.
Definition: annotations.cpp:90
void setInplaceCallout(const NormalizedPoint &point, int index)
Sets the inplace callout point at index.
Definition: annotations.cpp:1066
TermStyle lineEndStyle() const
Returns the line ending style of the line annotation.
Definition: annotations.cpp:1336
NormalizedPoint transformedPoint(int index) const
Returns the transformed (e.g.
Definition: annotations.cpp:1815
QLinkedList< Okular::Annotation::Revision > m_revisions
Definition: annotations_p.h:70
NormalizedRect transformedBoundingRectangle() const
Returns the transformed bounding rectangle of the annotation.
Definition: annotations.cpp:616
virtual void translate(const NormalizedPoint &coord)
Definition: annotations.cpp:862
QDomNode firstChild() const
void store(QDomNode &node, QDomDocument &document) const
Stores the text annotation as xml in document under the given parent node.
Definition: annotations.cpp:1110
void setTextIcon(const QString &icon)
Sets the icon of the text annotation.
Definition: annotations.cpp:1030
NormalizedPoint transformedInplaceCallout(int index) const
Returns the transformed (e.g.
Definition: annotations.cpp:1084
Revision & operator=(const Revision &other)
Definition: annotations.cpp:453
int inplaceAlignment() const
Returns the inplace alignment of the text annotation.
Definition: annotations.cpp:1060
void setCreationDate(const QDateTime &date)
Sets the creation date of the annotation.
Definition: annotations.cpp:575
void setAdditionalAction(AdditionalActionType type, Action *action)
Sets the additional action of the given type.
Definition: annotations.cpp:2820
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
void setLinePoints(const QLinkedList< NormalizedPoint > &points)
Sets the normalized line points of the line annotation.
Definition: annotations.cpp:1300
double effectIntensity() const
Returns the effect intensity of the style.
Definition: annotations.cpp:318
void setLineLeadingForwardPoint(double point)
Sets the leading forward point of the line annotation.
Definition: annotations.cpp:1366
void setSummary(const QString &summary)
Sets the summary of the window.
Definition: annotations.cpp:414
QList< QLinkedList< NormalizedPoint > > inkPaths() const
Returns the paths of points of the ink annotation.
Definition: annotations.cpp:2184
SubType subType() const
Returns the sub type of the line annotation.
Definition: annotations.cpp:1414
QLinkedList< Revision > & revisions()
Returns a reference to the revision list of the annotation.
Definition: annotations.cpp:663
virtual void store(QDomNode &node, QDomDocument &document) const
Stores the annotation as xml in document under the given parent node.
Definition: annotations.cpp:708
The Style class contains all information about style of the annotation.
Definition: annotations.h:305
virtual void transform(const QTransform &matrix)
Definition: annotations.cpp:847
QString uniqueName() const
Returns the unique name of the annotation.
Definition: annotations.cpp:557
QString fromLatin1(const char *str, int size)
Style & operator=(const Style &other)
Definition: annotations.cpp:215
NormalizedPoint point(int index) const
Returns the normalized point at index.
Definition: annotations.cpp:1807
QString tagName() const
T & first()
void setInplaceAlignment(int alignment)
Sets the inplace alignment of the text annotation.
Definition: annotations.cpp:1054
QDomElement createElement(const QString &tagName)
Window & operator=(const Window &other)
Definition: annotations.cpp:356
Definition: annotations.h:731
SubType subType() const
Returns the sub type of the text annotation.
Definition: annotations.cpp:1105
void setFeather(double width)
Sets the width of the drawing feather.
Definition: annotations.cpp:1843
void setEmbeddedFile(EmbeddedFile *object)
Sets the object representing the embedded file of the file attachment annotation. ...
Definition: annotations.cpp:2552
Annotation * annotation() const
Returns the annotation the revision belongs to.
Definition: annotations.cpp:466
bool canBeMoved() const
Returns whether the annotation can be moved.
Definition: annotations.cpp:693
No symbol to be associated with the text.
Definition: annotations.h:1323
NormalizedRect boundingRectangle() const
Returns the bounding rectangle of the annotation.
Definition: annotations.cpp:610
QRect united(const QRect &rectangle) const
The Quad class contains 8 coordinates and style definitions which describe a line part of the whole h...
Definition: annotations.h:1122
iterator begin()
void store(QDomNode &node, QDomDocument &document) const
Stores the stamp annotation as xml in document under the given parent node.
Definition: annotations.cpp:2100
void setBoundingRectangle(const NormalizedRect &rectangle)
Sets the bounding rectangle of the annotation.
Definition: annotations.cpp:599
CaretAnnotation::CaretSymbol caretSymbol() const
Returns the symbol of the annotation.
Definition: annotations.cpp:2434
void append(const T &value)
bool openDialogAfterCreation() const
Returns whether the annotation dialog should be open after creation of the annotation or not...
Definition: annotations.cpp:633
NormalizedPoint topLeft() const
Returns the top-left point of the window.
Definition: annotations.cpp:379
void store(QDomNode &node, QDomDocument &document) const
Stores the geometrical annotation as xml in document under the given parent node. ...
Definition: annotations.cpp:1642
void setAnnotationProperties(const QDomNode &node)
Sets annotations internal properties according to the contents of node.
Definition: annotations.cpp:810
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.