#include <pageviewmode.h>
Classes | |
| struct | annot_rect |
Public Slots | |
| virtual void | resizedSelectedObjects (int dleft, int dtop, int dright, int dbottom) |
| virtual void | movedSelectedObjects (QPoint relativeMove) |
| virtual void | mouseMoveEvent (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | setWorkOperators (const std::vector< boost::shared_ptr< PdfOperator > > &wOps) |
| virtual void | addWorkOperators (const std::vector< boost::shared_ptr< PdfOperator > > &wOps) |
| virtual void | clearWorkOperators () |
| virtual void | clearSelectedOperators () |
| virtual void | setSelectedOperators (const std::vector< boost::shared_ptr< PdfOperator > > &sOps) |
| virtual void | addSelectedOperators (const std::vector< boost::shared_ptr< PdfOperator > > &sOps) |
| virtual void | actualizeSelection () |
| virtual void | extraInitialize (const boost::shared_ptr< CPage > &page, const DisplayParams &displayParams) |
| virtual void | repaint (QPainter &p, QWidget *w) |
Public Member Functions | |
| PageViewMode_Annotations (const QString &drawingObject, const QString &_scriptFncAtMouseRelease, const QString &_scriptFncAtMoveSelectedObjects, const QString &_scriptFncAtResizeSelectedObjects) | |
Protected Member Functions | |
| virtual void | setMappingCursor () |
| libs::Rectangle | getRectOfAnnotation (boost::shared_ptr< CAnnotation > &annot) |
| annot_rect | getAnnotationOnPosition (const QPoint &p) |
Protected Attributes | |
| std::vector< annot_rect > | annotations |
Class is STRATEGY pattern for mode construction. Includes method for selecting objects on page and manipulating with him.
This implementation is for selecting only annotation on the page. If mouse cursor is over some annotation, then emits new selected annotation. If click on annotation emit required execute script commad.
| gui::PageViewMode_Annotations::PageViewMode_Annotations | ( | const QString & | drawingObject, | |
| const QString & | _scriptFncAtMouseRelease, | |||
| const QString & | _scriptFncAtMoveSelectedObjects, | |||
| const QString & | _scriptFncAtResizeSelectedObjects | |||
| ) |
Standard constructor.
| drawingObject | Text definition of drawing method (see DrawingObjectFactory) | |
| _scriptFncAtMouseRelease | Script command for call after selected object(s) | |
| _scriptFncAtMoveSelectedObjects | Script command for call after move selected object(s) | |
| _scriptFncAtResizeSelectedObjects | Script command for call after resize selected object(s) |
References setMappingCursor().
| void gui::PageViewMode_Annotations::actualizeSelection | ( | ) | [virtual, slot] |
Actualize selected operators on the page.
Method is reimplemented from parent and nothing operators are be set.
Reimplemented from gui::PageViewMode.
| void gui::PageViewMode_Annotations::addSelectedOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | sOps | ) | [virtual, slot] |
Add operators selected on the page.
| sOps | Vector of operators. |
Method is reimplemented from parent and nothing operators are be set.
Reimplemented from gui::PageViewMode.
| void gui::PageViewMode_Annotations::addWorkOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | wOps | ) | [virtual, slot] |
Add operators for selection on the page.
| wOps | Vector of operators. |
Method is reimplemented from parent and nothing operators are be set.
Reimplemented from gui::PageViewMode.
| void gui::PageViewMode_Annotations::clearSelectedOperators | ( | ) | [virtual, slot] |
Clear all operators and annotations which are selected on the page.
Reimplemented from gui::PageViewMode.
| void gui::PageViewMode_Annotations::clearWorkOperators | ( | ) | [virtual, slot] |
Clear all operators and annotations which can be possible select on the page.
Reimplemented from gui::PageViewMode.
| void gui::PageViewMode_Annotations::extraInitialize | ( | const boost::shared_ptr< CPage > & | page, | |
| const DisplayParams & | displayParams | |||
| ) | [virtual, slot] |
Extra initialization mode.
| page | Page which are viewed. | |
| displayParams | Display parameters viewed page. |
This method is good called after change viewed page, or change display parameters (zoom, rotation, ...) Initialize annotation for selecting on the page page.
Reimplemented from gui::PageViewMode.
References gui::PageViewMode_Annotations::annot_rect::activation_region, gui::PageViewMode_Annotations::annot_rect::annot, annotations, pdfobjects::DisplayParams::convertPdfPosToPixmapPos(), getRectOfAnnotation(), gui::PageViewMode::selectedOpRegion, and gui::PageViewMode::workOpRegion.
| PageViewMode_Annotations::annot_rect gui::PageViewMode_Annotations::getAnnotationOnPosition | ( | const QPoint & | p | ) | [protected] |
Get struct for annotation and its activation rectangle for annotation under point on the page
| p | Position on the page. |
References gui::PageViewMode_Annotations::annot_rect::activation_region, gui::PageViewMode_Annotations::annot_rect::annot, and annotations.
Referenced by mouseMoveEvent().
| libs::Rectangle gui::PageViewMode_Annotations::getRectOfAnnotation | ( | boost::shared_ptr< CAnnotation > & | annot | ) | [protected] |
Method get rectangle of activation region for annotation.
| annot | Annotation which is required activayion rectangle. |
References debug::DBG_WARN, pdfobjects::utils::getDoubleFromArray(), and guiPrintDbg.
Referenced by extraInitialize().
| void gui::PageViewMode_Annotations::mouseMoveEvent | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if mouse is moving (see Qt::QWidget::mouseMoveEvent)
| e | Pointer to mouse event (see Qt::QMouseEvent). | |
| p | Pointer to initialized painter for draw changes (see Qt::QPainter). Method emit at end 'needRepaint' if p is NULL. | |
| w | Pointer to widget (see Qt::QWidget). E.g. for change mouse cursor above operators. |
Is switch which call other method. Is settings pomCur and mouse cursor for widget w.
Reimplemented from gui::PageViewMode.
References gui::PageViewMode_Annotations::annot_rect::activation_region, gui::PageViewMode_Annotations::annot_rect::annot, getAnnotationOnPosition(), gui::PageViewMode::isMoving, gui::PageViewMode::isPressedLeftButton, gui::PageViewMode::isResizing, gui::PageViewMode::needRepaint(), gui::PageViewMode::newSelectedAnnotations(), and gui::PageViewMode::selectedOpRegion.
| void gui::PageViewMode_Annotations::movedSelectedObjects | ( | QPoint | relativeMove | ) | [virtual, slot] |
Method is calling if is need move selected region (operation 'move' is finished).
| relativeMove | relativ move x and y position of selected region. |
This method call script.
This implementation call script function 'scriptFncAtMouseRelease' if relativeMove is [0,0].
Reimplemented from gui::PageViewMode.
References gui::PageViewMode::executeCommand(), and gui::PageViewMode::scriptFncAtMouseRelease.
| void gui::PageViewMode_Annotations::repaint | ( | QPainter & | p, | |
| QWidget * | w | |||
| ) | [virtual, slot] |
Repaint method for draw actual state of mode (selected region, moving and resizing in action, ...).
| p | Pointer to initialized painter for draw changes (see Qt::QPainter). Method emit at end 'needRepaint' if p is NULL. | |
| w | Pointer to widget (see Qt::QWidget). E.g. for change mouse cursor above operators. |
It is only drawing method use, if viewing parent need clear repaint.
Reimplemented from gui::PageViewMode.
References gui::PageViewMode::drawingObject, gui::PageViewMode::isMoving, gui::PageViewMode::isPressedLeftButton, gui::PageViewMode::isResizing, gui::PageViewMode::mouseSelectedRegion, gui::PageViewMode::selectedOpRegion, and gui::PageViewMode::workOpRegion.
| void gui::PageViewMode_Annotations::resizedSelectedObjects | ( | int | dleft, | |
| int | dtop, | |||
| int | dright, | |||
| int | dbottom | |||
| ) | [virtual, slot] |
Method is calling if is need resize selected region (operation 'resize' is finished).
| dleft | delta position of bounding-rectangle's left edge of selected operators. | |
| dtop | delta position of bounding-rectangle's top edge of selected operators. | |
| dright | delta position of bounding-rectangle's right edge of selected operators. | |
| dbottom | delta position of bounding-rectangle's bottom edge of selected operators. |
This method call script.
This implementation call script function 'scriptFncAtMouseRelease' if all parameters is 0.
Reimplemented from gui::PageViewMode.
References gui::PageViewMode::executeCommand(), gui::PageViewMode::releasePosition, and gui::PageViewMode::scriptFncAtResizeSelectedObjects.
| void gui::PageViewMode_Annotations::setMappingCursor | ( | ) | [protected, virtual] |
Set mapping cursors for viewing on the page for actual selection mode
Reimplemented from gui::PageViewMode.
References gui::PageViewMode::bottom, gui::PageViewMode::left, gui::PageViewMode::mappingResizingModeToCursor, gui::PageViewMode::onUnselectedObject, gui::PageViewMode::right, and gui::PageViewMode::top.
Referenced by PageViewMode_Annotations().
| void gui::PageViewMode_Annotations::setSelectedOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | sOps | ) | [virtual, slot] |
Set operators selected on the page.
| sOps | Vector of operators. |
Method is reimplemented from parent and nothing operators are be set.
Reimplemented from gui::PageViewMode.
| void gui::PageViewMode_Annotations::setWorkOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | wOps | ) | [virtual, slot] |
Set operators for selection on the page.
| wOps | Vector of operators. |
Method is reimplemented from parent and nothing operators are be set.
Reimplemented from gui::PageViewMode.
std::vector< annot_rect > gui::PageViewMode_Annotations::annotations [protected] |
Vector of all annotations which are into the page.
Referenced by extraInitialize(), and getAnnotationOnPosition().