QCAD
Open Source 2D CAD
PrintPreview Class Reference

Switches the current document to print preview mode. More...

Inheritance diagram for PrintPreview:
DefaultAction EAction RActionAdapter RAction

Public Member Functions

void addDecorations (void pages)
 Overwritable hook to add more decorations to the print preview. More...
 
void beginEvent ()
 Called as soon as the action is created (menu chosen, toolbutton activated, etc). More...
 
void colorModeUpdate ()
 
void drawGlueMargins (void path, void border)
 Draws the glue margins for the given page. More...
 
void drawPaper (void path, void border)
 Draws the paper border for the given page. More...
 
void drawShadow (void path, void border)
 Draws the shadow for the given page. More...
 
void finishEvent ()
 Called when this action is terminated. More...
 
void getPaperBox ()
 
void hideUiOptions ()
 
void initScaleCombo ()
 
void initUiOptions (void resume, void optionsToolBar)
 Initializes the scale combo box in the options toolbar with defaults. More...
 
void mouseMoveEvent (void event)
 Implements moving of paper (offset). More...
 
void mousePressEvent (void event)
 Implements moving of paper (offset). More...
 
void PrintPreview (void guiAction)
 
void setState (void state)
 Handles additional state changes for offset moving state. More...
 
void showUiOptions (void resume)
 Reimplementation from EAction. More...
 
void slotAutoCenter ()
 
void slotAutoFitBox (void box)
 Auto fit box to page. More...
 
void slotAutoFitDrawing ()
 Auto fit drawing button clicked in options toolbar. More...
 
void slotAutoZoomToPage ()
 
void slotBlackWhiteChanged (void checked)
 
void slotDone ()
 Triggered by the "Done" button in the options toolbar. More...
 
void slotFullColorChanged (void checked)
 Triggered by the b/w button in the options toolbar. More...
 
void slotGrayscaleChanged (void checked)
 
void slotHairlineChanged (void checked)
 
void slotLandscapeChanged ()
 
void slotOffsetChanged (void checked)
 Triggered by the offset tool button in the options toolbar. More...
 
void slotPdfExport ()
 
void slotPortraitChanged ()
 
void slotPrint (void pdfFile)
 
void slotPrintCropMarksChanged (void checked)
 Crop marks toggled in options toolbar. More...
 
void slotScaleChanged (void scaleString)
 Called whenever the user changes the drawing scale in the print preview. More...
 
void slotShowPaperBordersChanged (void checked)
 Page borders toggled in options toolbar. More...
 
void suspendEvent ()
 Called with the action is Suspended, for example when another action becomes active or the mouse cursor leaves the view. More...
 
void updateBackgroundDecoration ()
 Called to update the background decoration (paper borders) if the scale or paper settings change. More...
 
void updateBackgroundTransform ()
 Updates the background decoration transformation. More...
 
- Public Member Functions inherited from DefaultAction
void DefaultAction (void guiAction)
 
void deselectEntity (void entityId)
 Called when the user deselects a single entity. More...
 
void entityDoubleClicked (void entityId, void event)
 Called when the user selects a single entity. More...
 
void escapeEvent (void event)
 Escape events are triggered if the user clicks the right mouse button or hits the Escape key. More...
 
void highlightEntity (void entityId)
 Called when the mouse cursor hovers over an entity. More...
 
void highlightReferencePoint (void referencePoint)
 Called when the mouse cursor hovers over a reference point. More...
 
void mouseDoubleClickEvent (void event)
 
void mouseMoveEvent (void event)
 
void mousePressEvent (void event)
 
void mouseReleaseEvent (void event)
 
void pickCoordinate (void event, void preview)
 
void resumeEvent ()
 Resumes the action (for example when another action became active and then terminated or if the mouse cursor enters the view). More...
 
void selectEntity (void entityId, void add)
 Called when the user selects a single entity. More...
 
void setState (void state)
 
- Public Member Functions inherited from EAction
void applyCommand (void event, void preview)
 High level event triggered when a command line command should be applied or previewed. More...
 
void applyOperation ()
 Applies the operation returned by this.getOperation(). More...
 
void commandEvent (void event)
 Default implementation. More...
 
void commandEventPreview (void event)
 Default implementation. More...
 
void coordinateEvent (void event)
 Default implementation. More...
 
void coordinateEventPreview (void event)
 Default implementation. More...
 
void createDialog (void uiFile, void parent)
 Creates a new dialog based on the given UI file with the given parent. More...
 
void createWidget (void uiFile, void parent)
 Creates a new widget based on the given UI file with the given parent. More...
 
void EAction (void guiAction)
 
void entityPickEvent (void event)
 Default implementation. More...
 
void entityPickEventPreview (void event)
 Default implementation. More...
 
void escapeEvent ()
 Called when the user presses Escape or clicks the right mouse button. More...
 
void getAuxPreview ()
 Called by updatePreview. More...
 
void getDocumentInterface ()
 
void getGraphicsView ()
 
void getGraphicsViews ()
 
void getHighlightedEntities ()
 Called by updatePreview. More...
 
void getOperation (void preview)
 Called by updatePreview. More...
 
void getScales ()
 
void getToolTitle ()
 
void handlePreviewError ()
 Called by updatePreview. More...
 
void hideUiOptions (void saveToSettings)
 Hides the UI options of this action. More...
 
void initState ()
 Called to initialize a new state of this action. More...
 
void initUiOptions (void resume, void optionsToolBar)
 Overwrite to initialize combo boxes and other UI elements of the options tool bar. More...
 
void keyPressEvent (void event)
 Called when the user presses a key. More...
 
void keyReleaseEvent (void event)
 Called when the user releases a key. More...
 
void mouseDoubleClickEvent (void event)
 
void mousePressEvent (void event)
 Does nothing. More...
 
void mouseReleaseEvent (void event)
 
void pickCoordinate (void event, void preview)
 High level event triggered when a coordinate was specified by the user of a coordinate specification should be previewed. More...
 
void pickEntity (void event, void preview)
 High level event triggered when an entity was picked by the user or to preview picking an entity. More...
 
void propertyChangeEvent (void event)
 Allows all actions to handle property change events. More...
 
void resumeEvent ()
 Called whenver the action resumes its operation, for example after it was temporary suspended for another action. More...
 
void setArrowCursor ()
 Sets the current cursor of the current document interface (all views attached to it) to the normal arrow cursor. More...
 
void setCommandPrompt (void prompt)
 
void setCrosshairCursor ()
 Sets the current cursor of the current document interface (all views attached to it) to crosshair cursor. More...
 
void setCursor (void cursor, void name)
 
void setLeftMouseTip (void tip)
 
void setRightMouseTip (void tip)
 
void setState (void state)
 Set the state of this action. More...
 
void setUiOptions (void uiFile, void split)
 Sets the UI options toolbar content for this tool. More...
 
void showUiOptions (void resume, void restoreFromSettings)
 Shows the UI options of this action if this.uiFile is set. More...
 
void simulateMouseMoveEvent ()
 
void slotReset ()
 Called if the user clicks the reset button of an action. More...
 
void updatePreview (void clear)
 Updates the preview based on the operation returned by getOperation and the auxiliary construction returned be getAuxPreview. More...
 
- Public Member Functions inherited from RActionAdapter
virtual void commandEvent (RCommandEvent &)
 Called when a command is entered in the command line. More...
 
virtual void commandEventPreview (RCommandEvent &)
 Called when a command is being edited in the command line. More...
 
virtual void coordinateEvent (RCoordinateEvent &)
 Called for every coordinate event. More...
 
virtual void coordinateEventPreview (RCoordinateEvent &)
 Called if the action is in PickCoordinate mode and the mouse is moved around. More...
 
virtual void entityPickEvent (REntityPickEvent &)
 
virtual void entityPickEventPreview (REntityPickEvent &)
 
virtual void keyPressEvent (QKeyEvent &)
 
virtual void keyReleaseEvent (QKeyEvent &)
 
virtual void mouseDoubleClickEvent (RMouseEvent &)
 Called on mouse double click events. More...
 
virtual void mouseMoveEvent (RMouseEvent &)
 Called on mouse move events. More...
 
virtual void mousePressEvent (RMouseEvent &)
 Called on mouse press events. More...
 
virtual void mouseReleaseEvent (RMouseEvent &)
 Called on mouse release events. More...
 
virtual void panGestureEvent (QPanGesture &)
 Called on pan gesture events. More...
 
virtual void pinchGestureEvent (QPinchGesture &)
 Called on pinch gesture events. More...
 
virtual void propertyChangeEvent (RPropertyEvent &)
 Called when the value of a property is modified while this action is active. More...
 
 RActionAdapter (RGuiAction *guiAction=NULL)
 
virtual void setGraphicsView (RGraphicsView *)
 Called if this action is set as a navigation action of a graphics view. More...
 
virtual void swipeGestureEvent (QSwipeGesture &)
 Called on swipe gesture events. More...
 
virtual void tabletEvent (RTabletEvent &)
 Called on tablet events. More...
 
virtual void wheelEvent (RWheelEvent &)
 Called on mouse wheel events. More...
 
virtual ~RActionAdapter ()
 
- Public Member Functions inherited from RAction
RAction::ClickMode getClickMode ()
 
RDocumentgetDocument ()
 
RDocumentInterfacegetDocumentInterface ()
 
QList< RGraphicsScene * > getGraphicsScenes ()
 
virtual RGuiActiongetGuiAction ()
 
RActiongetOverrideBase ()
 
RStoragegetStorage ()
 
QString getUniqueGroup ()
 
bool hasNoState ()
 
bool isOverride ()
 
bool isTerminated ()
 
 RAction (RGuiAction *guiAction=NULL)
 Copyright (c) 2011-2015 by Andrew Mustun. More...
 
void setClickMode (RAction::ClickMode m)
 Sets the current click mode. More...
 
void setDocumentInterface (RDocumentInterface *di)
 
void setGuiAction (RGuiAction *guiAction)
 
void setNoState ()
 
void setOverride ()
 
void setOverrideBase (RAction *base)
 
void setUniqueGroup (const QString &ug)
 
RVector snap (RMouseEvent &event)
 Uses the currently active snap function to snap to the closest object or grid point. More...
 
void terminate ()
 Terminates the action. More...
 
virtual ~RAction ()
 

Public Attributes

int cursor
 
int enableSlotPaperSizeChanged
 
int panningOffset
 
int panOffsetOrigin
 
int savedOffset
 
int savedScale
 
int saveView
 
int updateDisabled
 
int view
 
- Public Attributes inherited from EAction
int additionalOptionsToolBars
 
int delegate
 
int guiAction
 
int includeBasePath
 
int optionsToolBarEnabled
 
int relativeZeroPos
 
int settingsGroup
 
int splitUiOptions
 
int state
 
int uiFile
 

Additional Inherited Members

- Public Types inherited from RAction
enum  ClickMode { PickCoordinate, PickEntity, PickingDisabled }
 Current mouse click mode. More...
 
- Protected Attributes inherited from RAction
RAction::ClickMode clickMode
 
RDocumentInterfacedocumentInterface
 
RGuiActionguiAction
 
bool noState
 Indicates whether this action is stateless (i.e. More...
 
bool override
 
RActionoverrideBase
 
bool terminated
 
QString uniqueGroup
 

Detailed Description

Switches the current document to print preview mode.

In print preview mode, the paper is shown in the background of the drawing.

Constructor & Destructor Documentation

void PrintPreview::PrintPreview ( void  guiAction)
inline

Member Function Documentation

void PrintPreview::addDecorations ( void  pages)
inline

Overwritable hook to add more decorations to the print preview.

void PrintPreview::beginEvent ( )
inlinevirtual

Called as soon as the action is created (menu chosen, toolbutton activated, etc).

Reimplemented from DefaultAction.

void PrintPreview::colorModeUpdate ( )
inline
void PrintPreview::drawGlueMargins ( void  path,
void  border 
)
inline

Draws the glue margins for the given page.

void PrintPreview::drawPaper ( void  path,
void  border 
)
inline

Draws the paper border for the given page.

void PrintPreview::drawShadow ( void  path,
void  border 
)
inline

Draws the shadow for the given page.

void PrintPreview::finishEvent ( void  )
inlinevirtual

Called when this action is terminated.

Shows the GUI elements that refer to this action as un-checked. Hides GUI options if this.uiFile is set to a valid UI file. Clears up mouse tips, etc.

Reimplemented from EAction.

void PrintPreview::getPaperBox ( )
inline
void PrintPreview::hideUiOptions ( void  )
inline
void PrintPreview::initScaleCombo ( )
inline
void PrintPreview::initUiOptions ( void  resume,
void  optionsToolBar 
)
inline

Initializes the scale combo box in the options toolbar with defaults.

void PrintPreview::mouseMoveEvent ( void  event)
inline

Implements moving of paper (offset).

void PrintPreview::mousePressEvent ( void  event)
inline

Implements moving of paper (offset).

void PrintPreview::setState ( void  state)
inline

Handles additional state changes for offset moving state.

void PrintPreview::showUiOptions ( void  resume)
inline

Reimplementation from EAction.

Implements initialization of options toolbar from member variables.

void PrintPreview::slotAutoCenter ( )
inline
void PrintPreview::slotAutoFitBox ( void  box)
inline

Auto fit box to page.

void PrintPreview::slotAutoFitDrawing ( )
inline

Auto fit drawing button clicked in options toolbar.

void PrintPreview::slotAutoZoomToPage ( )
inline
void PrintPreview::slotBlackWhiteChanged ( void  checked)
inline
void PrintPreview::slotDone ( )
inline

Triggered by the "Done" button in the options toolbar.

Terminates this action and returns to normal drawing mode.

void PrintPreview::slotFullColorChanged ( void  checked)
inline

Triggered by the b/w button in the options toolbar.

Activates / deactivates the black white mode.

void PrintPreview::slotGrayscaleChanged ( void  checked)
inline
void PrintPreview::slotHairlineChanged ( void  checked)
inline
void PrintPreview::slotLandscapeChanged ( )
inline
void PrintPreview::slotOffsetChanged ( void  checked)
inline

Triggered by the offset tool button in the options toolbar.

Activates / deactivates the offset tool.

void PrintPreview::slotPdfExport ( )
inline
void PrintPreview::slotPortraitChanged ( )
inline
void PrintPreview::slotPrint ( void  pdfFile)
inline
void PrintPreview::slotPrintCropMarksChanged ( void  checked)
inline

Crop marks toggled in options toolbar.

void PrintPreview::slotScaleChanged ( void  scaleString)
inline

Called whenever the user changes the drawing scale in the print preview.

void PrintPreview::slotShowPaperBordersChanged ( void  checked)
inline

Page borders toggled in options toolbar.

void PrintPreview::suspendEvent ( )
inlinevirtual

Called with the action is Suspended, for example when another action becomes active or the mouse cursor leaves the view.

Reimplemented from DefaultAction.

void PrintPreview::updateBackgroundDecoration ( )
inline

Called to update the background decoration (paper borders) if the scale or paper settings change.

void PrintPreview::updateBackgroundTransform ( )
inline

Updates the background decoration transformation.

Member Data Documentation

int PrintPreview::cursor
int PrintPreview::enableSlotPaperSizeChanged
int PrintPreview::panningOffset
int PrintPreview::panOffsetOrigin
int PrintPreview::savedOffset
int PrintPreview::savedScale
int PrintPreview::saveView
int PrintPreview::updateDisabled
int PrintPreview::view

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