lib Library API Documentation

KoTextView Class Reference

Object that is created to edit a KoTextObject. More...

#include <kotextview.h>

Inheritance diagram for KoTextView:

Inheritance graph
[legend]
Collaboration diagram for KoTextView:

Collaboration graph
[legend]
List of all members.

Public Types

enum  CursorAction {
  MoveBackward, MoveForward, MoveWordBackward, MoveWordForward,
  MoveUp, MoveDown, MoveLineStart, MoveLineEnd,
  MoveHome, MoveEnd, MovePgUp, MovePgDown,
  MoveParagUp, MoveParagDown, MoveViewportUp, MoveViewportDown
}

Public Slots

virtual void updateUI (bool updateFormat, bool force=false)
virtual void ensureCursorVisible ()=0
void showCurrentFormat ()
void hideCursor ()
void showCursor ()
void insertText (const QString &text)
void newParagraph ()
QString refLink () const
void openLink ()
void copyLink ()
void removeLink ()
void completion ()

Signals

void copy ()
void cut ()
void paste ()

Public Member Functions

 KoTextView (KoTextObject *textobj)
virtual KoTextViewIface * dcopObject ()
void terminate (bool removeselection=true)
KoTextObjecttextObject () const
KoTextCursor * cursor () const
KoTextDocument * textDocument () const
bool isReadWrite () const
void setReadWrite (bool b)
virtual KoTextFormatcurrentFormat () const
void setCurrentFormat (KoTextFormat *fmt)
virtual const KoParagLayoutcurrentParagLayoutFormat () const
virtual bool rtl () const
virtual KCommand * setChangeCaseOfTextCommand (KoChangeCaseDia::TypeOfCase _type)
virtual KCommand * setParagLayoutFormatCommand (KoParagLayout *newLayout, int flags, int marginIndex=-1)
virtual KCommand * setFormatCommand (const KoTextFormat *newFormat, int flags, bool zoomFont=false)
KCommand * setCounterCommand (const KoParagCounter &counter)
KCommand * setAlignCommand (int align)
KCommand * setPageBreakingCommand (int pageBreaking)
KCommand * setLineSpacingCommand (double spacing, KoParagLayout::SpacingType _type)
KCommand * setBordersCommand (const KoBorder &leftBorder, const KoBorder &rightBorder, const KoBorder &bottomBorder, const KoBorder &topBorder)
KCommand * setMarginCommand (QStyleSheetItem::Margin m, double margin)
KCommand * setTabListCommand (const KoTabulatorList &tabList)
void applyStyle (const KoStyle *style)
void dragStarted ()
void focusInEvent ()
void focusOutEvent ()
void handleKeyPressEvent (QKeyEvent *e)
void handleKeyReleaseEvent (QKeyEvent *e)
bool handleMousePressEvent (QMouseEvent *e, const QPoint &iPoint, bool canStartDrag=true, bool insertDirectCursor=false)
void handleMouseMoveEvent (QMouseEvent *e, const QPoint &iPoint)
void handleMouseReleaseEvent ()
void handleMouseDoubleClickEvent (QMouseEvent *e, const QPoint &iPoint)
void handleMouseTripleClickEvent (QMouseEvent *e, const QPoint &)
bool maybeStartDrag (QMouseEvent *e)
KoTextCursor selectWordUnderCursor (const KoTextCursor &cursor, int selectionId=KoTextDocument::Standard)
KoTextCursor selectParagUnderCursor (const KoTextCursor &cursor, int selectionId=KoTextDocument::Standard, bool copyAndNotify=true)
void extendParagraphSelection (const QPoint &iPoint)
QString wordUnderCursor (const KoTextCursor &cursor)
QPtrList< KAction > dataToolActionList (KInstance *instance, const QString &word, bool &_singleWord)
void insertSoftHyphen ()
void insertLineBreak ()
void insertNonbreakingSpace ()
void insertSpecialChar (QChar _c, const QString &font)
void changeCaseOfText (KoChangeCaseDia::TypeOfCase _type)
void addBookmarks (const QString &)
KoVariablevariable ()
KoLinkVariable * linkVariable ()
KCommand * dropEvent (KoTextObject *tmp, KoTextCursor dropCursor, bool dropInSameObj)
void removeComment ()
void copyTextOfComment ()
KoStylecreateStyleFromSelection (const QString &name)
void updateStyleFromSelection (KoStyle *style)
QString underCursorWord ()
void moveCursor (CursorAction action, bool select)
bool moveCursor (CursorAction action)

Protected Slots

virtual void startDrag ()=0
void slotToolActivated (const KDataToolInfo &info, const QString &command)

Protected Member Functions

virtual void doAutoFormat (KoTextCursor *, KoTextParag *, int, QChar)
virtual void doCompletion (KoTextCursor *, KoTextParag *, int)
virtual bool doIgnoreDoubleSpace (KoTextParag *, int, QChar)
virtual void showFormat (KoTextFormat *format)=0
virtual void drawCursor (bool b)
bool placeCursor (const QPoint &pos, bool insertDirectCursor=false)
virtual bool pgUpKeyPressed ()=0
virtual bool pgDownKeyPressed ()=0
virtual void ctrlPgUpKeyPressed ()
virtual void ctrlPgDownKeyPressed ()
void deleteWordLeft ()
void deleteWordRight ()
bool insertParagraph (const QPoint &pos)

Protected Attributes

KoTextViewIface * dcop

Detailed Description

Object that is created to edit a KoTextObject.

It handles all the events for it (mouse, keyboard). There can be several KoTextView instances for the same KoTextObject.

Definition at line 51 of file kotextview.h.


Constructor & Destructor Documentation

KoTextView::KoTextView KoTextObject textobj  ) 
 

Constructor.

A KoTextView is associated to a KoTextObject. Don't forget to call updateUI(true,true) in your derived constructor

Definition at line 56 of file kotextview.cc.

References KoTextObject::formatMore(), startDrag(), KoTextObject::textDocument(), and updateUI().


Member Function Documentation

void KoTextView::terminate bool  removeselection = true  ) 
 

don't remove selection when we made dnd between different frame

Definition at line 112 of file kotextview.cc.

References KoTextObject::clearUndoRedoInfo(), and KoTextObject::selectionChangedNotify().

bool KoTextView::isReadWrite  )  const [inline]
 

Return true if the view is allowed to modify the text object.

This is the case by default

Definition at line 74 of file kotextview.h.

void KoTextView::setReadWrite bool  b  )  [inline]
 

Call setReadWrite(false) to make the text view readonly.

Definition at line 76 of file kotextview.h.

virtual KoTextFormat* KoTextView::currentFormat  )  const [inline, virtual]
 

Interface for accessing the current format.

Implements KoTextFormatInterface.

Definition at line 78 of file kotextview.h.

Referenced by updateUI().

const KoParagLayout * KoTextView::currentParagLayoutFormat  )  const [virtual]
 

Use this format for displaying the properties (Align/counter/...) of the object.

Implements KoTextFormatInterface.

Definition at line 1146 of file kotextview.cc.

KCommand * KoTextView::setParagLayoutFormatCommand KoParagLayout newLayout,
int  flags,
int  marginIndex = -1
[virtual]
 

Interface for changing the paragraph layout.

Parameters:
flags one of the KoParagLayout flags
marginIndex type of margin. Only used if flags==KoParagLayout::Margins

Implements KoTextFormatInterface.

Definition at line 1158 of file kotextview.cc.

References KoParagLayout::alignment, KoParagLayout::counter, KoTextObject::emitNewCommand(), KoParagLayout::margins, KoTextObject::setAlignCommand(), KoTextObject::setCounterCommand(), KoTextObject::setMarginCommand(), KoTextObject::setParagLayoutFormatCommand(), KoTextObject::setTabListCommand(), and KoParagLayout::tabList().

KCommand * KoTextView::setFormatCommand const KoTextFormat newFormat,
int  flags,
bool  zoomFont = false
[virtual]
 

Implement the KoTextFormatInterface.

Implements KoTextFormatInterface.

Definition at line 868 of file kotextview.cc.

References KoTextObject::setFormatCommand().

QPtrList< KAction > KoTextView::dataToolActionList KInstance *  instance,
const QString word,
bool &  _singleWord
 

Return the list of actions from data-tools.

Used to populate a RMB popupmenu usually.

Definition at line 980 of file kotextview.cc.

References KoTextObject::hasSelection(), KoTextObject::protectContent(), and KoTextObject::selectedText().

KoVariable * KoTextView::variable  ) 
 

### shouldn't be a member var, but should be determined here

Definition at line 963 of file kotextview.cc.

void KoTextView::updateUI bool  updateFormat,
bool  force = false
[virtual, slot]
 

Show the current settings (those for the paragraph and character under the cursor), in the GUI.

The default implementation handles m_currentFormat and calls showCurrentFormat(). If you reimplement, make sure to call KoTextView::updateUI(updateFormat,force);

Definition at line 888 of file kotextview.cc.

References currentFormat(), KoTextFormat::isMisspelled(), KoTextFormat::key(), KoTextFormat::removeRef(), and KoTextFormat::setMisspelled().

Referenced by KoTextView().

void KoTextView::insertText const QString text  )  [slot]
 

This is a slot so that it's accessible from DCOP.

Definition at line 372 of file kotextview.cc.

References KoTextObject::insert().

virtual void KoTextView::startDrag  )  [protected, pure virtual, slot]
 

Start a drag.

Referenced by KoTextView().

virtual void KoTextView::doAutoFormat KoTextCursor *  ,
KoTextParag *  ,
int  ,
QChar 
[inline, protected, virtual]
 

Called when a character (ch) has been inserted into parag, at the given index.

This is a virtual method rather than a signal for performance reasons.

Definition at line 192 of file kotextview.h.

virtual void KoTextView::showFormat KoTextFormat format  )  [protected, pure virtual]
 

Show the settings of this format in the GUI.

Needs to be implemented in the application.

void KoTextView::drawCursor bool  b  )  [protected, virtual]
 

Draws the cursor (or hides it if b is false).

The default implementation only changes an internal flag, make sure to reimplement and to call the parent implementation (in all cases)

Definition at line 845 of file kotextview.cc.

virtual bool KoTextView::pgUpKeyPressed  )  [protected, pure virtual]
 

Reimplement this to handle PageUp.

Example implementation: textView->cursor()->gotoPageUp( scrollview->visibleHeight() );

Referenced by ctrlPgUpKeyPressed().

virtual bool KoTextView::pgDownKeyPressed  )  [protected, pure virtual]
 

Reimplement this to handle PageDown.

Example implementation: textView->cursor()->gotoPageDown( scrollview->visibleHeight() );

Referenced by ctrlPgDownKeyPressed().

virtual void KoTextView::ctrlPgUpKeyPressed  )  [inline, protected, virtual]
 

Reimplement this to handle CTRL+PageUp.

Default implementation calls pgUpKeyPressed

Definition at line 220 of file kotextview.h.

References pgUpKeyPressed().

virtual void KoTextView::ctrlPgDownKeyPressed  )  [inline, protected, virtual]
 

Reimplement this to handle CTRL+PageDown.

Default implementation calls pgDownKeyPressed

Definition at line 222 of file kotextview.h.

References pgDownKeyPressed().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 11 11:50:25 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003