gui::PageViewMode_Annotations Class Reference

#include <pageviewmode.h>

Inheritance diagram for gui::PageViewMode_Annotations:
gui::PageViewMode

List of all members.

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_rectannotations

Detailed Description

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.


Constructor & Destructor Documentation

gui::PageViewMode_Annotations::PageViewMode_Annotations ( 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 setMappingCursor().


Member Function Documentation

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.

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

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

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

Parameters:
p Position on the page.
Returns:
Return initialized struct for annotation and its activation region. If nothing annotation is under position p, struct is initialized to null shared pointer to annotation.

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.

Parameters:
annot Annotation which is required activayion rectangle.
Returns:
Return activation rectangle for annot.

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)

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

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

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

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

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

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.

This implementation call script function 'scriptFncAtMouseRelease' if all parameters is 0.

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

Reimplemented from gui::PageViewMode.

References gui::PageViewMode::executeCommand(), gui::PageViewMode::releasePosition, and gui::PageViewMode::scriptFncAtResizeSelectedObjects.

void gui::PageViewMode_Annotations::setMappingCursor (  )  [protected, virtual]
void gui::PageViewMode_Annotations::setSelectedOperators ( const std::vector< boost::shared_ptr< PdfOperator > > &  sOps  )  [virtual, slot]

Set operators selected on the page.

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

Parameters:
wOps Vector of operators.

Method is reimplemented from parent and nothing operators are be set.

Reimplemented from gui::PageViewMode.


Member Data Documentation

Vector of all annotations which are into the page.

Referenced by extraInitialize(), and getAnnotationOnPosition().


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