#include <KoCanvasController.h>
Graphe de collaboration de KoCanvasController:
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) |
KoCanvasBase * | canvas () 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 | |
KoCanvasBase * | m_canvas |
QWidget * | m_canvasWidget |
Viewport * | m_viewport |
bool | m_centerCanvas |
Classes | |
class | Viewport |
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.
KoCanvasController::KoCanvasController | ( | QWidget * | parent | ) |
Constructor.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
cv | this object |
Référencé par setCanvas().
void KoCanvasController::canvasSet | ( | KoCanvasController * | cv | ) | [signal] |
void KoCanvasController::canvasOffsetXChanged | ( | int | offset | ) | [signal] |
Emited when canvasOffsetX() changes
offset | the new canvas offset |
Référencé par updateCanvasOffsetX().
void KoCanvasController::canvasOffsetYChanged | ( | int | offset | ) | [signal] |
Emited when canvasOffsetY() changes
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().
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().