lib

KoTextView Class Reference

#include <KoTextView.h>

Inheritance diagram for KoTextView:

KoTextFormatInterface List of all members.

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 53 of file KoTextView.h.


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 ()
void copyLink ()
void removeLink ()
void completion ()
void setCursor (KoTextCursor *_cursor)

Signals

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

Public Member Functions

 KoTextView (KoTextObject *textobj)
virtual ~KoTextView ()
void setBackSpeller (KoBgSpellCheck *backSpeller)
virtual KoTextViewIfacedcopObject ()
void terminate (bool removeselection=true)
KoTextObjecttextObject () const
KoTextCursorcursor () const
void setCursor (const KoTextCursor &cursor)
KoTextDocumenttextDocument () const
bool isReadWrite () const
void setReadWrite (bool b)
virtual KoTextFormatcurrentFormat () const
void setCurrentFormat (KoTextFormat *fmt)
virtual const KoParagLayoutcurrentParagLayoutFormat () const
virtual bool rtl () const
virtual KCommandsetChangeCaseOfTextCommand (KoChangeCaseDia::TypeOfCase _type)
virtual KCommandsetParagLayoutFormatCommand (KoParagLayout *newLayout, int flags, int marginIndex=-1)
virtual KCommandsetFormatCommand (const KoTextFormat *newFormat, int flags, bool zoomFont=false)
KCommandsetCounterCommand (const KoParagCounter &counter)
KCommandsetAlignCommand (int align)
KCommandsetPageBreakingCommand (int pageBreaking)
KCommandsetLineSpacingCommand (double spacing, KoParagLayout::SpacingType _type)
KCommandsetBordersCommand (const KoBorder &leftBorder, const KoBorder &rightBorder, const KoBorder &bottomBorder, const KoBorder &topBorder)
KCommandsetJoinBordersCommand (bool join)
KCommandsetMarginCommand (QStyleSheetItem::Margin m, double margin)
KCommandsetTabListCommand (const KoTabulatorList &tabList)
KCommandsetBackgroundColorCommand (const QColor &color)
void applyStyle (const KoParagStyle *style)
void dragStarted ()
void focusInEvent ()
void focusOutEvent ()
void handleKeyPressEvent (QKeyEvent *e, QWidget *, const QPoint &)
void handleKeyReleaseEvent (QKeyEvent *e)
void handleImStartEvent (QIMEvent *e)
void handleImComposeEvent (QIMEvent *e)
void handleImEndEvent (QIMEvent *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< KActiondataToolActionList (KInstance *instance, const QString &word, bool &_singleWord)
void insertSoftHyphen ()
void insertLineBreak ()
void insertNonbreakingSpace ()
void insertNonbreakingHyphen ()
void increaseNumberingLevel (const KoStyleCollection *styleCollection)
void decreaseNumberingLevel (const KoStyleCollection *styleCollection)
void insertSpecialChar (QChar _c, const QString &font)
void changeCaseOfText (KoChangeCaseDia::TypeOfCase _type)
void addBookmarks (const QString &)
KoVariablevariable ()
KoLinkVariablelinkVariable ()
KCommandprepareDropMove (KoTextCursor dropCursor)
void removeComment ()
void copyTextOfComment ()
KoParagStylecreateStyleFromSelection (const QString &name)
void updateStyleFromSelection (KoParagStyle *style)
QString currentWordOrSelection () const
virtual void removeToolTipCompletion ()
bool placeCursor (const QPoint &pos, bool insertDirectCursor=false)
void setOverwriteMode (bool overwriteMode)
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 bool doCompletion (KoTextCursor *, KoTextParag *, int)
virtual bool doToolTipCompletion (KoTextCursor *, KoTextParag *, int, int)
virtual void showToolTipBox (KoTextParag *, int, QWidget *, const QPoint &)
virtual void textIncreaseIndent ()
virtual bool textDecreaseIndent ()
virtual bool doIgnoreDoubleSpace (KoTextParag *, int, QChar)
virtual void showFormat (KoTextFormat *format)=0
virtual void drawCursor (bool b)
virtual bool openLink (KoLinkVariable *linkVariable)
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

KoTextViewIfacedcop

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 65 of file KoTextView.cpp.


Member Function Documentation

void KoTextView::terminate ( bool  removeselection = true  ) 

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

Definition at line 123 of file KoTextView.cpp.

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 79 of file KoTextView.h.

void KoTextView::setReadWrite ( bool  b  )  [inline]

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

Definition at line 81 of file KoTextView.h.

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

Interface for accessing the current format.

Implements KoTextFormatInterface.

Definition at line 83 of file KoTextView.h.

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

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

..) of the object

Implements KoTextFormatInterface.

Definition at line 1263 of file KoTextView.cpp.

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

Interface for changing the paragraph layout.

Parameters:
newLayout pointer to the new layout to apply
flags one of the KoParagLayout flags
marginIndex type of margin. Only used if flags==KoParagLayoutMargins

Implements KoTextFormatInterface.

Definition at line 1274 of file KoTextView.cpp.

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

Implement the KoTextFormatInterface.

Implements KoTextFormatInterface.

Definition at line 974 of file KoTextView.cpp.

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 1090 of file KoTextView.cpp.

KCommand * KoTextView::prepareDropMove ( KoTextCursor  dropCursor  ) 

A "drop move" will move the selected text to the given cursor position.

This method only takes care of "removing the selected text" if the drop cursor isn't in the selected text (and !protectContent).

Definition at line 1374 of file KoTextView.cpp.

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 994 of file KoTextView.cpp.

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

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

Definition at line 412 of file KoTextView.cpp.

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

Start a drag.

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 211 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 950 of file KoTextView.cpp.

bool KoTextView::openLink ( KoLinkVariable linkVariable  )  [protected, virtual]

Called when clicking on a link.

Definition at line 1199 of file KoTextView.cpp.

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

Reimplement this to handle PageUp.

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

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

Reimplement this to handle PageDown.

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

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

Reimplement this to handle CTRL+PageUp.

Default implementation calls pgUpKeyPressed

Definition at line 244 of file KoTextView.h.

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

Reimplement this to handle CTRL+PageDown.

Default implementation calls pgDownKeyPressed

Definition at line 246 of file KoTextView.h.


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