kword

KWCanvas Class Reference

#include <KWCanvas.h>

List of all members.


Detailed Description

Class: KWCanvas This class is responsible for the rendering of the frames to the screen as well as the interaction with the user via mouse and keyboard.

There is one per view.

Definition at line 60 of file KWCanvas.h.


Public Types

enum  MouseMode {
  MM_EDIT = 0, MM_CREATE_TEXT = 2, MM_CREATE_PIX = 3, MM_CREATE_TABLE = 5,
  MM_CREATE_FORMULA = 6, MM_CREATE_PART = 7
}

Signals

void currentFrameSetEditChanged ()
void selectionChanged (bool hasSelection)
void currentMouseModeChanged (int newMouseMode)
void frameSelectedChanged ()
void docStructChanged (int _type)
void overwriteModeChanged (bool m_overwriteMode)
void viewTransformationsChanged ()
void updateRuler ()

Public Member Functions

 KWCanvas (const QString &viewMode, QWidget *parent, KWDocument *d, KWGUI *lGui)
virtual ~KWCanvas ()
KWDocumentkWordDocument () const
KWGUIgui () const
KWFrameViewManagerframeViewManager ()
KWFrameSetEditcurrentFrameSetEdit () const
void switchViewMode (const QString &newViewMode)
KWViewModeviewMode () const
void repaintAll (bool erase=false)
void repaintChanged (KWFrameSet *fs, bool resetChanged)
void viewportResizeEvent (QResizeEvent *)
void print (QPainter *painter, KPrinter *printer)
bool eventFilter (QObject *o, QEvent *e)
bool focusNextPrevChild (bool next)
void setFrameBackgroundColor (const QBrush &backColor)
void editFrameProperties ()
void editFrameProperties (KWFrameSet *frameset)
void pasteFrames ()
void mpCreate (const QPoint &normalPoint, bool noGrid)
void mpCreatePixmap (const QPoint &normalPoint, bool noGrid)
void mmCreate (const QPoint &normalPoint, bool noGrid)
void mrEditFrame ()
void mrCreateText ()
void mrCreatePixmap ()
void mrCreatePart ()
void mrCreateFormula ()
void mrCreateTable ()
void setMouseMode (MouseMode _mm)
MouseMode mouseMode () const
void insertPicture (const KoPicture &newPicture, QSize pixmapSize, bool _keepRatio)
void insertPart (const KoDocumentEntry &entry)
void pasteImage (QMimeSource *e, const KoPoint &docPoint)
void insertPictureDirect (const KoPicture &picture, const KoPoint &pos, const QSize &sz=QSize())
void updateCurrentFormat ()
void updateFrameFormat ()
unsigned int tableRows () const
void setTableRows (unsigned int rows)
unsigned int tableCols () const
void setTableCols (unsigned int cols)
int tableWidthMode () const
int tableHeightMode () const
bool tableIsFloating () const
int tableFormat () const
void setTableFormat (int _nb)
QString tableTemplateName () const
void setTableTemplateName (const QString &_name)
void setPictureInline (bool _inline)
bool pictureInline () const
void setPictureKeepRatio (bool _keep)
bool pictureKeepRatio () const
void createTable (unsigned int rows, unsigned int cols, intwid, inthei, bool isFloating, KWTableTemplate *tt=0L, int format=31)
KWTableFrameSetgetCurrentTable () const
int currentTableRow () const
int currentTableCol () const
void scrollToOffset (const KoPoint &dPoint)
void dragStarted ()
void setXimPosition (int x, int y, int w, int h)
void updateRulerOffsets (int cx=-1, int cy=-1)
void inlinePictureStarted ()
void ensureCursorVisible ()
void editFrameSet (KWFrameSet *frameSet, bool onlyText=false)
void editTextFrameSet (KWFrameSet *fs, KoTextParag *parag, int index)
bool checkCurrentEdit (KWFrameSet *fs, bool onlyText=false)
NoteType footNoteType () const
KWFootNoteVariable::Numbering numberingFootNoteType () const
void setFootNoteType (NoteType _type)
void setNumberingFootNoteType (KWFootNoteVariable::Numbering _type)
void tableSelectCell (KWTableFrameSet *table, KWFrameSet *cell)
void selectAllFrames (bool select)
KCommand * createTextBox (const KoRect &rect)
void viewportScroll (bool up)
void resetStatusBarText ()
KoPoint caretPos ()
void applyGrid (KoPoint &p)
bool overwriteMode () const
KWTextFrameSetEditcurrentTextEdit () const
bool insertInlinePicture ()

Protected Member Functions

void drawGrid (QPainter &p, const QRect &rect)
virtual void drawContents (QPainter *p, int cx, int cy, int cw, int ch)
void drawDocument (QPainter *painter, const QRect &crect, KWViewMode *viewMode)
void drawPageBorders (QPainter *painter, const QRect &crect, const QRegion &emptySpaceRegion)
virtual void keyPressEvent (QKeyEvent *e)
virtual void contentsMousePressEvent (QMouseEvent *e)
virtual void contentsMouseMoveEvent (QMouseEvent *e)
virtual void contentsMouseReleaseEvent (QMouseEvent *e)
virtual void contentsMouseDoubleClickEvent (QMouseEvent *e)
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
virtual void resizeEvent (QResizeEvent *e)
KWTableFrameSetcreateTable ()
void terminateCurrentEdit ()
bool insertInlineTable ()

Member Function Documentation

KoPoint KWCanvas::caretPos  ) 
 

Returns the caret position in document coordinates.

The current frame must be editable, i.e., a caret is possible.

Definition at line 2002 of file KWCanvas.cpp.

int KWCanvas::currentTableCol  )  const
 

When the cursor is in a table cell, this returns the column.

Definition at line 1969 of file KWCanvas.cpp.

int KWCanvas::currentTableRow  )  const
 

When the cursor is in a table cell, this returns the row.

Definition at line 1956 of file KWCanvas.cpp.

void KWCanvas::drawContents QPainter *  p,
int  cx,
int  cy,
int  cw,
int  ch
[protected, virtual]
 

Reimplemented from QScrollView, to draw the contents of the canvas.

Definition at line 256 of file KWCanvas.cpp.

void KWCanvas::drawDocument QPainter *  painter,
const QRect &  crect,
KWViewMode viewMode
[protected]
 

The main drawing method.

Parameters:
painter guess
crect the area to be repainted, in contents coordinates
viewMode the view mode to be used (usually m_viewMode, except when printing)

Definition at line 271 of file KWCanvas.cpp.

void KWCanvas::drawPageBorders QPainter *  painter,
const QRect &  crect,
const QRegion &  emptySpaceRegion
[protected]
 

Draw page borders, but also clear up the space between the frames and the page borders, draw the page shadow, and the gray area.

void KWCanvas::editTextFrameSet KWFrameSet fs,
KoTextParag *  parag,
int  index
 

Starting editing fs if we're not yet doing it.

In all cases, position the cursor at parag and index.

Definition at line 1261 of file KWCanvas.cpp.

KWTableFrameSet* KWCanvas::getCurrentTable  )  const [inline]
 

The current table (either because one or more cells are selected, or because the cursor is in a table cell.

Definition at line 161 of file KWCanvas.h.

void KWCanvas::repaintChanged KWFrameSet fs,
bool  resetChanged
 

Only repaint the frameset fs.

resetChanged should only be true for the last view (see KWFrameSet::drawContents)

Definition at line 186 of file KWCanvas.cpp.

void KWCanvas::resetStatusBarText  ) 
 

Resets the status bar text.

Definition at line 1990 of file KWCanvas.cpp.

void KWCanvas::viewportResizeEvent QResizeEvent *   ) 
 

We need to repaint if the window is resized.

Definition at line 207 of file KWCanvas.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys