gui::PageViewMode Class Reference

#include <pageviewmode.h>

Inheritance diagram for gui::PageViewMode:
gui::PageViewMode_Annotations gui::PageViewMode_NewObject gui::PageViewMode_OperatorsSelection gui::PageViewMode_TextSelection gui::PageViewMode_GraphicalOperatorsSelection gui::PageViewMode_TextMarking

List of all members.

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< DrawingObjectdrawingObject
int resizingZone
int mappingResizingModeToCursor [17]
QString scriptFncAtMouseRelease
QString scriptFncAtMoveSelectedObjects
QString scriptFncAtResizeSelectedObjects

Detailed Description

Class is STRATEGY pattern for mode construction. Includes method for selecting objects on page and manipulating with him.


Member Enumeration Documentation

enum of resizing parts

Enumerator:
none 
left 
right 
top 
bottom 
onUnselectedObject 

Constructor & Destructor Documentation

gui::PageViewMode::PageViewMode ( const QString &  drawingObject,
const QString &  _scriptFncAtMouseRelease,
const QString &  _scriptFncAtMoveSelectedObjects,
const QString &  _scriptFncAtResizeSelectedObjects 
)

Standard constructor.

Parameters:
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.


Member Function Documentation

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.

Parameters:
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]
void gui::PageViewMode::addWorkOperators ( const std::vector< boost::shared_ptr< PdfOperator > > &  wOps  )  [virtual, slot]

Add operators for selection on the page.

Parameters:
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.

Parameters:
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.

Parameters:
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)

Parameters:
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)

Parameters:
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.

Parameters:
op Operator which bbox is required.
Returns:
Rectangle = bounding box of operator op.

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

Returns:
Actual set resizing zone

References resizingZone.

QRegion gui::PageViewMode::getSelectedRegion (  )  [virtual, slot]

Function return region of selected objects on the page.

Returns:
Region of selected objects.

References selectedOpRegion.

bool gui::PageViewMode::isSomeoneSelected (  )  [virtual]

Function return if some object is selected (not in selection mode PageView::SelectRect)

Returns:
Return TRUE, if some object is selected. Otherwise return FALSE.

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)

Parameters:
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)

Parameters:
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)

Parameters:
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.

See also:
mousePressEvent ( QMouseEvent *, QPainter *, QWidget * )

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)

Parameters:
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.

See also:
moveSelectedObjects ( QMouseEvent *, QPainter *, QWidget * )
resizeSelectedObjects ( QMouseEvent *, QPainter *, QWidget * )
mouseMoveWithPressedLeftButton ( QMouseEvent *, QPainter *, QWidget * )

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.

Parameters:
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.
See also:
mousePressEvent

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)

Parameters:
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.

See also:
mousePressLeftButton ( QMouseEvent *, QPainter *, QWidget * )
mousePressRightButton ( QMouseEvent *, QPainter *, QWidget * )
mousePressMidButton ( QMouseEvent *, QPainter *, QWidget * )
moveSelectedObjects ( QMouseEvent *, QPainter *, QWidget * )
resizeSelectedObjects ( QMouseEvent *, QPainter *, QWidget * )

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.

Parameters:
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.
See also:
mouseReleaseLeftButton
mousePressEvent

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.

Parameters:
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.
See also:
mouseReleaseMidButton
mousePressEvent

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.

Parameters:
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.
See also:
mouseReleaseRightButton
mousePressEvent

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)

Parameters:
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.

See also:
mouseReleaseLeftButton ( QMouseEvent *, QPainter *, QWidget * )
mouseReleaseRightButton ( QMouseEvent *, QPainter *, QWidget * )
mouseReleaseMidButton ( QMouseEvent *, QPainter *, QWidget * )
movedSelectedObjects ( QMouseEvent *, QPainter *, QWidget * )
resizedSelectedObjects ( QMouseEvent *, QPainter *, QWidget * )

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.

Parameters:
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.
See also:
mousePressLeftButton
mousePressEvent

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.

Parameters:
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.
See also:
mousePressMidButton
mousePressEvent

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.

Parameters:
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.
See also:
mousePressRightButton
mousePressEvent

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).

Parameters:
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.
See also:
movedSelectedObjects( QPoint )
moveSelectedObjects( QMouseEvent *, QPainter *, QWidget * )

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).

Parameters:
relativeMove relativ move x and y position of selected region.

This method call script.

See also:
movedSelectedObjects( QMouseEvent *, QPainter *, QWidget * )

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).

Parameters:
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.
See also:
mousePressLeftButton
mouseReleaseLeftButton
mouseMoveWithPressedLeftButton
movedSelectedObjects( QMouseEvent *, QPainter *, QWidget * )

References drawingObject, isMoving, mouseSelectedRegion, needRepaint(), pointInRect, and selectedOpRegion.

Referenced by mouseMoveEvent(), mousePressEvent(), and movedSelectedObjects().

void gui::PageViewMode::needRepaint (  )  [signal]
void gui::PageViewMode::newSelectedAnnotations ( const std::vector< boost::shared_ptr< CAnnotation > > &  objects  )  [signal]

Signal generated by new selection known annotations.

Parameters:
objects Annotations which are selected.

Referenced by gui::PageViewMode_Annotations::mouseMoveEvent().

void gui::PageViewMode::newSelectedOperators ( const std::vector< boost::shared_ptr< PdfOperator > > &  objects  )  [signal]
void gui::PageViewMode::popupMenu ( const QPoint &  PagePos  )  [signal]

Signal is generated after right mouse button is released.

Parameters:
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, ...).

Parameters:
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).

Parameters:
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.
See also:
resizeSelectedObjects( QMouseEvent *, QPainter *, QWidget * )
resizedSelectedObjects ( int, int, int, int )

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).

Parameters:
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.

See also:
resizedSelectedObjects( QMouseEvent *, QPainter *, QWidget * )

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).

Parameters:
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.
See also:
mousePressLeftButton
mouseReleaseLeftButton
mouseMoveWithPressedLeftButton
resizedSelectedObjects( QMouseEvent *, QPainter *, QWidget * )

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.

Parameters:
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.

Parameters:
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.

See also:
setMappingCursor

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

Parameters:
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]
void gui::PageViewMode::setSelectedRegion ( QRegion  r  )  [virtual, slot]

Set selection region on the page.

Parameters:
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.

Parameters:
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

Parameters:
r rectsngle for resizing
p cursor position
Returns:
combination of enum resizingParts

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)

Parameters:
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.


Member Data Documentation

boost::shared_ptr< DrawingObject > gui::PageViewMode::drawingObject [protected]
bool gui::PageViewMode::isMoving [protected]
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().

Coeficient for multiply with movable X position. Is using in resizing action. Defined if is resized width.

Referenced by resizeSelectedObjects().

Coeficient for multiply with movable Y position. Is using in resizing action. Defined if is resized height.

Referenced by resizeSelectedObjects().

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().

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)

See also:
QString::arg

Function in script: fncName ( x1:Number, y1:Number, x2:Number, y2:Number ) { ... }

Referenced by mouseReleaseLeftButton(), gui::PageViewMode_Annotations::movedSelectedObjects(), and PageViewMode().

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

See also:
QString::arg

Function in script: fncName ( dx:Number, dy:Number ) { ... }

Referenced by movedSelectedObjects(), and PageViewMode().

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

See also:
QString::arg

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]
std::vector< boost::shared_ptr< PdfOperator > > gui::PageViewMode::workOperators [protected]
QRegion gui::PageViewMode::workOpRegion [protected]

The documentation for this class was generated from the following files: