Référence de la classe KoCanvasController

#include <KoCanvasController.h>

Graphe de collaboration de KoCanvasController:

[légende]
Liste de tous les membres

Signaux

void canvasRemoved (KoCanvasController *cv)
void canvasSet (KoCanvasController *cv)
void canvasOffsetXChanged (int offset)
void canvasOffsetYChanged (int offset)

Fonctions membres publiques

 KoCanvasController (QWidget *parent)
virtual ~KoCanvasController ()
void setCanvas (KoCanvasBase *canvas)
KoCanvasBasecanvas () const
int visibleHeight () const
int visibleWidth () const
int canvasOffsetX () const
int canvasOffsetY () const
void centerCanvas (bool centered)
bool isCanvasCentered () const
virtual bool eventFilter (QObject *watched, QEvent *event)
void ensureVisible (const QRectF &rect)
 Scrolls the content of the canvas so that the given rect is visible.
void ensureVisible (KoShape *shape)
 Scrolls the content of the canvas so that the given shape is visible.

Connecteurs protégés

void updateCanvasOffsetX ()
 Called by the horizontal scrollbar when it's value changes.
void updateCanvasOffsetY ()
 Called by the vertical scrollbar when it's value changes.

Attributs privés

KoCanvasBasem_canvas
QWidget * m_canvasWidget
Viewportm_viewport
bool m_centerCanvas

Classes

class  Viewport

Description détaillée

This widget is a wrapper around your canvas providing scrollbars. Flake does not provide a canvas, the application will have to extend a QWidget and implement that themselves; but Flake does make it a lot easier to do so. One of those things is this widget that acts as a decorator around the canvas widget and provides scrollbars and allows the canvas to be centered in the viewArea

The using application can intantiate this class and add its canvas using the setCanvas() call. Which is designed so it can be called multiple times for those that wish to exchange one canvas widget for another.

Effectively, there is _one_ KoCanvasController per KoView in your application.

Définition à la ligne 48 du fichier KoCanvasController.h.


Documentation des contructeurs et destructeur

KoCanvasController::KoCanvasController ( QWidget *  parent  ) 

Constructor.

Paramètres:
parent the parent this widget will belong to

Définition à la ligne 32 du fichier KoCanvasController.cpp.

Références m_viewport, updateCanvasOffsetX(), et updateCanvasOffsetY().

virtual KoCanvasController::~KoCanvasController (  )  [inline, virtual]

Définition à la ligne 56 du fichier KoCanvasController.h.


Documentation des fonctions membres

void KoCanvasController::setCanvas ( KoCanvasBase canvas  ) 

Set the new canvas to be shown as a child Calling this will emit canvasRemoved() if there was a canvas before, and will emit canvasSet() with the new canvas.

Paramètres:
canvas the new canvas. The KoCanvasBase::canvas() will be called to retrieve the actual widget which will then be added as child of this one.

Définition à la ligne 45 du fichier KoCanvasController.cpp.

Références canvas(), canvasRemoved(), canvasSet(), KoCanvasBase::canvasWidget(), m_canvas, m_viewport, KoCanvasController::Viewport::removeCanvas(), et KoCanvasController::Viewport::setCanvas().

Voici le graphe d'appel pour cette fonction :

KoCanvasBase * KoCanvasController::canvas (  )  const

Return the curently set canvas

Renvoie:
the curently set canvas

Définition à la ligne 57 du fichier KoCanvasController.cpp.

Références m_canvas.

Référencé par KoToolManager::addControllers(), KoToolManager::attachCanvas(), KoToolManager::movedFocus(), KoToolManager::removeCanvasController(), setCanvas(), KoToolManager::shapeController(), KoToolManager::switchTool(), KoToolManager::toolActivated(), et KoToolManager::updateCursor().

Voici le graphe d'appel pour cette fonction :

int KoCanvasController::visibleHeight (  )  const

return the amount of pixels vertically visible of the child canvas.

Renvoie:
the amount of pixels vertically visible of the child canvas.

Définition à la ligne 61 du fichier KoCanvasController.cpp.

Références KoPageFormat::height(), m_canvasWidget, et m_viewport.

Voici le graphe d'appel pour cette fonction :

int KoCanvasController::visibleWidth (  )  const

return the amount of pixels horizontally visible of the child canvas.

Renvoie:
the amount of pixels horizontally visible of the child canvas.

Définition à la ligne 73 du fichier KoCanvasController.cpp.

Références m_canvasWidget, m_viewport, et KoPageFormat::width().

Voici le graphe d'appel pour cette fonction :

int KoCanvasController::canvasOffsetX (  )  const

return the amount of pixels that are not visible on the left side of the canvas. The leftmost pixel that is shown is returned.

Définition à la ligne 94 du fichier KoCanvasController.cpp.

Références KoCanvasBase::canvasWidget(), et m_canvas.

Référencé par updateCanvasOffsetX().

Voici le graphe d'appel pour cette fonction :

int KoCanvasController::canvasOffsetY (  )  const

return the amount of pixels that are not visible on the top side of the canvas. The topmost pixel that is shown is returned.

Définition à la ligne 108 du fichier KoCanvasController.cpp.

Références KoCanvasBase::canvasWidget(), et m_canvas.

Référencé par updateCanvasOffsetY().

Voici le graphe d'appel pour cette fonction :

void KoCanvasController::centerCanvas ( bool  centered  ) 

Set the canvas to be displayed centered in this widget. In the case that the canvas widget is smaller then this one the canvas will be centered and a contrasting color used for the background.

Paramètres:
centered center canvas if true, or aligned to the left (LTR) if false. Centered is the default value.

Définition à la ligne 85 du fichier KoCanvasController.cpp.

Références KoCanvasController::Viewport::centerCanvas(), m_centerCanvas, et m_viewport.

Voici le graphe d'appel pour cette fonction :

bool KoCanvasController::isCanvasCentered (  )  const

return the canvas centering value.

Renvoie:
the canvas centering value

Définition à la ligne 90 du fichier KoCanvasController.cpp.

Références m_centerCanvas.

bool KoCanvasController::eventFilter ( QObject *  watched,
QEvent *  event 
) [virtual]

Définition à la ligne 130 du fichier KoCanvasController.cpp.

Références KoCanvasBase::canvasWidget(), m_canvas, updateCanvasOffsetX(), et updateCanvasOffsetY().

Voici le graphe d'appel pour cette fonction :

void KoCanvasController::ensureVisible ( const QRectF &  rect  ) 

Scrolls the content of the canvas so that the given rect is visible.

The rect is to be specified in document coordinates. The scrollbar positions are changed so that the centerpoint of the rectangle is centered if possible.

Paramètres:
rect the rectangle to make visible

Définition à la ligne 176 du fichier KoCanvasController.cpp.

Références KoCanvasBase::canvasWidget(), KoCanvasBase::documentOrigin(), KoViewConverter::documentToView(), Py::int, m_canvas, m_viewport, et KoCanvasBase::viewConverter().

Référencé par ensureVisible().

Voici le graphe d'appel pour cette fonction :

Voici le graphe d'appel pour cette fonction :

void KoCanvasController::ensureVisible ( KoShape shape  ) 

Scrolls the content of the canvas so that the given shape is visible.

This is just a wrapper function of the above function.

Paramètres:
shape the shape to make visible

Définition à la ligne 171 du fichier KoCanvasController.cpp.

Références KoShape::boundingRect(), et ensureVisible().

Voici le graphe d'appel pour cette fonction :

void KoCanvasController::canvasRemoved ( KoCanvasController cv  )  [signal]

Emitted when a previously added canvas is about to be removed.

Paramètres:
cv this object

Référencé par setCanvas().

void KoCanvasController::canvasSet ( KoCanvasController cv  )  [signal]

Emitted when a canvas is set on this widget

Paramètres:
cv this object

Référencé par setCanvas().

void KoCanvasController::canvasOffsetXChanged ( int  offset  )  [signal]

Emited when canvasOffsetX() changes

Paramètres:
offset the new canvas offset

Référencé par updateCanvasOffsetX().

void KoCanvasController::canvasOffsetYChanged ( int  offset  )  [signal]

Emited when canvasOffsetY() changes

Paramètres:
offset the new canvas offset

Référencé par updateCanvasOffsetY().

void KoCanvasController::updateCanvasOffsetX (  )  [protected, slot]

Called by the horizontal scrollbar when it's value changes.

Définition à la ligne 122 du fichier KoCanvasController.cpp.

Références canvasOffsetX(), et canvasOffsetXChanged().

Référencé par eventFilter(), et KoCanvasController().

void KoCanvasController::updateCanvasOffsetY (  )  [protected, slot]

Called by the vertical scrollbar when it's value changes.

Définition à la ligne 126 du fichier KoCanvasController.cpp.

Références canvasOffsetY(), et canvasOffsetYChanged().

Référencé par eventFilter(), et KoCanvasController().


Documentation des données membres

KoCanvasBase* KoCanvasController::m_canvas [private]

Définition à la ligne 171 du fichier KoCanvasController.h.

Référencé par canvas(), canvasOffsetX(), canvasOffsetY(), ensureVisible(), eventFilter(), et setCanvas().

QWidget* KoCanvasController::m_canvasWidget [private]

Définition à la ligne 172 du fichier KoCanvasController.h.

Référencé par visibleHeight(), et visibleWidth().

Viewport* KoCanvasController::m_viewport [private]

Définition à la ligne 173 du fichier KoCanvasController.h.

Référencé par centerCanvas(), ensureVisible(), KoCanvasController(), setCanvas(), visibleHeight(), et visibleWidth().

bool KoCanvasController::m_centerCanvas [private]

Définition à la ligne 174 du fichier KoCanvasController.h.

Référencé par centerCanvas(), et isCanvasCentered().


La documentation de cette classe a été générée à partir des fichiers suivants :
Généré le Wed Nov 22 23:44:05 2006 pour KPlato par  doxygen 1.5.1-p1