PDFScene Class Reference

QGraphicsScene specialized for holding a single high-resolution PDF page rendering plus optional annotations. More...

#include <pdfscene.h>

Collaboration diagram for PDFScene:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Visibility { NothingVisible = 0x0, ImageVisible = 0x1, TextVisible = 0x2 }

Public Slots

void image (QImage pm)
 Load the given image into pdfView, to be shown in the main pane's QGraphicsView.
void image (int, QImage pm)
 Convenience version of image(QImage) for cases when the signal to be connected happens to have a page number.
QImage image ()
 Getter for my current image.
void pageText (QList< Poppler::TextBox * > boxen)
 Load the given text boxes into the pdfView, to be shown in the main pane's QGraphicsView if enabled.
void setTool (Tool *t)
 Set my current tool.
void setImageVisible (bool v)
void setTextVisible (bool v)

Signals

void cursorPos (QPointF pos)
 Current cursor position as detected in mouseMoveEvent.

Public Member Functions

 PDFScene ()

Public Attributes

BoxToolboxTool
SelectToolselectTool

Protected Member Functions

void mouseMoveEvent (QGraphicsSceneMouseEvent *ev)
 Forward the mouse move event to the current Tool if appropriate.
void mousePressEvent (QGraphicsSceneMouseEvent *ev)
 Forward the mouse press event to the current Tool if appropriate.
void mouseReleaseEvent (QGraphicsSceneMouseEvent *ev)
 Forward the mouse release event to the current Tool if appropriate.
void updateVisibilities ()

Private Attributes

QGraphicsPixmapItem pdfView
 The rendering of the current PDF page.
Tooltool
 The current selected Tool, or NULL if none.
Visibilities visibleItems


Detailed Description

QGraphicsScene specialized for holding a single high-resolution PDF page rendering plus optional annotations.

Definition at line 17 of file pdfscene.h.


Member Enumeration Documentation

Enumerator:
NothingVisible 
ImageVisible 
TextVisible 

Definition at line 21 of file pdfscene.h.


Constructor & Destructor Documentation

PDFScene::PDFScene (  ) 

Definition at line 7 of file pdfscene.cpp.

References pdfView.


Member Function Documentation

void PDFScene::cursorPos ( QPointF  pos  )  [signal]

Current cursor position as detected in mouseMoveEvent.

Used to update the status bar.

Referenced by mouseMoveEvent().

Here is the caller graph for this function:

QImage PDFScene::image (  )  [slot]

Getter for my current image.

Definition at line 79 of file pdfscene.cpp.

References pdfView.

void PDFScene::image ( int  ,
QImage  pm 
) [inline, slot]

Convenience version of image(QImage) for cases when the signal to be connected happens to have a page number.

Parameters:
pnum page number of the given image (ignored)
pm image to be shown

Definition at line 58 of file pdfscene.h.

References image().

Referenced by image().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFScene::image ( QImage  pm  )  [slot]

Load the given image into pdfView, to be shown in the main pane's QGraphicsView.

Definition at line 18 of file pdfscene.cpp.

References pdfView.

Referenced by MainWindow::on_actionExport_triggered().

Here is the caller graph for this function:

void PDFScene::mouseMoveEvent ( QGraphicsSceneMouseEvent *  ev  )  [protected]

Forward the mouse move event to the current Tool if appropriate.

Definition at line 52 of file pdfscene.cpp.

References cursorPos(), Tool::mouseMoveEvent(), and tool.

Here is the call graph for this function:

void PDFScene::mousePressEvent ( QGraphicsSceneMouseEvent *  ev  )  [protected]

Forward the mouse press event to the current Tool if appropriate.

Definition at line 61 of file pdfscene.cpp.

References Tool::mousePressEvent(), and tool.

Here is the call graph for this function:

void PDFScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  ev  )  [protected]

Forward the mouse release event to the current Tool if appropriate.

Also, if the mouse was pressed and released in the same spot, synthesize a Tool::mouseLeftClickEvent.

Definition at line 67 of file pdfscene.cpp.

References MOUSE_CLICK_MAX_MOVEMENT, Tool::mouseLeftClickEvent(), Tool::mouseReleaseEvent(), and tool.

Here is the call graph for this function:

void PDFScene::pageText ( QList< Poppler::TextBox * >  boxen  )  [slot]

Load the given text boxes into the pdfView, to be shown in the main pane's QGraphicsView if enabled.

Todo:
replace font finagling factor with something meaningful

Definition at line 24 of file pdfscene.cpp.

References TextVisible, and visibleItems.

void PDFScene::setImageVisible ( bool  v  )  [inline, slot]

Definition at line 80 of file pdfscene.h.

References ImageVisible, updateVisibilities(), and visibleItems.

Referenced by MainWindow::on_actionViewPageImage_toggled().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFScene::setTextVisible ( bool  v  )  [inline, slot]

Definition at line 86 of file pdfscene.h.

References TextVisible, updateVisibilities(), and visibleItems.

Referenced by MainWindow::on_actionViewPageText_toggled().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFScene::setTool ( Tool t  )  [inline, slot]

Set my current tool.

The UI should call Tool::activate() instead, when the user chooses a different tool. However it's also possible to call setTool(NULL) to get the non-tool default behavior.

Definition at line 78 of file pdfscene.h.

References tool.

Referenced by SelectTool::activate(), BoxTool::activate(), and MainWindow::on_actionPan_toggled().

Here is the caller graph for this function:

void PDFScene::updateVisibilities (  )  [protected]

Definition at line 84 of file pdfscene.cpp.

References ImageVisible, TextVisible, and visibleItems.

Referenced by setImageVisible(), and setTextVisible().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 33 of file pdfscene.h.

Referenced by MainWindow::on_actionBox_toggled().

QGraphicsPixmapItem PDFScene::pdfView [private]

The rendering of the current PDF page.

Definition at line 119 of file pdfscene.h.

Referenced by image(), and PDFScene().

Definition at line 34 of file pdfscene.h.

Referenced by MainWindow::on_actionSelect_toggled().

Tool* PDFScene::tool [private]

The current selected Tool, or NULL if none.

Definition at line 124 of file pdfscene.h.

Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and setTool().

Visibilities PDFScene::visibleItems [private]

Definition at line 126 of file pdfscene.h.

Referenced by pageText(), setImageVisible(), setTextVisible(), and updateVisibilities().


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

Generated on Tue Sep 8 15:09:48 2009 for Taborca by  doxygen 1.5.8