KoView Class Reference
This class is used to display a KoDocument. More...
#include <koView.h>
Inheritance diagram for KoView:


Public Slots | |
virtual void | newView () |
virtual void | beginOperation () |
virtual void | endOperation () |
void | slotActionStatusText (const QString &text) |
void | slotClearStatusText () |
Signals | |
void | activated (bool active) |
void | selected (bool select) |
void | childSelected (KoDocumentChild *child) |
void | childUnselected (KoDocumentChild *child) |
void | childActivated (KoDocumentChild *child) |
void | childDeactivated (KoDocumentChild *child) |
void | regionInvalidated (const QRegion ®ion, bool erase) |
void | invalidated () |
void | embeddImage (const QString &filename) |
Public Member Functions | |
KoView (KoDocument *document, QWidget *parent=0, const char *name=0) | |
virtual | ~KoView () |
KoDocument * | koDocument () const |
void | setDocumentDeleted () |
bool | documentDeleted () const |
virtual void | setPartManager (KParts::PartManager *manager) |
virtual KParts::PartManager * | partManager () const |
virtual KAction * | action (const QDomElement &element) const |
virtual KoDocument * | hitTest (const QPoint &pos) |
virtual int | leftBorder () const |
virtual int | rightBorder () const |
virtual int | topBorder () const |
virtual int | bottomBorder () const |
virtual void | setZoom (double zoom) |
virtual double | zoom () const |
virtual QWidget * | canvas () |
virtual int | canvasXOffset () const |
virtual int | canvasYOffset () const |
virtual void | canvasAddChild (KoViewChild *child) |
virtual KoDocumentChild * | selectedChild () |
virtual KoDocumentChild * | activeChild () |
virtual void | paintEverything (QPainter &painter, const QRect &rect, bool transparent=false) |
bool | hasDocumentInWindow (KoDocument *doc) |
QWMatrix | matrix () const |
KoViewChild * | child (KoView *view) |
KoViewChild * | child (KoDocument *document) |
virtual DCOPObject * | dcopObject () |
virtual void | setupPrinter (KPrinter &printer) |
virtual void | print (KPrinter &printer) |
KoMainWindow * | shell () const |
KMainWindow * | mainWindow () const |
KStatusBar * | statusBar () const |
void | addStatusBarItem (QWidget *widget, int stretch=0, bool permanent=false) |
void | removeStatusBarItem (QWidget *widget) |
void | showAllStatusBarItems (bool show) |
virtual void | updateReadWrite (bool readwrite)=0 |
bool | isInOperation () const |
Protected Slots | |
virtual void | slotChildActivated (bool a) |
virtual void | slotChildChanged (KoDocumentChild *child) |
Protected Member Functions | |
virtual void | customEvent (QCustomEvent *ev) |
virtual void | partActivateEvent (KParts::PartActivateEvent *event) |
virtual void | partSelectEvent (KParts::PartSelectEvent *event) |
virtual void | guiActivateEvent (KParts::GUIActivateEvent *) |
Detailed Description
This class is used to display a KoDocument.Multiple views can be attached to one document at a time.
Definition at line 56 of file koView.h.
Constructor & Destructor Documentation
|
Creates a new view for the document. Usually you don't create views yourself since the KOffice components come with their own view classes which inherit KoView. The standard way to retrieve a KoView is to call KoDocument::createView.
Definition at line 108 of file koView.cc. References beginOperation(), endOperation(), KoDocument::setCurrent(), slotActionStatusText(), slotClearStatusText(), and statusBar(). |
|
Destroys the view and unregisters at the document.
Definition at line 160 of file koView.cc. References KoDocument::isSingleViewMode(), koDocument(), KoDocument::removeView(), and KoDocument::setCurrent(). |
Member Function Documentation
|
Retrieves the document object of this view.
Definition at line 177 of file koView.cc. Referenced by activeChild(), hitTest(), KoDocument::paintChild(), paintEverything(), partActivateEvent(), partSelectEvent(), KoMainWindow::print(), selectedChild(), and ~KoView(). |
|
Tells this view that its document has got deleted (called internally).
|
|
|
|
Returns the action described action object. In fact only the "name" attribute of element is of interest here. The method searches in the KActionCollection of this view. Please notice that KoView indirectly inherits KXMLGUIClient.
|
|
Retrieves the document that is hit. This can be an embedded document. The default implementation asks KoDocument::hitTest. This will iterate over all child documents to detect a hit. If your koffice component has multiple pages, like for example KSpread, then the hittest may not succeed for a child that is not on the visible page. In those cases you need to reimplement this method. Definition at line 228 of file koView.cc. References activeChild(), child(), KoDocumentChild::document(), KoChild::frameRegion(), KoDocument::hitTest(), koDocument(), matrix(), selectedChild(), and zoom(). |
|
Retrieves the left border width that is displayed around the content if the view is active. In a spread sheet this border is for example used to display the rows, while a top border is used to display the names of the cells and a right and bottom border is used to display scrollbars. If the view becomes inactive, then this stuff is not displayed anymore. KoFrame uses this border information. If an embedded document becomes active then it is resized so that it has enough space to display the borders and to display the same content as before the activation. So if for example all of your borders are 20 pixels, then activating the embedded document causes the KoView to move 20 pixels up/left and the size and width increases by 20+20 pixels each. The default border is 0. |
|
|
|
|
|
|
|
Scales the view on the content. This does not affect the contents data structures. You can use this mechanism to implement a zoom for example. The method calls QWidget::update so that the scaled content is automatically displayed. The default scaling is 1.0 in both orientations. Definition at line 290 of file koView.cc. Referenced by KoViewChild::KoViewChild(). |
|
Definition at line 296 of file koView.cc. Referenced by hitTest(), KoViewChild::KoViewChild(), and matrix(). |
|
Overload this function if the content will be displayed on some child widget instead of the view directly. By default this function returns a pointer to the view. Definition at line 301 of file koView.cc. Referenced by beginOperation(), and endOperation(). |
|
Overload this function if the content will be displayed with an offset relative to the upper left corner of the canvas widget. By default this function returns 0. Definition at line 306 of file koView.cc. Referenced by KoViewChild::KoViewChild(), and partSelectEvent(). |
|
Overload this function if the content will be displayed with an offset relative to the upper left corner of the canvas widget. By default this function returns 0. Definition at line 311 of file koView.cc. Referenced by KoViewChild::KoViewChild(), and partSelectEvent(). |
|
Overload this function if you need to perform some actions after KoView (the part widget) is inserted into canvas. You should call for example addChild(QWidget*) method of QScrollView here, if canvas is a viewport of QScrollView. By default this function does nothing. Definition at line 316 of file koView.cc. Referenced by KoViewChild::KoViewChild(). |
|
Definition at line 441 of file koView.cc. References KoDocument::child(), and koDocument(). Referenced by hitTest(). |
|
Definition at line 454 of file koView.cc. References KoDocument::child(), and koDocument(). Referenced by hitTest(). |
|
calls KoDocument::paintEverything()
Definition at line 467 of file koView.cc. References koDocument(), and KoDocument::paintEverything(). |
|
Definition at line 192 of file koView.cc. References child(). |
|
Returns the matrix which is used by the view to transform the content. Currently only scaling is supported. The matrix changes when calling setZoom. Definition at line 492 of file koView.cc. References zoom(). Referenced by hitTest(), partActivateEvent(), and partSelectEvent(). |
|
Definition at line 472 of file koView.cc. Referenced by hasDocumentInWindow(), hitTest(), partActivateEvent(), and partSelectEvent(). |
|
A convenience function which returns the KoViewChild which in turn holds the KoView that in turn holds the
|
|
Return a DCOP interface for this view KOffice Applications are strongly recommended to reimplement this method, so that their dcop interface provides more functionality than the basic KoViewIface.
|
|
Overload this method to setup KPrinter before the actual printing.
Definition at line 567 of file koView.cc. Referenced by KoMainWindow::print(), and KoMainWindow::slotFilePrintPreview(). |
|
Overload this method with your own printing code.
Definition at line 572 of file koView.cc. Referenced by KoMainWindow::print(), and KoMainWindow::slotFilePrintPreview(). |
|
Definition at line 605 of file koView.cc. Referenced by newView(), and statusBar(). |
|
|
|
Definition at line 615 of file koView.cc. References shell(). Referenced by addStatusBarItem(), KoView(), removeStatusBarItem(), showAllStatusBarItems(), slotActionStatusText(), and slotClearStatusText(). |
|
This adds a widget to the statusbar for this view. If you use this method instead of using statusBar() directly, KoView will take care of removing the items when the view GUI is deactivated and readding them when it is reactivated. The parameters are the same as QStatusBar::addWidget(). Note that you can't use KStatusBar methods (inserting text items by id). But you can create a KStatusBarLabel with a dummy id instead, and use it directly, to get the same look and feel. Definition at line 414 of file koView.cc. References statusBar(). |
|
Remove a widget from the statusbar for this view.
Definition at line 425 of file koView.cc. References statusBar(). |
|
Show or hide all statusbar items. Used by KoMainWindow during saving. Definition at line 401 of file koView.cc. References statusBar(). Referenced by guiActivateEvent(). |
|
You have to implement this method and disable/enable certain functionality (actions for example) in your view to allow/disallow editing of the document.
Referenced by KoDocument::addView(). |
|
Check to see if the view is currently in the middle of an operation which means that there will be no screen refreshes until a signal from the document hits the endOperation slot.
|
|
Slot to create a new view around the contained koDocument.
Definition at line 577 of file koView.cc. References KoMainWindow::setRootDocument(), and shell(). |
|
Slot to allow code to signal the beginning of an operation where the screen should not update until it is done.
Definition at line 591 of file koView.cc. References canvas(). Referenced by KoView(). |
|
Slot to allow code to signal the end of an operation where the screen should not have been updating. So now it will update.
Definition at line 597 of file koView.cc. References canvas(). Referenced by KoView(). |
|
Display a message in the status bar (calls QStatusBar::message()) TODO: rename to something more generic.
Definition at line 621 of file koView.cc. References statusBar(). Referenced by KoView(). |
|
End of the message in the status bar (calls QStatusBar::clear()) TODO: rename to something more generic.
Definition at line 628 of file koView.cc. References statusBar(). Referenced by KoView(). |
|
This method handles three events: KParts::PartActivateEvent, KParts::PartSelectEvent and KParts::GUIActivateEvent. The respective handlers are called if such an event is found. Definition at line 320 of file koView.cc. References guiActivateEvent(), partActivateEvent(), and partSelectEvent(). |
|
Handles the event KParts::PartActivateEvent.
Definition at line 330 of file koView.cc. References KoDocument::child(), child(), KoDocumentChild::document(), KoViewChild::frame(), KoChild::frameRegion(), KoChild::isRectangle(), KoChild::isTransparent(), koDocument(), and matrix(). Referenced by customEvent(). |
|
Handles the event KParts::PartSelectEvent.
Definition at line 367 of file koView.cc. References canvasXOffset(), canvasYOffset(), KoDocument::child(), child(), KoChild::frameRegion(), koDocument(), and matrix(). Referenced by customEvent(). |
|
Handles the event KParts::GUIActivateEvent.
Definition at line 396 of file koView.cc. References showAllStatusBarItems(). Referenced by customEvent(). |
|
Make it possible for plugins to request the embedding of an image into the current document. Used e.g. by the scan-plugin |
The documentation for this class was generated from the following files: