kword

#include <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 TQString &viewMode, TQWidget *parent, KWDocument *d, KWGUI *lGui)
KWDocument * kWordDocument () const
KWGUI * gui () const
KWFrameViewManager * frameViewManager ()
KWFrameSetEdit * currentFrameSetEdit () const
void switchViewMode (const TQString &newViewMode)
KWViewMode * viewMode () const
void repaintAll (bool erase=false)
void repaintChanged (KWFrameSet *fs, bool resetChanged)
void viewportResizeEvent (TQResizeEvent *)
void print (TQPainter *painter, KPrinter *printer)
bool eventFilter (TQObject *o, TQEvent *e)
bool focusNextPrevChild (bool next)
void setFrameBackgroundColor (const TQBrush &backColor)
void editFrameProperties ()
void editFrameProperties (KWFrameSet *frameset)
void pasteFrames ()
void mpCreate (const TQPoint &normalPoint, bool noGrid)
void mpCreatePixmap (const TQPoint &normalPoint, bool noGrid)
void mmCreate (const TQPoint &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, TQSize pixmapSize, bool _keepRatio)
void insertPart (const KoDocumentEntry &entry)
void pasteImage (TQMimeSource *e, const KoPoint &docPoint)
void insertPictureDirect (const KoPicture &picture, const KoPoint &pos, const TQSize &sz=TQSize())
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)
TQString tableTemplateName () const
void setTableTemplateName (const TQString &_name)
void setPictureInline (bool _inline)
bool pictureInline () const
void setPictureKeepRatio (bool _keep)
bool pictureKeepRatio () const
void createTable (unsigned int rows, unsigned int cols, int wid, int hei, bool isFloating, KWTableTemplate *tt=0L, int format=31)
KWTableFrameSet * getCurrentTable () 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
KWTextFrameSetEdit * currentTextEdit () const
bool insertInlinePicture ()

Protected Member Functions

void drawGrid (TQPainter &p, const TQRect &rect)
virtual void drawContents (TQPainter *p, int cx, int cy, int cw, int ch)
void drawDocument (TQPainter *painter, const TQRect &crect, KWViewMode *viewMode)
void drawPageBorders (TQPainter *painter, const TQRect &crect, const TQRegion &emptySpaceRegion)
virtual void keyPressEvent (TQKeyEvent *e)
virtual void contentsMousePressEvent (TQMouseEvent *e)
virtual void contentsMouseMoveEvent (TQMouseEvent *e)
virtual void contentsMouseReleaseEvent (TQMouseEvent *e)
virtual void contentsMouseDoubleClickEvent (TQMouseEvent *e)
virtual void contentsDragEnterEvent (TQDragEnterEvent *e)
virtual void contentsDragMoveEvent (TQDragMoveEvent *e)
virtual void contentsDragLeaveEvent (TQDragLeaveEvent *e)
virtual void contentsDropEvent (TQDropEvent *e)
virtual void resizeEvent (TQResizeEvent *e)
KWTableFrameSet * createTable ()
void terminateCurrentEdit ()
bool insertInlineTable ()

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.

Member Enumeration Documentation

◆ MouseMode

enum KWCanvas::MouseMode

Definition at line 112 of file KWCanvas.h.

Constructor & Destructor Documentation

◆ KWCanvas()

KWCanvas::KWCanvas ( const TQString & viewMode,
TQWidget * parent,
KWDocument * d,
KWGUI * lGui )

Definition at line 66 of file KWCanvas.cpp.

◆ ~KWCanvas()

KWCanvas::~KWCanvas ( )
virtual

Definition at line 171 of file KWCanvas.cpp.

Member Function Documentation

◆ applyGrid()

void KWCanvas::applyGrid ( KoPoint & p)

Definition at line 645 of file KWCanvas.cpp.

◆ caretPos()

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 2019 of file KWCanvas.cpp.

◆ checkCurrentEdit()

bool KWCanvas::checkCurrentEdit ( KWFrameSet * fs,
bool onlyText = false )

Definition at line 1307 of file KWCanvas.cpp.

◆ contentsDragEnterEvent()

void KWCanvas::contentsDragEnterEvent ( TQDragEnterEvent * e)
protectedvirtual

Definition at line 1462 of file KWCanvas.cpp.

◆ contentsDragLeaveEvent()

void KWCanvas::contentsDragLeaveEvent ( TQDragLeaveEvent * e)
protectedvirtual

Definition at line 1503 of file KWCanvas.cpp.

◆ contentsDragMoveEvent()

void KWCanvas::contentsDragMoveEvent ( TQDragMoveEvent * e)
protectedvirtual

Definition at line 1478 of file KWCanvas.cpp.

◆ contentsDropEvent()

void KWCanvas::contentsDropEvent ( TQDropEvent * e)
protectedvirtual

Definition at line 1509 of file KWCanvas.cpp.

◆ contentsMouseDoubleClickEvent()

void KWCanvas::contentsMouseDoubleClickEvent ( TQMouseEvent * e)
protectedvirtual

Definition at line 1135 of file KWCanvas.cpp.

◆ contentsMouseMoveEvent()

void KWCanvas::contentsMouseMoveEvent ( TQMouseEvent * e)
protectedvirtual

Definition at line 786 of file KWCanvas.cpp.

◆ contentsMousePressEvent()

void KWCanvas::contentsMousePressEvent ( TQMouseEvent * e)
protectedvirtual

Definition at line 410 of file KWCanvas.cpp.

◆ contentsMouseReleaseEvent()

void KWCanvas::contentsMouseReleaseEvent ( TQMouseEvent * e)
protectedvirtual

Definition at line 1065 of file KWCanvas.cpp.

◆ createTable() [1/2]

KWTableFrameSet * KWCanvas::createTable ( )
protected

Definition at line 1042 of file KWCanvas.cpp.

◆ createTable() [2/2]

void KWCanvas::createTable ( unsigned int rows,
unsigned int cols,
int wid,
int hei,
bool isFloating,
KWTableTemplate * tt = 0L,
int format = 31 )

Definition at line 580 of file KWCanvas.cpp.

◆ createTextBox()

KCommand * KWCanvas::createTextBox ( const KoRect & rect)

Definition at line 901 of file KWCanvas.cpp.

◆ currentFrameSetEdit()

KWFrameSetEdit * KWCanvas::currentFrameSetEdit ( ) const
inline

Definition at line 72 of file KWCanvas.h.

◆ currentTableCol()

int KWCanvas::currentTableCol ( ) const

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

Definition at line 1986 of file KWCanvas.cpp.

◆ currentTableRow()

int KWCanvas::currentTableRow ( ) const

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

Definition at line 1973 of file KWCanvas.cpp.

◆ currentTextEdit()

KWTextFrameSetEdit * KWCanvas::currentTextEdit ( ) const

Definition at line 1389 of file KWCanvas.cpp.

◆ dragStarted()

void KWCanvas::dragStarted ( )
inline

Definition at line 172 of file KWCanvas.h.

◆ drawContents()

void KWCanvas::drawContents ( TQPainter * p,
int cx,
int cy,
int cw,
int ch )
protectedvirtual

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

Definition at line 256 of file KWCanvas.cpp.

◆ drawDocument()

void KWCanvas::drawDocument ( TQPainter * painter,
const TQRect & crect,
KWViewMode * viewMode )
protected

The main drawing method.

Parameters
painterguess
crectthe area to be repainted, in contents coordinates
viewModethe view mode to be used (usually m_viewMode, except when printing)

Definition at line 271 of file KWCanvas.cpp.

◆ drawGrid()

void KWCanvas::drawGrid ( TQPainter & p,
const TQRect & rect )
protected

Definition at line 660 of file KWCanvas.cpp.

◆ drawPageBorders()

void KWCanvas::drawPageBorders ( TQPainter * painter,
const TQRect & crect,
const TQRegion & 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.

◆ editFrameProperties() [1/2]

void KWCanvas::editFrameProperties ( )

Definition at line 1213 of file KWCanvas.cpp.

◆ editFrameProperties() [2/2]

void KWCanvas::editFrameProperties ( KWFrameSet * frameset)

Definition at line 1204 of file KWCanvas.cpp.

◆ editFrameSet()

void KWCanvas::editFrameSet ( KWFrameSet * frameSet,
bool onlyText = false )

Definition at line 1251 of file KWCanvas.cpp.

◆ editTextFrameSet()

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.

◆ ensureCursorVisible()

void KWCanvas::ensureCursorVisible ( )

Definition at line 1299 of file KWCanvas.cpp.

◆ eventFilter()

bool KWCanvas::eventFilter ( TQObject * o,
TQEvent * e )

Definition at line 1700 of file KWCanvas.cpp.

◆ focusNextPrevChild()

bool KWCanvas::focusNextPrevChild ( bool next)

Definition at line 1923 of file KWCanvas.cpp.

◆ footNoteType()

NoteType KWCanvas::footNoteType ( ) const
inline

Definition at line 191 of file KWCanvas.h.

◆ frameViewManager()

KWFrameViewManager * KWCanvas::frameViewManager ( )
inline

Definition at line 71 of file KWCanvas.h.

◆ getCurrentTable()

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 162 of file KWCanvas.h.

◆ gui()

KWGUI * KWCanvas::gui ( ) const
inline

Definition at line 70 of file KWCanvas.h.

◆ inlinePictureStarted()

void KWCanvas::inlinePictureStarted ( )

Definition at line 1967 of file KWCanvas.cpp.

◆ insertInlinePicture()

bool KWCanvas::insertInlinePicture ( )

Definition at line 609 of file KWCanvas.cpp.

◆ insertInlineTable()

bool KWCanvas::insertInlineTable ( )
protected

Definition at line 617 of file KWCanvas.cpp.

◆ insertPart()

void KWCanvas::insertPart ( const KoDocumentEntry & entry)

Definition at line 1451 of file KWCanvas.cpp.

◆ insertPicture()

void KWCanvas::insertPicture ( const KoPicture & newPicture,
TQSize pixmapSize,
bool _keepRatio )

Definition at line 1431 of file KWCanvas.cpp.

◆ insertPictureDirect()

void KWCanvas::insertPictureDirect ( const KoPicture & picture,
const KoPoint & pos,
const TQSize & sz = TQSize() )

Definition at line 1441 of file KWCanvas.cpp.

◆ keyPressEvent()

void KWCanvas::keyPressEvent ( TQKeyEvent * e)
protectedvirtual

Definition at line 316 of file KWCanvas.cpp.

◆ kWordDocument()

KWDocument * KWCanvas::kWordDocument ( ) const
inline

Definition at line 69 of file KWCanvas.h.

◆ mmCreate()

void KWCanvas::mmCreate ( const TQPoint & normalPoint,
bool noGrid )

Definition at line 718 of file KWCanvas.cpp.

◆ mouseMode()

MouseMode KWCanvas::mouseMode ( ) const
inline

Definition at line 121 of file KWCanvas.h.

◆ mpCreate()

void KWCanvas::mpCreate ( const TQPoint & normalPoint,
bool noGrid )

Definition at line 358 of file KWCanvas.cpp.

◆ mpCreatePixmap()

void KWCanvas::mpCreatePixmap ( const TQPoint & normalPoint,
bool noGrid )

Definition at line 367 of file KWCanvas.cpp.

◆ mrCreateFormula()

void KWCanvas::mrCreateFormula ( )

Definition at line 993 of file KWCanvas.cpp.

◆ mrCreatePart()

void KWCanvas::mrCreatePart ( )

Definition at line 980 of file KWCanvas.cpp.

◆ mrCreatePixmap()

void KWCanvas::mrCreatePixmap ( )

Definition at line 940 of file KWCanvas.cpp.

◆ mrCreateTable()

void KWCanvas::mrCreateTable ( )

Definition at line 1010 of file KWCanvas.cpp.

◆ mrCreateText()

void KWCanvas::mrCreateText ( )

Definition at line 920 of file KWCanvas.cpp.

◆ mrEditFrame()

void KWCanvas::mrEditFrame ( )

Definition at line 886 of file KWCanvas.cpp.

◆ numberingFootNoteType()

KWFootNoteVariable::Numbering KWCanvas::numberingFootNoteType ( ) const
inline

Definition at line 192 of file KWCanvas.h.

◆ overwriteMode()

bool KWCanvas::overwriteMode ( ) const
inline

Definition at line 214 of file KWCanvas.h.

◆ pasteImage()

void KWCanvas::pasteImage ( TQMimeSource * e,
const KoPoint & docPoint )

Definition at line 1559 of file KWCanvas.cpp.

◆ pictureInline()

bool KWCanvas::pictureInline ( ) const
inline

Definition at line 150 of file KWCanvas.h.

◆ pictureKeepRatio()

bool KWCanvas::pictureKeepRatio ( ) const
inline

Definition at line 153 of file KWCanvas.h.

◆ print()

void KWCanvas::print ( TQPainter * painter,
KPrinter * printer )

Definition at line 212 of file KWCanvas.cpp.

◆ repaintAll()

void KWCanvas::repaintAll ( bool erase = false)

Definition at line 201 of file KWCanvas.cpp.

◆ repaintChanged()

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.

◆ resetStatusBarText()

void KWCanvas::resetStatusBarText ( )

Resets the status bar text.

Definition at line 2007 of file KWCanvas.cpp.

◆ resizeEvent()

void KWCanvas::resizeEvent ( TQResizeEvent * e)
protectedvirtual

Definition at line 1658 of file KWCanvas.cpp.

◆ scrollToOffset()

void KWCanvas::scrollToOffset ( const KoPoint & dPoint)

Definition at line 1664 of file KWCanvas.cpp.

◆ selectAllFrames()

void KWCanvas::selectAllFrames ( bool select)

Definition at line 1232 of file KWCanvas.cpp.

◆ setFootNoteType()

void KWCanvas::setFootNoteType ( NoteType _type)
inline

Definition at line 194 of file KWCanvas.h.

◆ setFrameBackgroundColor()

void KWCanvas::setFrameBackgroundColor ( const TQBrush & backColor)

Definition at line 1166 of file KWCanvas.cpp.

◆ setMouseMode()

void KWCanvas::setMouseMode ( MouseMode _mm)

Definition at line 1396 of file KWCanvas.cpp.

◆ setNumberingFootNoteType()

void KWCanvas::setNumberingFootNoteType ( KWFootNoteVariable::Numbering _type)
inline

Definition at line 195 of file KWCanvas.h.

◆ setPictureInline()

void KWCanvas::setPictureInline ( bool _inline)
inline

Definition at line 149 of file KWCanvas.h.

◆ setPictureKeepRatio()

void KWCanvas::setPictureKeepRatio ( bool _keep)
inline

Definition at line 152 of file KWCanvas.h.

◆ setTableCols()

void KWCanvas::setTableCols ( unsigned int cols)
inline

Definition at line 138 of file KWCanvas.h.

◆ setTableFormat()

void KWCanvas::setTableFormat ( int _nb)
inline

Definition at line 144 of file KWCanvas.h.

◆ setTableRows()

void KWCanvas::setTableRows ( unsigned int rows)
inline

Definition at line 136 of file KWCanvas.h.

◆ setTableTemplateName()

void KWCanvas::setTableTemplateName ( const TQString & _name)
inline

Definition at line 147 of file KWCanvas.h.

◆ setXimPosition()

void KWCanvas::setXimPosition ( int x,
int y,
int w,
int h )

Definition at line 1957 of file KWCanvas.cpp.

◆ switchViewMode()

void KWCanvas::switchViewMode ( const TQString & newViewMode)

Definition at line 352 of file KWCanvas.cpp.

◆ tableCols()

unsigned int KWCanvas::tableCols ( ) const
inline

Definition at line 137 of file KWCanvas.h.

◆ tableFormat()

int KWCanvas::tableFormat ( ) const
inline

Definition at line 142 of file KWCanvas.h.

◆ tableHeightMode()

int KWCanvas::tableHeightMode ( ) const
inline

Definition at line 140 of file KWCanvas.h.

◆ tableIsFloating()

bool KWCanvas::tableIsFloating ( ) const
inline

Definition at line 141 of file KWCanvas.h.

◆ tableRows()

unsigned int KWCanvas::tableRows ( ) const
inline

Definition at line 135 of file KWCanvas.h.

◆ tableSelectCell()

void KWCanvas::tableSelectCell ( KWTableFrameSet * table,
KWFrameSet * cell )

Definition at line 1244 of file KWCanvas.cpp.

◆ tableTemplateName()

TQString KWCanvas::tableTemplateName ( ) const
inline

Definition at line 146 of file KWCanvas.h.

◆ tableWidthMode()

int KWCanvas::tableWidthMode ( ) const
inline

Definition at line 139 of file KWCanvas.h.

◆ terminateCurrentEdit()

void KWCanvas::terminateCurrentEdit ( )
protected

Definition at line 1364 of file KWCanvas.cpp.

◆ updateCurrentFormat()

void KWCanvas::updateCurrentFormat ( )

Definition at line 1932 of file KWCanvas.cpp.

◆ updateRulerOffsets()

void KWCanvas::updateRulerOffsets ( int cx = -1,
int cy = -1 )

Definition at line 1682 of file KWCanvas.cpp.

◆ viewMode()

KWViewMode * KWCanvas::viewMode ( ) const
inline

Definition at line 75 of file KWCanvas.h.

◆ viewportResizeEvent()

void KWCanvas::viewportResizeEvent ( TQResizeEvent * )

We need to repaint if the window is resized.

Definition at line 207 of file KWCanvas.cpp.

◆ viewportScroll()

void KWCanvas::viewportScroll ( bool up)

Definition at line 1999 of file KWCanvas.cpp.

Member Data Documentation

◆ cols

unsigned int KWCanvas::cols

Definition at line 347 of file KWCanvas.h.

◆ floating

bool KWCanvas::floating

Definition at line 352 of file KWCanvas.h.

◆ format

int KWCanvas::format

Definition at line 349 of file KWCanvas.h.

◆ height

int KWCanvas::height

Definition at line 351 of file KWCanvas.h.

◆ keepRatio

bool KWCanvas::keepRatio

Definition at line 368 of file KWCanvas.h.

◆ noteType

NoteType KWCanvas::noteType

Definition at line 361 of file KWCanvas.h.

◆ numberingType

KWFootNoteVariable::Numbering KWCanvas::numberingType

Definition at line 362 of file KWCanvas.h.

◆ pictureInline

bool KWCanvas::pictureInline

Definition at line 367 of file KWCanvas.h.

◆ rows

unsigned int KWCanvas::rows

Definition at line 348 of file KWCanvas.h.

◆ tableTemplateName

TQString KWCanvas::tableTemplateName

Definition at line 353 of file KWCanvas.h.

◆ tt

KWTableTemplate* KWCanvas::tt

Definition at line 354 of file KWCanvas.h.

◆ width

int KWCanvas::width

Definition at line 350 of file KWCanvas.h.


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