KateDocument Class Reference
Inheritance diagram for KateDocument:

Public Types | |
enum | TextTransform { Uppercase, Lowercase, Capitalize } |
Public Slots | |
uint | configPages () const |
KTextEditor::ConfigPage * | configPage (uint number=0, QWidget *parent=0, const char *name=0) |
QString | configPageName (uint number=0) const |
QString | configPageFullName (uint number=0) const |
QPixmap | configPagePixmap (uint number=0, int size=KIcon::SizeSmall) const |
QString | text () const |
QString | text (uint startLine, uint startCol, uint endLine, uint endCol) const |
QString | text (uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise) const |
QString | textAsHtml (uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise) const |
QString | textLine (uint line) const |
bool | setText (const QString &) |
bool | clear () |
bool | insertText (uint line, uint col, const QString &s) |
bool | insertText (uint line, uint col, const QString &s, bool blockwise) |
bool | removeText (uint startLine, uint startCol, uint endLine, uint endCol) |
bool | removeText (uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise) |
bool | insertLine (uint line, const QString &s) |
bool | removeLine (uint line) |
uint | numLines () const |
uint | numVisLines () const |
uint | length () const |
int | lineLength (uint line) const |
bool | setSelection (const KateTextCursor &start, const KateTextCursor &end) |
bool | setSelection (uint startLine, uint startCol, uint endLine, uint endCol) |
bool | clearSelection () |
bool | clearSelection (bool redraw, bool finishedChangingSelection=true) |
bool | hasSelection () const |
QString | selection () const |
QString | selectionAsHtml () const |
bool | removeSelectedText () |
bool | selectAll () |
int | selStartLine () |
int | selStartCol () |
int | selEndLine () |
int | selEndCol () |
bool | blockSelectionMode () |
bool | setBlockSelectionMode (bool on) |
bool | toggleBlockSelectionMode () |
void | undo () |
void | redo () |
void | clearUndo () |
void | clearRedo () |
uint | undoCount () const |
uint | redoCount () const |
uint | undoSteps () const |
void | setUndoSteps (uint steps) |
KTextEditor::Cursor * | createCursor () |
QPtrList< KTextEditor::Cursor > | cursors () const |
bool | searchText (unsigned int startLine, unsigned int startCol, const QString &text, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool casesensitive=true, bool backwards=false) |
bool | searchText (unsigned int startLine, unsigned int startCol, const QRegExp ®exp, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool backwards=false) |
uint | hlMode () |
bool | setHlMode (uint mode) |
uint | hlModeCount () |
QString | hlModeName (uint mode) |
QString | hlModeSectionName (uint mode) |
void | readConfig () |
void | writeConfig () |
void | readConfig (KConfig *) |
void | writeConfig (KConfig *) |
void | readSessionConfig (KConfig *) |
void | writeSessionConfig (KConfig *) |
void | configDialog () |
uint | mark (uint line) |
void | setMark (uint line, uint markType) |
void | clearMark (uint line) |
void | addMark (uint line, uint markType) |
void | removeMark (uint line, uint markType) |
QPtrList< KTextEditor::Mark > | marks () |
void | clearMarks () |
void | setPixmap (MarkInterface::MarkTypes, const QPixmap &) |
void | setDescription (MarkInterface::MarkTypes, const QString &) |
QString | markDescription (MarkInterface::MarkTypes) |
QPixmap * | markPixmap (MarkInterface::MarkTypes) |
QColor | markColor (MarkInterface::MarkTypes) |
void | setMarksUserChangable (uint markMask) |
uint | editableMarks () |
bool | printDialog () |
bool | print () |
void | tagLines (int start, int end) |
void | tagLines (KateTextCursor start, KateTextCursor end) |
void | exportAs (const QString &) |
void | slotModifiedOnDisk (Kate::View *v=0) |
void | reloadFile () |
void | setEncoding (const QString &e) |
QString | encoding () const |
void | setWordWrap (bool on) |
bool | wordWrap () |
void | setWordWrapAt (uint col) |
uint | wordWrapAt () |
void | setPageUpDownMovesCursor (bool on) |
bool | pageUpDownMovesCursor () |
void | flush () |
void | applyWordWrap () |
void | dumpRegionTree () |
void | spellcheck () |
void | spellcheck (const KateTextCursor &from, const KateTextCursor &to=KateTextCursor()) |
void | ready (KSpell *) |
void | misspelling (const QString &, const QStringList &, unsigned int) |
void | corrected (const QString &, const QString &, unsigned int) |
void | spellResult (const QString &) |
void | spellCleanDone () |
void | slotQueryClose_save (bool *handled, bool *abortClosing) |
Signals | |
void | textChanged () |
void | charactersInteractivelyInserted (int, int, const QString &) |
void | charactersSemiInteractivelyInserted (int, int, const QString &) |
void | backspacePressed () |
void | editTextInserted (uint line, uint col, uint len) |
void | editTextRemoved (uint line, uint col, uint len) |
void | editLineWrapped (uint line, uint col, uint len) |
void | editLineUnWrapped (uint line, uint col) |
void | editLineInserted (uint line) |
void | editLineRemoved (uint line) |
void | selectionChanged () |
void | textInserted (int line, int column) |
void | undoChanged () |
void | hlChanged () |
void | marksChanged () |
void | markChanged (KTextEditor::Mark, KTextEditor::MarkInterfaceExtension::MarkChangeAction) |
void | variableChanged (const QString &, const QString &) |
void | modifiedChanged () |
void | preHighlightChanged (uint) |
void | modStateChanged (Kate::Document *doc) |
void | nameChanged (Kate::Document *doc) |
void | fileNameChanged () |
void | codeFoldingUpdated () |
void | aboutToRemoveText (const KateTextRange &) |
void | textRemoved () |
DCOP Member Functions | |
uint | documentNumber () const |
Public Member Functions | |
KateDocument (bool bSingleViewMode=false, bool bBrowserView=false, bool bReadOnly=false, QWidget *parentWidget=0, const char *widgetName=0, QObject *=0, const char *=0) | |
~KateDocument () | |
bool | closeURL () |
void | unloadAllPlugins () |
void | enableAllPluginsGUI (KateView *view) |
void | disableAllPluginsGUI (KateView *view) |
void | loadPlugin (uint pluginIndex) |
void | unloadPlugin (uint pluginIndex) |
void | enablePluginGUI (KTextEditor::Plugin *plugin, KateView *view) |
void | enablePluginGUI (KTextEditor::Plugin *plugin) |
void | disablePluginGUI (KTextEditor::Plugin *plugin, KateView *view) |
void | disablePluginGUI (KTextEditor::Plugin *plugin) |
bool | readOnly () const |
bool | browserView () const |
bool | singleViewMode () const |
KateBrowserExtension * | browserExtension () |
void | textAsHtmlStream (uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise, QTextStream *ts) const |
KTextEditor::View * | createView (QWidget *parent, const char *name) |
QPtrList< KTextEditor::View > | views () const |
KateView * | activeView () const |
void | editStart (bool withUndo=true) |
void | editBegin () |
void | editEnd () |
bool | editInsertText (uint line, uint col, const QString &s) |
bool | editRemoveText (uint line, uint col, uint len) |
bool | editMarkLineAutoWrapped (uint line, bool autowrapped) |
bool | editWrapLine (uint line, uint col, bool newLine=true, bool *newLineAdded=0) |
bool | editUnWrapLine (uint line, bool removeLine=true, uint length=0) |
bool | editInsertLine (uint line, const QString &s) |
bool | editRemoveLine (uint line) |
bool | wrapText (uint startLine, uint endLine) |
void | bufferHlChanged () |
KateArbitraryHighlight * | arbitraryHL () const |
QString | mimeType () |
long | fileSize () |
QString | niceFileSize () |
KMimeType::Ptr | mimeTypeForContent () |
QString | variable (const QString &name) const |
bool | openURL (const KURL &url) |
bool | save () |
bool | saveAs (const KURL &url) |
bool | openFile (KIO::Job *job) |
bool | openFile () |
bool | saveFile () |
void | setReadWrite (bool rw=true) |
void | setModified (bool m) |
Kate::ConfigPage * | colorConfigPage (QWidget *) |
Kate::ConfigPage * | fontConfigPage (QWidget *) |
Kate::ConfigPage * | indentConfigPage (QWidget *) |
Kate::ConfigPage * | selectConfigPage (QWidget *) |
Kate::ConfigPage * | editConfigPage (QWidget *) |
Kate::ConfigPage * | keysConfigPage (QWidget *) |
Kate::ConfigPage * | hlConfigPage (QWidget *) |
Kate::ConfigPage * | viewDefaultsConfigPage (QWidget *) |
Kate::ConfigPage * | saveConfigPage (QWidget *) |
Kate::ActionMenu * | hlActionMenu (const QString &text, QObject *parent=0, const char *name=0) |
Kate::ActionMenu * | exportActionMenu (const QString &text, QObject *parent=0, const char *name=0) |
bool | typeChars (KateView *type, const QString &chars) |
uint | lastLine () const |
uint | configFlags () |
void | setConfigFlags (uint flags) |
void | tagSelection (const KateTextCursor &oldSelectStart, const KateTextCursor &oldSelectEnd) |
void | repaintViews (bool paintOnlyDirty=true) |
KateHighlighting * | highlight () |
KateHighlighting * | highlight () const |
void | addView (KTextEditor::View *) |
void | removeView (KTextEditor::View *) |
void | addSuperCursor (class KateSuperCursor *, bool privateC) |
void | removeSuperCursor (class KateSuperCursor *, bool privateC) |
bool | ownedView (KateView *) |
bool | isLastView (int numViews) |
uint | currentColumn (const KateTextCursor &) |
void | newLine (KateTextCursor &, KateViewInternal *) |
void | backspace (const KateTextCursor &) |
void | del (const KateTextCursor &) |
void | transpose (const KateTextCursor &) |
void | cut () |
void | copy () |
void | paste (KateView *view) |
void | selectWord (const KateTextCursor &cursor) |
void | selectLine (const KateTextCursor &cursor) |
void | selectLength (const KateTextCursor &cursor, int length) |
void | insertIndentChars (KateView *view) |
void | indent (KateView *view, uint line, int change) |
void | comment (KateView *view, uint line, uint column, int change) |
void | align (uint line) |
void | transform (KateView *view, const KateTextCursor &, TextTransform) |
void | joinLines (uint first, uint last) |
QString | getWord (const KateTextCursor &cursor) |
void | tagAll () |
void | updateViews () |
void | newBracketMark (const KateTextCursor &start, KateTextRange &bm, int maxLines=-1) |
bool | findMatchingBracket (KateTextCursor &start, KateTextCursor &end, int maxLines=-1) |
QString | docName () |
void | setDocName (QString docName) |
void | lineInfo (KateLineInfo *info, unsigned int line) |
KateCodeFoldingTree * | foldingTree () |
bool | isModifiedOnDisc () |
void | isModOnHD (bool=false) |
void | setModifiedOnDisk (int reason) |
uint | getRealLine (unsigned int virtualLine) |
uint | getVirtualLine (unsigned int realLine) |
uint | visibleLines () |
KateTextLine::Ptr | kateTextLine (uint i) |
KateTextLine::Ptr | plainKateTextLine (uint i) |
bool | wrapCursor () |
void | updateFileType (int newType, bool user=false) |
int | fileType () const |
void | makeAttribs (bool needInvalidate=true) |
KateDocumentConfig * | config () |
void | updateConfig () |
bool | setTabInterceptor (KateKeyInterceptorFunctor *interceptor) |
bool | removeTabInterceptor (KateKeyInterceptorFunctor *interceptor) |
bool | invokeTabInterceptor (KKey) |
void | setIMSelectionValue (uint imStartLine, uint imStart, uint imEnd, uint imSelStart, uint imSelEnd, bool m_imComposeEvent) |
void | getIMSelectionValue (uint *imStartLine, uint *imStart, uint *imEnd, uint *imSelStart, uint *imSelEnd) |
bool | isIMSelection (int _line, int _column) |
bool | isIMEdit (int _line, int _column) |
Static Public Member Functions | |
static bool | checkOverwrite (KURL u) |
static void | setDefaultEncoding (const QString &encoding) |
Protected Slots | |
void | testTemplateCode () |
Protected Member Functions | |
virtual bool | insertTemplateTextImplementation (uint line, uint column, const QString &templateString, const QMap< QString, QString > &initialValues, QWidget *parentWindow=0) |
Protected Attributes | |
KateKeyInterceptorFunctor * | m_tabInterceptor |
Friends | |
class | KateViewInternal |
class | KateRenderer |
class | KateTemplateHandler |
Detailed Description
Definition at line 78 of file katedocument.h.
Member Function Documentation
|
Enclose editor actions with
Definition at line 1016 of file katedocument.cpp. References QPtrList::at(), QPtrList::count(), and KateBuffer::editStart(). Referenced by align(), KateViewInternal::dropEvent(), editBegin(), editInsertLine(), editInsertText(), editMarkLineAutoWrapped(), editRemoveLine(), editRemoveText(), editUnWrapLine(), editWrapLine(), KateCommands::SedReplace::exec(), indent(), insertIndentChars(), insertText(), joinLines(), KateTemplateHandler::KateTemplateHandler(), KateViewInternal::keyPressEvent(), newLine(), paste(), KateUndoGroup::redo(), removeSelectedText(), removeText(), KateBuffer::saveFile(), setText(), transpose(), typeChars(), KateUndoGroup::undo(), and wrapText(). |
|
Definition at line 215 of file katedocument.h. References editStart(). |
|
End a editor operation.
Definition at line 1111 of file katedocument.cpp. References QPtrList::at(), config(), QPtrList::count(), KateBuffer::editEnd(), setModified(), wordWrap(), and wrapText(). Referenced by align(), KateViewInternal::dropEvent(), editInsertLine(), editInsertText(), editMarkLineAutoWrapped(), editRemoveLine(), editRemoveText(), editUnWrapLine(), editWrapLine(), KateCommands::SedReplace::exec(), indent(), insertIndentChars(), insertText(), joinLines(), KateTemplateHandler::KateTemplateHandler(), KateViewInternal::keyPressEvent(), newLine(), paste(), KateUndoGroup::redo(), removeSelectedText(), removeText(), KateBuffer::saveFile(), setText(), transpose(), typeChars(), KateUndoGroup::undo(), and wrapText(). |
|
Add a string in the given line/column.
Definition at line 1300 of file katedocument.cpp. References KateBuffer::changeLine(), config(), configFlags(), QPtrListIterator::current(), editEnd(), editStart(), QString::find(), QString::length(), KateBuffer::line(), QString::replace(), KateDocumentConfig::tabWidth(), and QString::unicode(). Referenced by insertText(), joinLines(), KateBuffer::saveFile(), transpose(), and wrapText(). |
|
Remove a string in the given line/column.
Definition at line 1342 of file katedocument.cpp. References KateBuffer::changeLine(), QPtrListIterator::current(), editEnd(), editStart(), and KateBuffer::line(). Referenced by editRemoveLine(), joinLines(), KateViewInternal::keyPressEvent(), removeText(), KateBuffer::saveFile(), transpose(), and wrapText(). |
|
Mark This is necessary if static word warp is enabled, because we have to know whether to insert a new line or add the wrapped words to the followin line.
Definition at line 1371 of file katedocument.cpp. References KateBuffer::changeLine(), editEnd(), editStart(), and KateBuffer::line(). Referenced by wrapText(). |
|
Wrap
If
Definition at line 1394 of file katedocument.cpp. References QPtrList::append(), KateBuffer::changeLine(), QPtrListIterator::current(), QIntDictIterator::current(), editEnd(), editStart(), QIntDict::insert(), KateBuffer::insertLine(), QPtrList::isEmpty(), KateBuffer::line(), mark(), QIntDict::take(), and textLine(). Referenced by insertText(), newLine(), and wrapText(). |
|
Unwrap
If
Definition at line 1475 of file katedocument.cpp. References QPtrList::append(), KateBuffer::changeLine(), QPtrListIterator::current(), QIntDictIterator::current(), editEnd(), editStart(), QIntDict::insert(), QPtrList::isEmpty(), KateBuffer::line(), mark(), KateBuffer::removeLine(), and QIntDict::take(). Referenced by joinLines(), and removeText(). |
|
Insert a string at the given line.
Definition at line 1550 of file katedocument.cpp. References QPtrList::append(), KateBuffer::changeLine(), QPtrListIterator::current(), QIntDictIterator::current(), editEnd(), editStart(), QIntDict::insert(), KateBuffer::insertLine(), QPtrList::isEmpty(), QString::length(), mark(), numLines(), QIntDict::take(), and QString::unicode(). Referenced by insertLine(), and insertText(). |
|
Remove a line.
Definition at line 1599 of file katedocument.cpp. References QPtrList::append(), QPtrListIterator::current(), QIntDictIterator::current(), editEnd(), editRemoveText(), editStart(), QIntDict::insert(), QPtrList::isEmpty(), lastLine(), KateBuffer::line(), lineLength(), mark(), numLines(), KateBuffer::removeLine(), QIntDict::take(), and textLine(). Referenced by removeLine(), and removeText(). |
|
Remove a line.
Definition at line 1144 of file katedocument.cpp. References config(), editEnd(), editInsertText(), editMarkLineAutoWrapped(), editRemoveText(), editStart(), editWrapLine(), endl(), highlight(), kdDebug(), length(), KateBuffer::line(), numLines(), KateBuffer::tabWidth(), text(), and KateDocumentConfig::wordWrapAt(). Referenced by applyWordWrap(), and editEnd(). |
|
Emitted each time text is inserted into a pre-existing line, including appends. Does not include newly inserted lines at the moment. ### needed? |
|
Emitted each time text is removed from a line, including truncates and space removal.
|
|
Emmitted when text from
|
|
Emitted each time text from
|
|
Emitted whenever a line is inserted before
|
|
Emitted when a line is deleted.
|
|
Definition at line 2471 of file katedocument.cpp. References KMimeType::defaultMimeTypePtr(), KMimeType::findByURL(), and mimeTypeForContent(). Referenced by spellcheck(). |
|
Definition at line 2486 of file katedocument.cpp. |
|
Definition at line 2492 of file katedocument.cpp. |
|
Definition at line 2497 of file katedocument.cpp. References KMimeType::findByContent(), QString::length(), numLines(), and textLine(). Referenced by KateFileTypeManager::fileType(), and mimeType(). |
|
Implements Kate::Document. Definition at line 4906 of file katedocument.cpp. Referenced by configPage(). |
|
Implements Kate::Document. Definition at line 4916 of file katedocument.cpp. |
|
Implements Kate::Document. Definition at line 4921 of file katedocument.cpp. Referenced by configPage(). |
|
Implements Kate::Document. Definition at line 4926 of file katedocument.cpp. Referenced by configPage(). |
|
Implements Kate::Document. Definition at line 4931 of file katedocument.cpp. Referenced by configPage(). |
|
Implements Kate::Document. Definition at line 4936 of file katedocument.cpp. Referenced by configPage(). |
|
Implements Kate::Document. Definition at line 4941 of file katedocument.cpp. Referenced by configPage(). |
|
Type chars in a view.
Definition at line 3188 of file katedocument.cpp. References QString::append(), config(), configFlags(), KateView::cursorColumnReal(), KateView::cursorLine(), editEnd(), editStart(), hasSelection(), insertText(), QString::isEmpty(), QChar::isPrint(), QString::length(), KateBuffer::plainLine(), KateAutoIndent::processChar(), removeSelectedText(), removeText(), KateView::setCursorPositionInternal(), and textLine(). Referenced by KateViewInternal::keyPressEvent(). |
|
gets the last line number (numLines() -1)
Definition at line 661 of file katedocument.h. References numLines(). Referenced by addMark(), applyWordWrap(), KateViewInternal::bottom(), KateViewInternal::bottom_end(), clear(), clearMark(), del(), KateViewInternal::editEnd(), KateSuperCursor::editLineRemoved(), editRemoveLine(), findMatchingBracket(), insertText(), newLine(), KatePrinter::print(), removeLine(), removeMark(), removeText(), searchText(), selectAll(), spellcheck(), and KateRenderer::textWidth(). |
|
Tag the lines in the current selection.
Definition at line 4372 of file katedocument.cpp. References blockSelectionMode(), KateTextCursor::col(), hasSelection(), KateTextCursor::line(), and tagLines(). Referenced by clearSelection(), and setSelection(). |
|
Handling uppercase, lowercase and capitalize for the view. If there is a selection, that is transformed, otherwise for uppercase or lowercase the character right of the cursor is transformed, for capitalize the word under the cursor is transformed. Referenced by KateView::capitalize(), KateView::lowercase(), and KateView::uppercase(). |
|
Unwrap a range of lines.
Definition at line 4297 of file katedocument.cpp. References editEnd(), editInsertText(), editRemoveText(), editStart(), editUnWrapLine(), and KateBuffer::line(). Referenced by KateView::joinLines(). |
|
Returns the document name.
Reimplemented from Kate::Document. Definition at line 830 of file katedocument.h. Referenced by KateFileTypeManager::fileType(), and KatePrinter::print(). |
|
Sets the document name. deprecated for KDE 4.0, is done internally, calling it won't hurt but changes nothing beside triggers signal Reimplemented from Kate::Document. Definition at line 4607 of file katedocument.cpp. References QString::arg(), QPtrList::at(), KateFactory::documents(), fileType(), QString::isEmpty(), KateFactory::self(), QString::startsWith(), and updateFileType(). Referenced by closeURL(), KateDocument(), openFile(), and saveAs(). |
|
Definition at line 844 of file katedocument.h. |
|
Reimplemented from Kate::Document. Definition at line 847 of file katedocument.h. |
|
For client apps that want to deal with files modified on disk, it is nessecary to reset this property.
Implements Kate::DocumentExt. Definition at line 4719 of file katedocument.cpp. References Kate::Document::modifiedOnDisc(). |
|
Ask the user what to do, if the file has been modified on disc. Reimplemented from Kate::Document.
Implements Kate::DocumentExt. Definition at line 4647 of file katedocument.cpp. References checkOverwrite(), config(), QValueList::count(), KEncodingFileDialog::Result::encoding, encoding(), KMessageBox::error(), QDialog::exec(), QValueList::first(), KEncodingFileDialog::getSaveURLAndEncoding(), QValueList::isEmpty(), kdDebug(), Kate::Document::modifiedOnDisc(), reloadFile(), Kate::Document::s_fileChangedDialogsActivated, save(), saveAs(), setEncoding(), and KEncodingFileDialog::Result::URLs. Referenced by createView(), and KateDocument(). |
|
Reloads the current document from disc if possible.
Implements Kate::Document. Definition at line 4733 of file katedocument.cpp. References QValueList::append(), QMap::clear(), QIntDictIterator::current(), hlMode(), mark(), Kate::Document::modifiedOnDisc(), numLines(), openURL(), Kate::Document::s_fileChangedDialogsActivated, setHlMode(), setMark(), QValueList::size(), textLine(), and KMessageBox::warningYesNoCancel(). Referenced by KateView::reloadFile(), and slotModifiedOnDisk(). |
|
The file has been saved (perhaps the name has changed). The main window can use this to change its caption Referenced by closeURL(), openFile(), and saveAs(). |
|
Spellchecking.
Reimplemented from Kate::Document. Definition at line 4994 of file katedocument.cpp. Referenced by KateView::spellcheckFromCursor(), and KateView::spellcheckSelection(). |
|
Spellcheck a defined portion of the text.
Definition at line 4999 of file katedocument.cpp. References KateTextCursor::col(), QString::isEmpty(), lastLine(), KateTextCursor::line(), lineLength(), mimeType(), ready(), KateTextCursor::setCol(), KateTextCursor::setLine(), spellCleanDone(), spellResult(), and text(). |
|
The documentation for this class was generated from the following files: