okular
documentcommands.cpp
Go to the documentation of this file.
40 Okular::NormalizedRect buildBoundingRectangleForButtons( const QList<Okular::FormFieldButton*> & formButtons )
59 AddAnnotationCommand::AddAnnotationCommand( Okular::DocumentPrivate * docPriv, Okular::Annotation* annotation, int pageNumber )
78 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
85 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
91 RemoveAnnotationCommand::RemoveAnnotationCommand(Okular::DocumentPrivate * doc, Okular::Annotation* annotation, int pageNumber)
110 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
116 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
133 setText(i18nc("Modify an annotation's internal properties (Color, line-width, etc.)", "modify annotation properties"));
138 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
145 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
166 moveViewportIfBoundingRectNotFullyVisible(translateBoundingRectangle( minusDelta() ), m_docPriv, m_pageNumber );
173 moveViewportIfBoundingRectNotFullyVisible(translateBoundingRectangle( m_delta ), m_docPriv, m_pageNumber );
204 Okular::NormalizedRect TranslateAnnotationCommand::translateBoundingRectangle( const Okular::NormalizedPoint & delta )
229 // If There was a selection then edit was not a simple single character backspace, delete, or insert
236 newContentsLeftOfCursor() == oldContentsLeftOfCursor().left(oldContentsLeftOfCursor().length() - 1) &&
243 newContentsRightOfCursor() == oldContentsRightOfCursor().right(oldContentsRightOfCursor().length() - 1) &&
250 newContentsLeftOfCursor().left( newContentsLeftOfCursor().length() - 1) == oldContentsLeftOfCursor() &&
319 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
321 emit m_docPriv->m_parent->annotationContentsChangedByUndoRedo( m_annotation, m_prevContents, m_prevCursorPos, m_prevAnchorPos );
326 moveViewportIfBoundingRectNotFullyVisible( m_annotation->boundingRectangle(), m_docPriv, m_pageNumber );
328 emit m_docPriv->m_parent->annotationContentsChangedByUndoRedo( m_annotation, m_newContents, m_newCursorPos, m_newCursorPos );
370 emit m_docPriv->m_parent->formTextChangedByUndoRedo( m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos );
377 emit m_docPriv->m_parent->formTextChangedByUndoRedo( m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos );
470 emit m_docPriv->m_parent->formComboChangedByUndoRedo( m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos );
484 emit m_docPriv->m_parent->formComboChangedByUndoRedo( m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos );
virtual void setEditChoice(const QString &text)
Sets the text entered into an editable combo box choice field.
Definition: form.cpp:247
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:336
EditFormComboCommand(Okular::DocumentPrivate *docPriv, FormFieldChoice *form, int pageNumber, const QString &newText, int newCursorPos, const QString &prevText, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:427
void performAddPageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1058
void setViewport(const DocumentViewport &viewport, DocumentObserver *excludeObserver=0, bool smoothMove=false)
Sets the current document viewport to the given viewport.
Definition: document.cpp:3176
Rotation rotation() const
Returns the rotation of the page as defined by the user.
Definition: page.cpp:154
EditFormTextCommand(Okular::DocumentPrivate *docPriv, Okular::FormFieldText *form, int pageNumber, const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:350
virtual NormalizedRect rect() const =0
The bouding rect of the field, in normalized coordinates.
void transform(const QTransform &matrix)
Transforms the normalized rectangle with the operations defined by matrix.
Definition: area.cpp:259
bool isNormalizedRectangleFullyVisible(const Okular::NormalizedRect &rectOfInterest, int rectPage)
Return whether the normalized rectangle rectOfInterest on page number rectPage is fully visible...
Definition: document.cpp:2032
RemoveAnnotationCommand(Okular::DocumentPrivate *doc, Okular::Annotation *annotation, int pageNumber)
Definition: documentcommands.cpp:91
const T & at(int i) const
void formListChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QList< int > &choices)
This signal is emmitted whenever the selected choices for the given list form on the given page are c...
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
Okular::NormalizedRect translateBoundingRectangle(const Okular::NormalizedPoint &delta)
Definition: documentcommands.cpp:204
void setText(const QString &text)
Okular::NormalizedPoint minusDelta()
Definition: documentcommands.cpp:199
TranslateAnnotationCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber, const Okular::NormalizedPoint &delta, bool completeDrag)
Definition: documentcommands.cpp:150
int size() const
virtual int id() const
Definition: documentcommands.cpp:331
const Page * page(int number) const
Returns the page object for the given page number or 0 if the number is out of range.
Definition: document.cpp:2667
void translate(const NormalizedPoint &coord)
Move the annotation by the specified coordinates.
Definition: annotations.cpp:622
virtual void redo()
Definition: documentcommands.cpp:143
void append(const T &value)
EditFormListCommand(Okular::DocumentPrivate *docPriv, FormFieldChoice *form, int pageNumber, const QList< int > &newChoices, const QList< int > &prevChoices)
Definition: documentcommands.cpp:399
void performSetAnnotationContents(const QString &newContents, Annotation *annot, int pageNumber)
Definition: document.cpp:1173
virtual ~AddAnnotationCommand()
Definition: documentcommands.cpp:68
EditAnnotationContentsCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber, const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:301
void annotationContentsChangedByUndoRedo(Okular::Annotation *annotation, const QString &contents, int cursorPos, int anchorPos)
This signal is emmitted whenever the contents of the given annotation are changed by an undo or redo ...
void moveViewportIfBoundingRectNotFullyVisible(Okular::NormalizedRect boundingRect, DocumentPrivate *docPriv, int pageNumber)
Definition: documentcommands.cpp:23
Okular::NormalizedRect buildBoundingRectangleForButtons(const QList< Okular::FormFieldButton * > &formButtons)
Definition: documentcommands.cpp:40
ModifyAnnotationPropertiesCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber, QDomNode oldProperties, QDomNode newProperties)
Definition: documentcommands.cpp:122
virtual QStringList choices() const =0
The possible choices of the choice field.
QString right(int n) const
struct Okular::DocumentViewport::@0 rePos
If 'rePos.enabled == true' then this structure contains the viewport center or top left depending on ...
virtual void setCurrentChoices(const QList< int > &choices)
Sets the selected choices to choices .
Definition: form.cpp:238
AddAnnotationCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber)
Definition: documentcommands.cpp:59
Definition: document_p.h:77
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:263
void performRemovePageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1091
QTransform buildRotationMatrix(Rotation rotation)
Return a rotation matrix corresponding to the rotation enumeration.
Definition: utils.cpp:380
void formComboChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QString &text, int cursorPos, int anchorPos)
This signal is emmitted whenever the active text for the given combo form on the given page is change...
EditFormButtonsCommand(Okular::DocumentPrivate *docPriv, int pageNumber, const QList< FormFieldButton * > &formButtons, const QList< bool > &newButtonStates)
Definition: documentcommands.cpp:511
virtual void setState(bool state)
Sets the state of the button to the new state .
Definition: form.cpp:110
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
virtual void setText(const QString &text)
Sets the new text in the text field.
Definition: form.cpp:148
void performModifyPageAnnotation(int page, Annotation *annotation, bool appearanceChanged)
Definition: document.cpp:1129
virtual ~RemoveAnnotationCommand()
Definition: documentcommands.cpp:100
int length() const
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:492
QString left(int n) const
void formButtonsChangedByUndoRedo(int page, const QList< Okular::FormFieldButton * > &formButtons)
This signal is emmitted whenever the state of the specified group of form buttons (formButtons) on th...
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:385
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:183
void formTextChangedByUndoRedo(int page, Okular::FormFieldText *form, const QString &contents, int cursorPos, int anchorPos)
This signal is emmitted whenever the text contents of the given text form on the given page are chang...
NormalizedRect boundingRectangle() const
Returns the bounding rectangle of the annotation.
Definition: annotations.cpp:610
EditTextCommand(const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:215
virtual void undo()
Definition: documentcommands.cpp:136
void setAnnotationProperties(const QDomNode &node)
Sets annotations internal properties according to the contents of node.
Definition: annotations.cpp:810
Definition: documentcommands_p.h:103
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.