KoTextView Class Reference
Object that is created to edit a KoTextObject. More...
#include <kotextview.h>
Inheritance diagram for KoTextView:

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) |
KoTextObject * | textObject () const |
KoTextCursor * | cursor () const |
KoTextDocument * | textDocument () const |
bool | isReadWrite () const |
void | setReadWrite (bool b) |
virtual KoTextFormat * | currentFormat () const |
void | setCurrentFormat (KoTextFormat *fmt) |
virtual const KoParagLayout * | currentParagLayoutFormat () 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 &) |
KoVariable * | variable () |
KoLinkVariable * | linkVariable () |
KCommand * | dropEvent (KoTextObject *tmp, KoTextCursor dropCursor, bool dropInSameObj) |
void | removeComment () |
void | copyTextOfComment () |
KoStyle * | createStyleFromSelection (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
|
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(), KoTextView(), startDrag(), KoTextObject::textDocument(), and updateUI(). Referenced by KoTextView(). |
Member Function Documentation
|
don't remove selection when we made dnd between different frame
Definition at line 112 of file kotextview.cc. References KoTextObject::clearUndoRedoInfo(), KoTextObject::selectionChangedNotify(), and terminate(). Referenced by terminate(). |
|
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. |
|
Call setReadWrite(false) to make the text view readonly.
Definition at line 76 of file kotextview.h. References setReadWrite(). Referenced by setReadWrite(). |
|
Interface for accessing the current format.
Implements KoTextFormatInterface. Definition at line 78 of file kotextview.h. Referenced by updateUI(). |
|
Use this format for displaying the properties (Align/counter/...) of the object.
Implements KoTextFormatInterface. Definition at line 1141 of file kotextview.cc. |
|
Interface for changing the paragraph layout.
Implements KoTextFormatInterface. Definition at line 1153 of file kotextview.cc. References KoParagLayout::alignment, KoParagLayout::counter, KoParagLayout::margins, setParagLayoutFormatCommand(), and KoParagLayout::tabList(). Referenced by setParagLayoutFormatCommand(). |
|
Implement the KoTextFormatInterface.
Implements KoTextFormatInterface. Definition at line 863 of file kotextview.cc. References KoTextObject::setFormatCommand(), and setFormatCommand(). Referenced by setFormatCommand(). |
|
Return the list of actions from data-tools. Used to populate a RMB popupmenu usually. Definition at line 975 of file kotextview.cc. References dataToolActionList(), KoTextObject::hasSelection(), KoTextObject::protectContent(), and KoTextObject::selectedText(). Referenced by dataToolActionList(). |
|
### shouldn't be a member var, but should be determined here Definition at line 958 of file kotextview.cc. |
|
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 883 of file kotextview.cc. References currentFormat(), KoTextFormat::isMisspelled(), KoTextFormat::key(), KoTextFormat::removeRef(), KoTextFormat::setMisspelled(), and updateUI(). Referenced by KoTextView(), and updateUI(). |
|
This is a slot so that it's accessible from DCOP.
Definition at line 372 of file kotextview.cc. References KoTextObject::insert(), and insertText(). Referenced by insertText(). |
|
Start a drag.
Referenced by KoTextView(). |
|
Called when a character ( This is a virtual method rather than a signal for performance reasons. Definition at line 192 of file kotextview.h. References doAutoFormat(). Referenced by doAutoFormat(). |
|
Show the settings of this format in the GUI. Needs to be implemented in the application. |
|
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 840 of file kotextview.cc. References drawCursor(). Referenced by drawCursor(). |
|
Reimplement this to handle PageUp. Example implementation: textView->cursor()->gotoPageUp( scrollview->visibleHeight() ); Referenced by ctrlPgUpKeyPressed(). |
|
Reimplement this to handle PageDown. Example implementation: textView->cursor()->gotoPageDown( scrollview->visibleHeight() ); Referenced by ctrlPgDownKeyPressed(). |
|
Reimplement this to handle CTRL+PageUp. Default implementation calls pgUpKeyPressed Definition at line 220 of file kotextview.h. References pgUpKeyPressed(). |
|
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: