#include <pageviewmode.h>
Public Slots | |
| virtual void | movedSelectedObjects (QPoint relativeMove) |
| virtual void | resizedSelectedObjects (int dleft, int dtop, int dright, int dbottom) |
| virtual void | moveSelectedObjects (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | movedSelectedObjects (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | resizeSelectedObjects (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | resizedSelectedObjects (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mousePressLeftButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseReleaseLeftButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mousePressRightButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseReleaseRightButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mousePressMidButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseReleaseMidButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseMoveWithPressedLeftButton (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mousePressEvent (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseReleaseEvent (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | mouseMoveEvent (QMouseEvent *e, QPainter *p, QWidget *w) |
| virtual void | wheelEvent (QWheelEvent *e, QPainter *p, QWidget *w) |
| virtual void | keyPressEvent (QKeyEvent *e, QPainter *p, QWidget *w) |
| virtual void | keyReleaseEvent (QKeyEvent *e, QPainter *p, QWidget *w) |
| virtual void | focusInEvent (QFocusEvent *e, QPainter *p, QWidget *w) |
| virtual void | focusOutEvent (QFocusEvent *e, QPainter *p, QWidget *w) |
| virtual void | repaint (QPainter &p, QWidget *w) |
| virtual QRegion | getSelectedRegion () |
| virtual void | setSelectedRegion (QRegion r) |
| 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 | sendAllSelectedOperators () |
Signals | |
| void | newSelectedOperators (const std::vector< boost::shared_ptr< PdfOperator > > &objects) |
| void | newSelectedAnnotations (const std::vector< boost::shared_ptr< CAnnotation > > &objects) |
| void | needRepaint () |
| void | scroll (int x, int y) |
| void | popupMenu (const QPoint &PagePos) |
| void | executeCommand (QString cmd) |
| void | deleteSelection () |
Public Member Functions | |
| virtual bool | isSomeoneSelected () |
| void | setResizingZone (unsigned int width) |
| int | getResizingZone () |
| PageViewMode (const QString &drawingObject, const QString &_scriptFncAtMouseRelease, const QString &_scriptFncAtMoveSelectedObjects, const QString &_scriptFncAtResizeSelectedObjects) | |
| virtual | ~PageViewMode () |
Protected Types | |
| enum | resizingParts { none = 0, left = 1, right = 2, top = 4, bottom = 8, onUnselectedObject = 16 } |
Protected Member Functions | |
| virtual void | setMappingCursor () |
| virtual void | setCorrectCursor (const QPoint &point, QPainter *painter, QWidget *w) |
| virtual int | theNeerestResizingMode (const QRegion &r, const QPoint &p) |
| void | addOpsBBoxToRegion (QRegion &r, const std::vector< boost::shared_ptr< PdfOperator > > &ops) |
| QRect | getBBox (const boost::shared_ptr< PdfOperator > &op) const |
Protected Attributes | |
| std::vector< boost::shared_ptr < PdfOperator > > | workOperators |
| std::vector< boost::shared_ptr < PdfOperator > > | selectedOperators |
| QRegion | workOpRegion |
| QRegion | selectedOpRegion |
| QRegion | mouseSelectedRegion |
| QPoint | pressPosition |
| QPoint | releasePosition |
| QPoint | pointInRect |
| int | resizeCoefficientX |
| int | resizeCoefficientY |
| bool | isPressedLeftButton |
| bool | isMoving |
| bool | isResizing |
| boost::shared_ptr< DrawingObject > | drawingObject |
| int | resizingZone |
| int | mappingResizingModeToCursor [17] |
| QString | scriptFncAtMouseRelease |
| QString | scriptFncAtMoveSelectedObjects |
| QString | scriptFncAtResizeSelectedObjects |
Class is STRATEGY pattern for mode construction. Includes method for selecting objects on page and manipulating with him.
enum gui::PageViewMode::resizingParts [protected] |
| gui::PageViewMode::PageViewMode | ( | 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 gui::DrawingObjectFactory::create(), drawingObject, isPressedLeftButton, resizingZone, scriptFncAtMouseRelease, scriptFncAtMoveSelectedObjects, scriptFncAtResizeSelectedObjects, and setMappingCursor().
| gui::PageViewMode::~PageViewMode | ( | ) | [virtual] |
Standard destructor.
| void gui::PageViewMode::actualizeSelection | ( | ) | [virtual, slot] |
Actualize selected operators on the page. This method is very very well call after change operators for posiible selection. If any selected operators are not longer inter operators which are possible select, are removed from selected operators. Otherwise stay selected.
Reimplemented in gui::PageViewMode_Annotations.
References addOpsBBoxToRegion(), isMoving, isPressedLeftButton, isResizing, needRepaint(), newSelectedOperators(), selectedOperators, selectedOpRegion, and workOperators.
| void gui::PageViewMode::addOpsBBoxToRegion | ( | QRegion & | r, | |
| const std::vector< boost::shared_ptr< PdfOperator > > & | ops | |||
| ) | [protected] |
Method add operators bounding boxes to region.
| r | To which region add operators bounding boxes. | |
| ops | Container of operators which bboxes will be added to region r. |
References getBBox(), isMoving, isPressedLeftButton, and isResizing.
Referenced by actualizeSelection(), addSelectedOperators(), and addWorkOperators().
| void gui::PageViewMode::addSelectedOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | sOps | ) | [virtual, slot] |
Add operators selected on the page.
| sOps | Vector of operators. |
Reimplemented in gui::PageViewMode_TextSelection, gui::PageViewMode_Annotations, gui::PageViewMode_TextMarking, and gui::PageViewMode_GraphicalOperatorsSelection.
References addOpsBBoxToRegion(), isMoving, isPressedLeftButton, isResizing, needRepaint(), selectedOperators, and selectedOpRegion.
Referenced by setSelectedOperators().
| void gui::PageViewMode::addWorkOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | wOps | ) | [virtual, slot] |
Add operators for selection on the page.
| wOps | Vector of operators. |
Reimplemented in gui::PageViewMode_TextSelection, gui::PageViewMode_OperatorsSelection, gui::PageViewMode_Annotations, and gui::PageViewMode_GraphicalOperatorsSelection.
References addOpsBBoxToRegion(), workOperators, and workOpRegion.
Referenced by setWorkOperators().
| void gui::PageViewMode::clearSelectedOperators | ( | ) | [virtual, slot] |
Clear all operators which are selected on the page.
Reimplemented in gui::PageViewMode_TextSelection, and gui::PageViewMode_Annotations.
References isMoving, isPressedLeftButton, isResizing, needRepaint(), selectedOperators, and selectedOpRegion.
Referenced by keyReleaseEvent(), and setSelectedOperators().
| void gui::PageViewMode::clearWorkOperators | ( | ) | [virtual, slot] |
Clear all operators which acan be possible select on the page.
Reimplemented in gui::PageViewMode_TextSelection, gui::PageViewMode_OperatorsSelection, and gui::PageViewMode_Annotations.
References workOperators, and workOpRegion.
Referenced by setWorkOperators().
| void gui::PageViewMode::deleteSelection | ( | ) | [signal] |
Signal is generated if need delete selected objects (e.g. was pressed Delete).
Referenced by keyReleaseEvent().
| void gui::PageViewMode::executeCommand | ( | QString | cmd | ) | [signal] |
Signal is generated, when command cmd is to be executed in scripting.
| cmd | Script command for executing. |
Referenced by mouseReleaseLeftButton(), gui::PageViewMode_Annotations::movedSelectedObjects(), movedSelectedObjects(), gui::PageViewMode_Annotations::resizedSelectedObjects(), and resizedSelectedObjects().
| void gui::PageViewMode::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, ...) Is good for initialize other objects then operators (E.g. for annotation).
Reimplemented in gui::PageViewMode_Annotations.
| void gui::PageViewMode::focusInEvent | ( | QFocusEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if focus-in event (see Qt::QWidget::focusInEvent)
| e | Pointer to focus event (see Qt::QFocusEvent). | |
| 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. |
Do nothing in this mode.
| void gui::PageViewMode::focusOutEvent | ( | QFocusEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if focus-out event (see Qt::QWidget::focusOutEvent)
| e | Pointer to focus event (see Qt::QFocusEvent). | |
| 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. |
Do nothing in this mode.
| QRect gui::PageViewMode::getBBox | ( | const boost::shared_ptr< PdfOperator > & | op | ) | const [protected] |
Get bounding box of operator.
| op | Operator which bbox is required. |
References _JM_NAMESPACE::min().
Referenced by addOpsBBoxToRegion(), gui::PageViewMode_TextSelection::addWorkOperators(), gui::PageViewMode_OperatorsSelection::findOperators(), gui::PageViewMode_OperatorsSelection::findPrevOperator(), and gui::PageViewMode_TextSelection::updateSelection().
| int gui::PageViewMode::getResizingZone | ( | ) |
Function return actual set width of resizing zone
References resizingZone.
| QRegion gui::PageViewMode::getSelectedRegion | ( | ) | [virtual, slot] |
Function return region of selected objects on the page.
References selectedOpRegion.
| bool gui::PageViewMode::isSomeoneSelected | ( | ) | [virtual] |
Function return if some object is selected (not in selection mode PageView::SelectRect)
References selectedOperators, and selectedOpRegion.
| void gui::PageViewMode::keyPressEvent | ( | QKeyEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if press key event (see Qt::QWidget::keyPressEvent)
| e | Pointer to key event (see Qt::QKeyEvent). | |
| 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. |
Do nothing in this mode.
References needRepaint(), and scroll().
| void gui::PageViewMode::keyReleaseEvent | ( | QKeyEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if release key event (see Qt::QWidget::keyReleaseEvent)
| e | Pointer to key event (see Qt::QKeyEvent). | |
| 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. |
Esc and Delete key functionality is implemented.
References clearSelectedOperators(), deleteSelection(), isPressedLeftButton, needRepaint(), newSelectedOperators(), and selectedOperators.
| void gui::PageViewMode::mouseDoubleClickEvent | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if mouse double-click (see Qt::QWidget::mouseDoubleClickEvent)
| 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. |
Call mousePressEvent.
References mousePressEvent().
| void gui::PageViewMode::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 in gui::PageViewMode_Annotations.
References isMoving, isPressedLeftButton, isResizing, mouseMoveWithPressedLeftButton(), moveSelectedObjects(), resizeSelectedObjects(), and setCorrectCursor().
| void gui::PageViewMode::mouseMoveWithPressedLeftButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is press left mouse button and is moving with mouse.
| 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. |
Editing this function is the best way to create new mode.
Reimplemented in gui::PageViewMode_NewObject, gui::PageViewMode_TextSelection, and gui::PageViewMode_OperatorsSelection.
Referenced by mouseMoveEvent().
| void gui::PageViewMode::mousePressEvent | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if press mouse button (see Qt::QWidget::mousePressEvent)
| 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. For press left button is settings isPressedLeftButton, isMoving, isResizing, pomCur and undrawing old selectedOpRegion.
References bottom, drawingObject, isMoving, isPressedLeftButton, isResizing, left, mousePressLeftButton(), mousePressMidButton(), mousePressRightButton(), moveSelectedObjects(), none, resizeSelectedObjects(), right, selectedOpRegion, theNeerestResizingMode(), and top.
Referenced by mouseDoubleClickEvent().
| void gui::PageViewMode::mousePressLeftButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is press left mouse button.
| 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. |
Editing this function is the best way to create new mode.
Reimplemented in gui::PageViewMode_NewObject, gui::PageViewMode_TextSelection, and gui::PageViewMode_OperatorsSelection.
Referenced by mousePressEvent().
| void gui::PageViewMode::mousePressMidButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is press middle mouse button.
| 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. |
Editing this function is the best way to create new mode.
Referenced by mousePressEvent().
| void gui::PageViewMode::mousePressRightButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is press right mouse button.
| 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. |
Editing this function is the best way to create new mode.
Referenced by mousePressEvent().
| void gui::PageViewMode::mouseReleaseEvent | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if release mouse button (see Qt::QWidget::mouseReleaseEvent)
| 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. For press left button is settings isPressedLeftButton and drawing selectedOpRegion.
References drawingObject, isMoving, isPressedLeftButton, isResizing, mouseReleaseLeftButton(), mouseReleaseMidButton(), mouseReleaseRightButton(), movedSelectedObjects(), needRepaint(), resizedSelectedObjects(), and selectedOpRegion.
| void gui::PageViewMode::mouseReleaseLeftButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is release left mouse button.
| 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. |
Editing this function is the best way to create new mode.
Reimplemented in gui::PageViewMode_NewObject, gui::PageViewMode_TextSelection, gui::PageViewMode_OperatorsSelection, and gui::PageViewMode_TextMarking.
References executeCommand(), pressPosition, releasePosition, and scriptFncAtMouseRelease.
Referenced by mouseReleaseEvent().
| void gui::PageViewMode::mouseReleaseMidButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is release middle mouse button.
| 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. |
Editing this function is the best way to create new mode.
Referenced by mouseReleaseEvent().
| void gui::PageViewMode::mouseReleaseRightButton | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is release right mouse button.
| 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. |
Editing this function is the best way to create new mode.
References popupMenu().
Referenced by mouseReleaseEvent().
| void gui::PageViewMode::movedSelectedObjects | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is need move selected region (operation 'move' is finished).
| 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. |
Reimplemented in gui::PageViewMode_OperatorsSelection.
References drawingObject, isMoving, mouseSelectedRegion, movedSelectedObjects(), moveSelectedObjects(), needRepaint(), and selectedOpRegion.
| void gui::PageViewMode::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.
Reimplemented in gui::PageViewMode_Annotations.
References executeCommand(), and scriptFncAtMoveSelectedObjects.
Referenced by mouseReleaseEvent(), and movedSelectedObjects().
| void gui::PageViewMode::moveSelectedObjects | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is need move selected region (operation 'move' is NOT finished).
| 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. |
References drawingObject, isMoving, mouseSelectedRegion, needRepaint(), pointInRect, and selectedOpRegion.
Referenced by mouseMoveEvent(), mousePressEvent(), and movedSelectedObjects().
| void gui::PageViewMode::needRepaint | ( | ) | [signal] |
Signal is generated if page need repaint after changes.
Referenced by actualizeSelection(), addSelectedOperators(), clearSelectedOperators(), keyPressEvent(), keyReleaseEvent(), gui::PageViewMode_Annotations::mouseMoveEvent(), gui::PageViewMode_OperatorsSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_TextSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_NewObject::mouseMoveWithPressedLeftButton(), gui::PageViewMode_OperatorsSelection::mousePressLeftButton(), gui::PageViewMode_TextSelection::mousePressLeftButton(), gui::PageViewMode_NewObject::mousePressLeftButton(), mouseReleaseEvent(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_TextSelection::mouseReleaseLeftButton(), gui::PageViewMode_NewObject::mouseReleaseLeftButton(), movedSelectedObjects(), moveSelectedObjects(), resizedSelectedObjects(), and resizeSelectedObjects().
| void gui::PageViewMode::newSelectedAnnotations | ( | const std::vector< boost::shared_ptr< CAnnotation > > & | objects | ) | [signal] |
Signal generated by new selection known annotations.
| objects | Annotations which are selected. |
Referenced by gui::PageViewMode_Annotations::mouseMoveEvent().
| void gui::PageViewMode::newSelectedOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | objects | ) | [signal] |
Signal generated by new selection known operators.
| objects | Operators which are selected. |
Referenced by actualizeSelection(), keyReleaseEvent(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_TextSelection::mouseReleaseLeftButton(), gui::PageViewMode_OperatorsSelection::movedSelectedObjects(), gui::PageViewMode_OperatorsSelection::resizedSelectedObjects(), sendAllSelectedOperators(), and gui::PageViewMode_OperatorsSelection::setSelectedRegion().
| void gui::PageViewMode::popupMenu | ( | const QPoint & | PagePos | ) | [signal] |
Signal is generated after right mouse button is released.
| PagePos | Mouse position on page. |
Referenced by mouseReleaseRightButton().
| void gui::PageViewMode::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 in gui::PageViewMode_NewObject, gui::PageViewMode_TextSelection, and gui::PageViewMode_Annotations.
References drawingObject, isMoving, isPressedLeftButton, isResizing, mouseSelectedRegion, pressPosition, releasePosition, and selectedOpRegion.
| void gui::PageViewMode::resizedSelectedObjects | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is need resize selected region (operation 'resize' is finished).
| 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. |
Reimplemented in gui::PageViewMode_OperatorsSelection.
References drawingObject, isResizing, needRepaint(), pointInRect, pressPosition, releasePosition, resizedSelectedObjects(), resizeSelectedObjects(), and selectedOpRegion.
| void gui::PageViewMode::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.
Reimplemented in gui::PageViewMode_Annotations.
References executeCommand(), and scriptFncAtResizeSelectedObjects.
Referenced by mouseReleaseEvent(), and resizedSelectedObjects().
| void gui::PageViewMode::resizeSelectedObjects | ( | QMouseEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is calling if is need resize selected region (operation 'resize' is NOT finished).
| 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. |
Reimplemented in gui::PageViewMode_OperatorsSelection.
References bottom, drawingObject, isResizing, left, needRepaint(), none, pointInRect, pressPosition, releasePosition, resizeCoefficientX, resizeCoefficientY, right, selectedOpRegion, theNeerestResizingMode(), and top.
Referenced by mouseMoveEvent(), mousePressEvent(), and resizedSelectedObjects().
| void gui::PageViewMode::scroll | ( | int | x, | |
| int | y | |||
| ) | [signal] |
Signal is generated when scrolling of the page should be done.
| x | amount to scroll to left (can be negative to scroll to right) | |
| y | amount to scroll to up (can be negative to scroll to bottom) Note: notion of left/right/up/down may be a bit counter-intuitive. If we press right arrow key, we want to scroll "to left" |
Referenced by keyPressEvent().
| void gui::PageViewMode::sendAllSelectedOperators | ( | ) | [virtual, slot] |
This method emit all selected Objects. In mode work with operators emits signal newSelectedOperators with all selected operators. In mode work with annotations emit signal newSelectedAnnotations with all selected annotations.
References newSelectedOperators(), and selectedOperators.
| void gui::PageViewMode::setCorrectCursor | ( | const QPoint & | point, | |
| QPainter * | painter, | |||
| QWidget * | w | |||
| ) | [protected, virtual] |
Method set currsor to correct for actual situation.
| point | Actual cursor position. | |
| painter | 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. |
Cursor is set by mappingResizingModeToCursor.
References mappingResizingModeToCursor, none, onUnselectedObject, selectedOpRegion, theNeerestResizingMode(), and workOpRegion.
Referenced by mouseMoveEvent().
| void gui::PageViewMode::setMappingCursor | ( | ) | [protected, virtual] |
Set mapping cursors for viewing on the page for actual selection mode
Reimplemented in gui::PageViewMode_TextSelection, gui::PageViewMode_Annotations, and gui::PageViewMode_TextMarking.
References bottom, left, mappingResizingModeToCursor, right, and top.
Referenced by PageViewMode().
| void gui::PageViewMode::setResizingZone | ( | unsigned int | width | ) |
Method set width of resizing zone
| width | width in pixels |
Default is set to 2.
References resizingZone.
| void gui::PageViewMode::setSelectedOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | sOps | ) | [virtual, slot] |
Set operators selected on the page.
| sOps | Vector of operators. |
Reimplemented in gui::PageViewMode_Annotations.
References addSelectedOperators(), and clearSelectedOperators().
Referenced by gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_OperatorsSelection::movedSelectedObjects(), gui::PageViewMode_OperatorsSelection::resizedSelectedObjects(), and gui::PageViewMode_OperatorsSelection::setSelectedRegion().
| void gui::PageViewMode::setSelectedRegion | ( | QRegion | r | ) | [virtual, slot] |
Set selection region on the page.
| r | Which region to set. |
Reimplemented in gui::PageViewMode_TextSelection, and gui::PageViewMode_OperatorsSelection.
References isMoving, isPressedLeftButton, isResizing, and selectedOpRegion.
| void gui::PageViewMode::setWorkOperators | ( | const std::vector< boost::shared_ptr< PdfOperator > > & | wOps | ) | [virtual, slot] |
Set operators for selection on the page.
| wOps | Vector of operators. |
Reimplemented in gui::PageViewMode_Annotations.
References addWorkOperators(), and clearWorkOperators().
| int gui::PageViewMode::theNeerestResizingMode | ( | const QRegion & | r, | |
| const QPoint & | p | |||
| ) | [protected, virtual] |
Method for calculation resizing mode
| r | rectsngle for resizing | |
| p | cursor position |
References bottom, left, _JM_NAMESPACE::min(), none, resizingZone, right, and top.
Referenced by mousePressEvent(), resizeSelectedObjects(), and setCorrectCursor().
| void gui::PageViewMode::wheelEvent | ( | QWheelEvent * | e, | |
| QPainter * | p, | |||
| QWidget * | w | |||
| ) | [virtual, slot] |
Method is call if some wheel event (see Qt::QWidget::wheelEvent)
| e | Pointer to wheel event (see Qt::QWheelEvent). | |
| 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. |
Do nothing in this mode.
boost::shared_ptr< DrawingObject > gui::PageViewMode::drawingObject [protected] |
Smart pointer for drawing selection area on page. Drawing object is ceated in constructor.
Referenced by gui::PageViewMode_OperatorsSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_TextSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_NewObject::mouseMoveWithPressedLeftButton(), mousePressEvent(), gui::PageViewMode_OperatorsSelection::mousePressLeftButton(), gui::PageViewMode_TextSelection::mousePressLeftButton(), gui::PageViewMode_NewObject::mousePressLeftButton(), mouseReleaseEvent(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_TextSelection::mouseReleaseLeftButton(), gui::PageViewMode_NewObject::mouseReleaseLeftButton(), movedSelectedObjects(), moveSelectedObjects(), PageViewMode(), gui::PageViewMode_Annotations::repaint(), gui::PageViewMode_TextSelection::repaint(), gui::PageViewMode_NewObject::repaint(), repaint(), resizedSelectedObjects(), and resizeSelectedObjects().
bool gui::PageViewMode::isMoving [protected] |
Is true if is actual moved selection area.
Referenced by actualizeSelection(), addOpsBBoxToRegion(), gui::PageViewMode_GraphicalOperatorsSelection::addSelectedOperators(), gui::PageViewMode_TextSelection::addSelectedOperators(), addSelectedOperators(), gui::PageViewMode_GraphicalOperatorsSelection::addWorkOperators(), gui::PageViewMode_TextSelection::addWorkOperators(), clearSelectedOperators(), gui::PageViewMode_TextSelection::clearWorkOperators(), gui::PageViewMode_Annotations::mouseMoveEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), movedSelectedObjects(), moveSelectedObjects(), gui::PageViewMode_Annotations::repaint(), gui::PageViewMode_TextSelection::repaint(), gui::PageViewMode_NewObject::repaint(), repaint(), and setSelectedRegion().
bool gui::PageViewMode::isPressedLeftButton [protected] |
Is true if was press left mouse button and not release.
Referenced by actualizeSelection(), addOpsBBoxToRegion(), gui::PageViewMode_GraphicalOperatorsSelection::addSelectedOperators(), gui::PageViewMode_TextSelection::addSelectedOperators(), addSelectedOperators(), gui::PageViewMode_GraphicalOperatorsSelection::addWorkOperators(), gui::PageViewMode_TextSelection::addWorkOperators(), clearSelectedOperators(), gui::PageViewMode_TextSelection::clearWorkOperators(), keyReleaseEvent(), gui::PageViewMode_Annotations::mouseMoveEvent(), mouseMoveEvent(), mousePressEvent(), gui::PageViewMode_TextSelection::mousePressLeftButton(), mouseReleaseEvent(), PageViewMode(), gui::PageViewMode_Annotations::repaint(), gui::PageViewMode_TextSelection::repaint(), gui::PageViewMode_NewObject::repaint(), repaint(), and setSelectedRegion().
bool gui::PageViewMode::isResizing [protected] |
Is true if is actual resized selection area.
Referenced by actualizeSelection(), addOpsBBoxToRegion(), gui::PageViewMode_GraphicalOperatorsSelection::addSelectedOperators(), gui::PageViewMode_TextSelection::addSelectedOperators(), addSelectedOperators(), gui::PageViewMode_GraphicalOperatorsSelection::addWorkOperators(), gui::PageViewMode_TextSelection::addWorkOperators(), clearSelectedOperators(), gui::PageViewMode_TextSelection::clearWorkOperators(), gui::PageViewMode_Annotations::mouseMoveEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), gui::PageViewMode_Annotations::repaint(), gui::PageViewMode_TextSelection::repaint(), repaint(), resizedSelectedObjects(), gui::PageViewMode_OperatorsSelection::resizeSelectedObjects(), resizeSelectedObjects(), and setSelectedRegion().
int gui::PageViewMode::mappingResizingModeToCursor[17] [protected] |
mapping array resizing mode to cursor shape
Referenced by setCorrectCursor(), gui::PageViewMode_TextMarking::setMappingCursor(), gui::PageViewMode_Annotations::setMappingCursor(), gui::PageViewMode_TextSelection::setMappingCursor(), and setMappingCursor().
QRegion gui::PageViewMode::mouseSelectedRegion [protected] |
Helpes region of temporary selected area on page. Is using for moving, resizing or new selecting.
Referenced by gui::PageViewMode_TextSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_TextSelection::mousePressLeftButton(), gui::PageViewMode_TextSelection::mouseReleaseLeftButton(), gui::PageViewMode_OperatorsSelection::movedSelectedObjects(), movedSelectedObjects(), moveSelectedObjects(), gui::PageViewMode_Annotations::repaint(), gui::PageViewMode_TextSelection::repaint(), and repaint().
QPoint gui::PageViewMode::pointInRect [protected] |
Relative position in selected area. Is using for member point in selected area in moving action.
Referenced by moveSelectedObjects(), resizedSelectedObjects(), and resizeSelectedObjects().
QPoint gui::PageViewMode::pressPosition [protected] |
Point of press mouse button on page.
Referenced by gui::PageViewMode_OperatorsSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_NewObject::mouseMoveWithPressedLeftButton(), gui::PageViewMode_OperatorsSelection::mousePressLeftButton(), gui::PageViewMode_NewObject::mousePressLeftButton(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_NewObject::mouseReleaseLeftButton(), mouseReleaseLeftButton(), gui::PageViewMode_NewObject::repaint(), repaint(), resizedSelectedObjects(), and resizeSelectedObjects().
QPoint gui::PageViewMode::releasePosition [protected] |
Point of release mouse button on page.
Referenced by gui::PageViewMode_OperatorsSelection::mouseMoveWithPressedLeftButton(), gui::PageViewMode_NewObject::mouseMoveWithPressedLeftButton(), gui::PageViewMode_OperatorsSelection::mousePressLeftButton(), gui::PageViewMode_NewObject::mousePressLeftButton(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_NewObject::mouseReleaseLeftButton(), mouseReleaseLeftButton(), gui::PageViewMode_NewObject::repaint(), repaint(), gui::PageViewMode_Annotations::resizedSelectedObjects(), resizedSelectedObjects(), and resizeSelectedObjects().
int gui::PageViewMode::resizeCoefficientX [protected] |
Coeficient for multiply with movable X position. Is using in resizing action. Defined if is resized width.
Referenced by resizeSelectedObjects().
int gui::PageViewMode::resizeCoefficientY [protected] |
Coeficient for multiply with movable Y position. Is using in resizing action. Defined if is resized height.
Referenced by resizeSelectedObjects().
int gui::PageViewMode::resizingZone [protected] |
Width of resizing zone. If selected area is [ [a,b] , [c,d] ] ([a,b] is left top edge and [c,d] is bottom right edge of selected region) then resizing area is [ [a,b] , [c,d] ] xor [ [a+resizingZone, b+resizingZone], [c-resizingZone,d-resizingZone] ] (c-a) > 2*resizingZone and (d-b) > 2*resizingZone
Referenced by getResizingZone(), PageViewMode(), setResizingZone(), and theNeerestResizingMode().
QString gui::PageViewMode::scriptFncAtMouseRelease [protected] |
Name of script function, which will call at mouse release. Must be in this format: "fncName ( %1, %2, %3, %4, %5, %6 )" where 1 will be replaced with x1 (X position at mouse press) 2 will be replaced with y1 (Y position at mouse press) 3 will be replaced with x2 (X position at mouse release) 4 will be replaced with y2 (Y position at mouse release) 3 will be replaced with global position of x2 (global X position at mouse release) 4 will be replaced with global position of y2 (global Y position at mouse release)
Function in script: fncName ( x1:Number, y1:Number, x2:Number, y2:Number ) { ... }
Referenced by mouseReleaseLeftButton(), gui::PageViewMode_Annotations::movedSelectedObjects(), and PageViewMode().
QString gui::PageViewMode::scriptFncAtMoveSelectedObjects [protected] |
Name of script function, which will call at move selected objects. Must be in this format: "fncName ( %1, %2 )" where 1 will be replaced with dx 2 will be replaced with dy
Function in script: fncName ( dx:Number, dy:Number ) { ... }
Referenced by movedSelectedObjects(), and PageViewMode().
QString gui::PageViewMode::scriptFncAtResizeSelectedObjects [protected] |
Name of script function, which will call at resized selected objects. Must be in this format: "fncName ( %1, %2, %3, %4 )" where 1 will be replaced with dleft 2 will be replaced with dtop 3 will be replaced with dright 4 will be replaced with dbottom
Function in script: fncName ( dleft:Number, dtop:Number, dright:Number, dbottom:Number ) { ... }
Referenced by PageViewMode(), gui::PageViewMode_Annotations::resizedSelectedObjects(), and resizedSelectedObjects().
std::vector< boost::shared_ptr< PdfOperator > > gui::PageViewMode::selectedOperators [protected] |
Vector of selected operators.
Referenced by actualizeSelection(), addSelectedOperators(), clearSelectedOperators(), isSomeoneSelected(), keyReleaseEvent(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_TextSelection::mouseReleaseLeftButton(), gui::PageViewMode_OperatorsSelection::movedSelectedObjects(), gui::PageViewMode_TextSelection::reorderSelectedOp(), gui::PageViewMode_OperatorsSelection::resizedSelectedObjects(), sendAllSelectedOperators(), and gui::PageViewMode_OperatorsSelection::setSelectedRegion().
QRegion gui::PageViewMode::selectedOpRegion [protected] |
Bounding region of selected objects
Referenced by actualizeSelection(), addSelectedOperators(), clearSelectedOperators(), gui::PageViewMode_Annotations::extraInitialize(), getSelectedRegion(), isSomeoneSelected(), gui::PageViewMode_Annotations::mouseMoveEvent(), mousePressEvent(), gui::PageViewMode_TextSelection::mousePressLeftButton(), mouseReleaseEvent(), gui::PageViewMode_TextSelection::mouseReleaseLeftButton(), gui::PageViewMode_OperatorsSelection::movedSelectedObjects(), movedSelectedObjects(), moveSelectedObjects(), gui::PageViewMode_Annotations::repaint(), repaint(), resizedSelectedObjects(), resizeSelectedObjects(), setCorrectCursor(), and setSelectedRegion().
std::vector< boost::shared_ptr< PdfOperator > > gui::PageViewMode::workOperators [protected] |
Vector of operators which will be possible selected.
Referenced by actualizeSelection(), gui::PageViewMode_OperatorsSelection::addWorkOperators(), addWorkOperators(), gui::PageViewMode_OperatorsSelection::clearWorkOperators(), clearWorkOperators(), gui::PageViewMode_OperatorsSelection::mouseReleaseLeftButton(), gui::PageViewMode_OperatorsSelection::movedSelectedObjects(), gui::PageViewMode_OperatorsSelection::PageViewMode_OperatorsSelection(), gui::PageViewMode_OperatorsSelection::resizedSelectedObjects(), and gui::PageViewMode_OperatorsSelection::setSelectedRegion().
QRegion gui::PageViewMode::workOpRegion [protected] |
Bounding region of possible selected objects.
Referenced by addWorkOperators(), clearWorkOperators(), gui::PageViewMode_Annotations::extraInitialize(), gui::PageViewMode_TextSelection::mousePressLeftButton(), gui::PageViewMode_Annotations::repaint(), and setCorrectCursor().