Kate
katedocument.cpp
Go to the documentation of this file.
157 QDBusConnection::sessionBus().registerObject (pathName, this, QDBusConnection::ExportAdaptors | QDBusConnection::ExportScriptableSlots);
213 connect(m_undoManager, SIGNAL(undoStart(KTextEditor::Document*)), this, SIGNAL(exclusiveEditStart(KTextEditor::Document*)));
214 connect(m_undoManager, SIGNAL(undoEnd(KTextEditor::Document*)), this, SIGNAL(exclusiveEditEnd(KTextEditor::Document*)));
215 connect(m_undoManager, SIGNAL(redoStart(KTextEditor::Document*)), this, SIGNAL(exclusiveEditStart(KTextEditor::Document*)));
216 connect(m_undoManager, SIGNAL(redoEnd(KTextEditor::Document*)), this, SIGNAL(exclusiveEditEnd(KTextEditor::Document*)));
263 for (QHash<int, KTextEditor::Mark*>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i)
530 bool KateDocument::insertText( const KTextEditor::Cursor& position, const QString& text, bool block )
606 editInsertText(currentLine, insertColumn, text.mid(currentLineStart, pos - currentLineStart) + QString(spacesRequired, spaceChar));
624 bool KateDocument::insertText( const KTextEditor::Cursor & position, const QStringList & textLines, bool block )
680 editRemoveText(from, range.start().column(), m_buffer->plainLine(from)->length() - range.start().column());
953 if (nextl && (nextl->length() > 0) && !nextl->at(0).isSpace() && ((l->length() < 1) || !l->at(l->length()-1).isSpace()))
1005 emit KTextEditor::Document::textInserted(this, KTextEditor::Range(line, col2, line, col2 + s2.length()));
1046 m_buffer->removeText (KTextEditor::Range (KTextEditor::Cursor (line, col), KTextEditor::Cursor (line, col+len)));
1049 emit KTextEditor::Document::textRemoved(this, KTextEditor::Range(line, col, line, col + len), oldText);
1111 for (QHash<int, KTextEditor::Mark*>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i)
1187 for (QHash<int, KTextEditor::Mark*>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i)
1255 for (QHash<int, KTextEditor::Mark*>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i)
1316 m_buffer->removeText (KTextEditor::Range (KTextEditor::Cursor (line, 0), KTextEditor::Cursor (line, tl->text().size())));
1400 const Qt::CaseSensitivity caseSensitivity = options.testFlag(KTextEditor::Search::CaseInsensitive) ? Qt::CaseInsensitive : Qt::CaseSensitive;
1414 KTextEditor::Range match = searcher.search(KateRegExpSearch::escapePlaintext(pattern), range, backwards);
1542 //BEGIN KTextEditor::SessionConfigInterface and KTextEditor::ParameterizedSessionConfigInterface stuff
1589 config()->setIndentationMode( kconfig.readEntry("Indentation Mode", config()->indentationMode() ) );
1637 for (QHash<int, KTextEditor::Mark*>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i)
1644 //END KTextEditor::SessionConfigInterface and KTextEditor::ParameterizedSessionConfigInterface stuff
1811 void KateDocument::setMarkDescription( MarkInterface::MarkTypes type, const QString& description )
1888 buf.replace(bufpos,len,ld.toLatin1()); //memcpy(buf.data() + bufpos, ld.toLatin1().constData(), len);
1906 = new KTextEditor::Message(i18n ("The file %1 could not be loaded, as it was not possible to read from it.<br />Check if you have read access to this file.", this->url().pathOrUrl()),
1909 QAction* tryAgainAction = new QAction(KIcon("view-refresh"), i18nc("translators: you can also translate 'Try Again' with 'Reload'", "Try Again"), 0);
1924 setOpeningErrorMessage(i18n ("The file %1 could not be loaded, as it was not possible to read from it.\n\nCheck if you have read access to this file.",this->url().pathOrUrl()));
1970 bool success = m_buffer->openFile (localFilePath(), (m_reloading && m_userSetEncodingForNextReload));
1988 // This is needed here because inserting the text moves the view's start position (it is a MovingCursor)
1997 // Inform that the text has changed (required as we're not inside the usual editStart/End stuff)
2036 = new KTextEditor::Message(i18n ("The file %1 was opened with %2 encoding but contained invalid characters.<br />"
2038 "Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.", this->url().pathOrUrl(),
2046 setOpeningErrorMessage(i18n ("The file %1 was opened with %2 encoding but contained invalid characters."
2048 " Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.", this->url().pathOrUrl(), QString (m_buffer->textCodec()->name ())));
2057 = new KTextEditor::Message(i18n ("The file %1 was opened and contained lines longer than the configured Line Length Limit (%2 characters).<br />"
2058 "Those lines were wrapped and the document is set to read-only mode, as saving will modify its content.",
2066 setOpeningErrorMessage(i18n ("The file %1 was opened and contained lines longer than the configured Line Length Limit (%2 characters)."
2067 " Those lines were wrapped and the document is set to read-only mode, as saving will modify its content.", this->url().pathOrUrl(),config()->lineLengthLimit()));
2090 str + i18n("Do you really want to save this unmodified file? You could overwrite changed data in the file on disk."),i18n("Trying to Save Unmodified File"),KGuiItem(i18n("Save Nevertheless"))) != KMessageBox::Continue)
2096 str + i18n("Do you really want to save this file? Both your open file and the file on disk were changed. There could be some data lost."),i18n("Possible Data Loss"),KGuiItem(i18n("Save Nevertheless"))) != KMessageBox::Continue)
2107 i18n("The selected encoding cannot encode every unicode character in this document. Do you really want to save it? There could be some data lost."),i18n("Possible Data Loss"),KGuiItem(i18n("Save Nevertheless"))) != KMessageBox::Continue))
2168 " A reason could be that the media you write to is full or the directory of the file is read-only for you.", url().pathOrUrl())
2211 KMessageBox::error (parentWidget, i18n ("The document could not be saved, as it was not possible to write to %1.\n\nCheck that you have write access to this file or that enough disk space is available.", this->url().pathOrUrl()));
2349 reasonedMOHString() + "\n\n" + i18n("Do you really want to continue to close this file? Data loss may occur."),
2619 || (view->viInputMode() && view->getViInputModeManager()->getCurrentViMode() == ReplaceMode)) {
2642 selectionRange.start().setColumn(fromVirtualColumn(selectionRange.start().line(), newSelectionColumn));
2643 selectionRange.end().setColumn(fromVirtualColumn(selectionRange.end().line(), newSelectionColumn));
2728 if (view->blockSelection() && view->selection() && toVirtualColumn(view->selectionRange().start()) == toVirtualColumn(view->selectionRange().end())) {
2808 if (view->blockSelection() && view->selection() && toVirtualColumn(view->selectionRange().start()) == toVirtualColumn(view->selectionRange().end())) {
3243 bool KateDocument::removeStartStopCommentFromRegion(const KTextEditor::Cursor &start,const KTextEditor::Cursor &end,int attrib)
3254 removeText(KTextEditor::Range(end.line(), end.column() - endCommentLen, end.line(), end.column()));
3321 bool hasStartLineCommentMark = !(highlight()->getCommentSingleLineStart( startAttrib ).isEmpty());
3478 while ( cursor.column() > 0 && highlight()->isInWord( l->at( cursor.column() - 1 ), l->attribute( cursor.column() - 1 ) ) )
3547 while (start > 0 && highlight()->isInWord(textLine->at(start - 1), textLine->attribute(start - 1))) start--;
3572 void KateDocument::newBracketMark( const KTextEditor::Cursor& cursor, KTextEditor::Range& bm, int maxLines )
3735 KEncodingFileDialog::Result res=KEncodingFileDialog::getSaveUrlAndEncoding(config()->encoding(),
3739 if( ! res.URLs.isEmpty() && ! res.URLs.first().isEmpty() && checkOverwrite( res.URLs.first(), parentWidget ) )
3838 for (QHash<int, KTextEditor::Mark*>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i)
3911 KEncodingFileDialog::Result res=KEncodingFileDialog::getSaveUrlAndEncoding(config()->encoding(),
4136 "http://docs.kde.org/stable/en/kde-baseapps/kate/config-variables.html#variable-remove-trailing-spaces");
4142 "http://docs.kde.org/stable/en/kde-baseapps/kate/config-variables.html#variable-remove-trailing-spaces");
4174 else if ( var == "word-wrap-column" && checkIntValue( val, &n ) && n > 0 ) // uint, but hard word wrap at 0 will be no fun ;)
4519 int hl (KateHlManager::self()->nameFind (KateGlobal::self()->modeManager()->fileType(newType).hl));
4529 if (!m_indenterSetByUser && !KateGlobal::self()->modeManager()->fileType(newType).indenter.isEmpty())
4566 KEncodingFileDialog::Result res=KEncodingFileDialog::getSaveUrlAndEncoding(config()->encoding(),
4687 bool KateDocument::replaceText( const KTextEditor::Range & range, const QString & s, bool block )
4737 KTextEditor::MovingCursor *KateDocument::newMovingCursor (const KTextEditor::Cursor &position, KTextEditor::MovingCursor::InsertBehavior insertBehavior)
4742 KTextEditor::MovingRange *KateDocument::newMovingRange (const KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior)
4767 void KateDocument::transformCursor(int& line, int& column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision)
4772 void KateDocument::transformCursor (KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision)
4780 void KateDocument::transformRange (KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision)
4782 m_buffer->history().transformRange (range, insertBehaviors, emptyBehavior, fromRevision, toRevision);
4789 return KateGlobal::self()->simpleMode () && KateGlobal::self()->documentConfig()->allowSimpleMode ();
4947 m_loadingMessage = new KTextEditor::Message(i18n ("The file <a href=\"%1\">%2</a> is still loading.", url().pathOrUrl(), url().fileName()));
5044 for(QList<QPair<KTextEditor::MovingRange*, QString> >::iterator i = m_dictionaryRanges.begin();
5057 void KateDocument::setDictionary(const QString& newDictionary, const KTextEditor::Range &range)
5066 for(QList<QPair<KTextEditor::MovingRange*, QString> >::iterator i = m_dictionaryRanges.begin();
5096 QList<KTextEditor::Range> remainingRanges = KateSpellCheckManager::rangeDifference(newDictionaryRange, intersection);
5103 QList<KTextEditor::Range> remainingRanges = KateSpellCheckManager::rangeDifference(*dictionaryRange, intersection);
5104 for(QList<KTextEditor::Range>::iterator j = remainingRanges.begin(); j != remainingRanges.end(); ++j)
5118 if(!newDictionaryRange.isEmpty() && !newDictionary.isEmpty()) // we don't add anything for the default dictionary
5123 m_dictionaryRanges.push_back(QPair<KTextEditor::MovingRange*, QString>(newDictionaryMovingRange, newDictionary));
5214 for(QList<QPair<KTextEditor::MovingRange*, QString> >::iterator i = m_dictionaryRanges.begin();
5266 QString KateDocument::decodeCharacters(const KTextEditor::Range& range, KateDocument::OffsetList& decToEncOffsetList,
5290 const QHash<QString, QChar>& characterEncodingsHash = highlighting->getCharacterEncodings(attr);
5302 decToEncCurrentOffset = decToEncCurrentOffset - (isNullChar ? 0 : 1) + matchingPrefix.length();
5303 encToDecCurrentOffset = encToDecCurrentOffset - matchingPrefix.length() + (isNullChar ? 0 : 1);
5338 const QHash<QChar, QString>& reverseCharacterEncodingsHash = highlighting->getReverseCharacterEncodings(attr);
5339 QHash<QChar, QString>::const_iterator it = reverseCharacterEncodingsHash.find(textLine->at(col));
5354 KTextEditor::Attribute::Ptr KateDocument::defaultStyle(const KTextEditor::HighlightInterface::DefaultStyle ds) const
5359 kWarning() << "ATTENTION: cannot access defaultStyle() without any View (will be fixed eventually)";
5363 KTextEditor::Attribute::Ptr style = highlight()->attributes(view->renderer()->config()->schema()).at(ds);
5372 QList< KTextEditor::HighlightInterface::AttributeBlock > KateDocument::lineAttributes(const unsigned int line)
5380 kWarning() << "ATTENTION: cannot access lineAttributes() without any View (will be fixed eventually)";
5416 // kDebug() << "col: " << position.column() << " lastchar:" << kateLine->lastChar() << " length:" << kateLine->length() << "global mode:" << highlightingMode();
5471 KateHlContext *context = tl->contextStack().isEmpty() ? highlight()->contextNum(0) : highlight()->contextNum (tl->contextStack().back());
5506 kWarning(13020) << "trying to post a message to a view of another document:" << message->text();
5538 connect(message, SIGNAL(closed(KTextEditor::Message*)), SLOT(messageDestroyed(KTextEditor::Message*)));
virtual const QString & documentName() const
Definition: katedocument.h:828
Definition: katedialogs.h:403
virtual void setConfigValue(const QString &key, const QVariant &value)
Definition: katedocument.cpp:4633
KGuiItem cancel()
virtual void setFeedback(MovingRangeFeedback *feedback)=0
void align(KateView *view, const KTextEditor::Range &range)
Definition: katedocument.cpp:2908
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
void setLocalFilePath(const QString &localFilePath)
Interface for embedding KateDocument into a browser.
Definition: katedocumenthelpers.h:36
KTextEditor::View * view() const
static bool stat(const KUrl &url, KIO::UDSEntry &entry, QWidget *window)
virtual bool insertLine(int line, const QString &s)
Definition: katedocument.cpp:701
virtual QString highlightingMode() const
Return the name of the currently used mode.
Definition: katedocument.cpp:1494
void setKeepExtraSpaces(bool on)
Definition: kateconfig.cpp:557
This class can be used to efficiently search for occurrences of strings in a given string...
Definition: prefixstore.h:41
void modifiedChanged(KTextEditor::Document *document)
Cursor & start()
bool tagLines(int start, int end, bool realLines=false)
Definition: kateview.cpp:1863
uint type
bool simpleMode() const
Definition: kateconfig.h:279
virtual bool saveAs(const KUrl &url)
QString dictionaryForMisspelledRange(const KTextEditor::Range &range) const
Definition: ontheflycheck.cpp:95
void exclusiveEditEnd(KTextEditor::Document *document)
void ignoreModifiedOnDiskOnce()
Definition: katedocument.cpp:4697
void registerDocument(KateDocument *doc)
register document at the factory this allows us to loop over all docs for example on config changes ...
Definition: kateglobal.cpp:471
static Cursor invalid()
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
void setIndentationMode(const QString &identationMode)
Definition: kateconfig.cpp:459
void updateFileType(const QString &newType, bool user=false)
Definition: katedocument.cpp:4504
KateModeManager * modeManager()
global mode manager used to manage the modes centrally
Definition: kateglobal.h:291
virtual KTextEditor::MovingCursor * newMovingCursor(const KTextEditor::Cursor &position, KTextEditor::MovingCursor::InsertBehavior insertBehavior=KTextEditor::MovingCursor::MoveOnInsert)
Create a new moving cursor for this document.
Definition: katedocument.cpp:4737
int computePositionWrtOffsets(const OffsetList &offsetList, int pos)
Definition: katedocument.cpp:5254
void setDocument(KTextEditor::Document *document)
void updateConfig()
Update indenter's configuration (indention width, etc.) Is called in the updateConfig() of the docume...
Definition: kateautoindent.cpp:370
virtual void setModifiedOnDiskWarning(bool on)
Definition: katedocument.cpp:3800
virtual KTextEditor::MovingRange * newMovingRange(const KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors=KTextEditor::MovingRange::DoNotExpand, KTextEditor::MovingRange::EmptyBehavior emptyBehavior=KTextEditor::MovingRange::AllowEmpty)
Create a new moving range for this document.
Definition: katedocument.cpp:4742
QList< KateDocument * > & kateDocuments()
return a list of all registered docs
Definition: kateglobal.h:266
void setHighlightedBracketColor(const QColor &col)
Definition: kateconfig.cpp:2283
void addFile(const QString &file)
void replaceCharactersByEncoding(const KTextEditor::Range &range)
Definition: katedocument.cpp:5322
void repaintViews(bool paintOnlyDirty=true)
Definition: katedocument.cpp:3559
void slotTextInserted(int line, int col, const QString &s)
Notify KateUndoManager that text was inserted.
Definition: kateundomanager.cpp:139
void reloaded(KTextEditor::Document *document)
KGuiItem discard()
Definition: kateconfig.h:280
const QColor & lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type=KTextEditor::MarkInterface::markType01) const
Definition: kateconfig.cpp:2241
void ensureHighlighted(int line, int lookAhead=64)
Update highlighting of given line line, if needed.
Definition: katebuffer.cpp:284
bool waitSaveComplete()
virtual bool isValid() const
static QList< KTextEditor::Range > rangeDifference(const KTextEditor::Range &r1, const KTextEditor::Range &r2)
'r2' is a subrange of 'r1', which is extracted from 'r1' and the remaining ranges are returned ...
Definition: spellcheck.cpp:68
qint64 lastSavedRevision() const
Last revision the buffer got successful saved.
Definition: katetexthistory.h:54
void undoChanged()
QScriptValue i18nc(QScriptContext *context, QScriptEngine *engine)
i18nc("context", "text", arguments [optional])
Definition: katescripthelpers.cpp:210
QString dictionaryForMisspelledRange(const KTextEditor::Range &range) const
Definition: katedocument.cpp:5177
bool editChanged() const
were there changes in the current running editing session?
Definition: katebuffer.h:71
virtual KTextEditor::View * activeView() const
Definition: katedocument.h:156
bool handleMarkClick(int line)
Returns true if the click on the mark should not be further processed.
Definition: katedocument.cpp:1762
EmptyBehavior
QString nameForIdentifier(const QString &)
Returns the mode name for a given identifier, as e.g.
Definition: katesyntaxmanager.cpp:388
void readWriteChanged(KTextEditor::Document *document)
void setBackupSuffix(const QString &suffix)
Definition: kateconfig.cpp:988
void completed()
const QByteArray & digest() const
md5 digest of the document on disk, set either through file loading in openFile() or in KateDocument:...
Definition: katetextbuffer.cpp:692
virtual bool setMode(const QString &name)
Set the current mode of the document by giving its name.
Definition: katedocument.cpp:1462
QString getCommentStart(int attrib=0) const
Definition: katehighlight.cpp:1119
void setMode(const QString &name)
Switch indenter Nop if already set to given mode Otherwise switch to given indenter or to "None" if n...
Definition: kateautoindent.cpp:304
void documentNameChanged(KTextEditor::Document *document)
void configEnd()
end a config change transaction, update the concerned documents/views/renderers
Definition: kateconfig.cpp:63
virtual bool save()
void wrapLine(const KTextEditor::Cursor &position)
Wrap line at given cursor position.
Definition: katebuffer.cpp:301
KTextEditor::Attribute::Ptr attribute(uint pos) const
This takes an in index, and returns all the attributes for it.
Definition: katerenderer.cpp:79
void onTheFlySpellCheckingEnabled(bool enable)
Definition: katedocument.cpp:5152
Definition: kateviinputmodemanager.h:54
A Cursor which is bound to a specific Document.
Definition: documentcursor.h:69
void highlightingModeChanged(KTextEditor::Document *document)
KStandardDirs * dirs()
void clearMisspellingForWord(const QString &word)
Definition: katedocument.cpp:5187
bool editRemoveLines(int from, int to)
Definition: katedocument.cpp:1294
virtual bool documentReload()
Reloads the current document from disk if possible.
Definition: katedocument.cpp:3805
void setOpeningErrorMessage(const QString &message)
const char * name(StandardAction id)
static bool synchronousRun(Job *job, QWidget *window, QByteArray *data=0, KUrl *finalURL=0, QMap< QString, QString > *metaData=0)
virtual QString highlightingModeAt(const KTextEditor::Cursor &position)
Definition: katedocument.cpp:5406
virtual KTextEditor::Attribute::Ptr defaultStyle(const KTextEditor::HighlightInterface::DefaultStyle ds) const
Definition: katedocument.cpp:5354
virtual KTextEditor::AnnotationModel * annotationModel() const
Definition: katedocument.cpp:4800
virtual QStringList embeddedHighlightingModes() const
Definition: katedocument.cpp:5401
void overwrittenChar(const QChar &s)
Definition: katevireplacemode.h:48
static QString escapePlaintext(const QString &text)
Returns a modified version of text where escape sequences are resolved, e.g.
Definition: kateregexpsearch.cpp:531
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
virtual QWidget * widget()
KTextEditor::Range search(const QString &text, const KTextEditor::Range &inputRange, bool backwards=false)
Search for the given text inside the range inputRange taking into account whether to search casesensi...
Definition: kateplaintextsearch.cpp:52
void indent(KateView *view, const KTextEditor::Range &range)
The document requests the indenter to indent the given range of existing text.
Definition: kateautoindent.cpp:415
void slotTextRemoved(int line, int col, const QString &s)
Notify KateUndoManager that text was removed.
Definition: kateundomanager.cpp:145
const Range toRange() const
void setModified()
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
virtual QString modeSection(int index) const
Returns the name of the section for a mode given its index in the highlight list (as returned by mode...
Definition: katedocument.cpp:1514
mode_t permissions() const
void setUrl(const KUrl &url)
virtual KTextEditor::View * createView(QWidget *parent)
Definition: katedocument.cpp:292
void setSelectionColor(const QColor &col)
Definition: kateconfig.cpp:2207
bool canBreakAt(QChar c, int attrib=0) const
Definition: katehighlight.cpp:1091
bool saveFile(const QString &m_file)
Save the buffer to a file, use the given filename + codec + end of line chars (internal use of qtexts...
Definition: katebuffer.cpp:256
void setDontChangeHlOnSave()
allow to mark, that we changed hl on user wish and should not reset it atm used for the user visible ...
Definition: katedocument.cpp:1531
void markChanged(KTextEditor::Document *, KTextEditor::Mark, KTextEditor::MarkInterface::MarkChangeAction)
int line
static Cursor start()
virtual void writeSessionConfig(KConfigGroup &)
Definition: katedocument.cpp:1597
bool setCursorPosition(KTextEditor::Cursor position)
Definition: kateview.cpp:2393
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void bomSetByUser()
Set that the BOM marker is forced via the tool menu.
Definition: katedocument.cpp:1536
void modeChanged(KTextEditor::Document *document)
void marksChanged(KTextEditor::Document *)
#define k_funcinfo
bool move(int chars, WrapBehavior wrapBehavior=Wrap)
Moves the cursor chars character forward or backwards.
Definition: documentcursor.cpp:150
Kate::TextLine plainKateTextLine(uint i)
Definition: katedocument.cpp:4713
void indent(KTextEditor::Range range, int change)
Definition: katedocument.cpp:2898
Definition: katedialogs.h:402
void started(KIO::Job *)
virtual bool closeUrl()
void backspace(KateView *view, const KTextEditor::Cursor &)
Definition: katedocument.cpp:2725
int fromVirtualColumn(int line, int column) const
Definition: katedocument.cpp:2579
void dictionaryRangesPresent(bool yesNo)
QString mimeType() const
KUrl url
void markClicked(KTextEditor::Document *document, KTextEditor::Mark mark, bool &handled)
QString getCommentEnd(int attrib=0) const
Definition: katehighlight.cpp:1124
KateViInputModeManager * getViInputModeManager()
Definition: kateview.cpp:1567
void comment(KateView *view, uint line, uint column, int change)
Definition: katedocument.cpp:3301
virtual bool insertLines(int line, const QStringList &s)
Definition: katedocument.cpp:712
void setPath(const QString &path)
virtual void insertText(const KTextEditor::Cursor &position, const QString &text)
Insert text at given cursor position.
Definition: katetextbuffer.cpp:306
void aboutToRemoveText(const KTextEditor::Range &)
const KatePrefixStore & getCharacterEncodingsPrefixStore(int attrib) const
Definition: katehighlight.cpp:694
int columnWidth() const
void configStart()
start some config changes this method is needed to init some kind of transaction for config changes...
Definition: kateconfig.cpp:53
Definition: katehighlighthelpers.h:72
void rangeInvalid(KTextEditor::MovingRange *movingRange)
Definition: katedocument.cpp:5201
virtual const KTextEditor::Range & selectionRange() const
Definition: kateview.cpp:2760
void aboutToDeleteMovingInterfaceContent(KTextEditor::Document *document)
This signal is emitted before the cursors/ranges/revisions of a document are destroyed as the documen...
virtual void transformRange(KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision=-1)
Transform a range from one revision to an other.
Definition: katedocument.cpp:4780
bool contains(const Range &range) const
virtual QString mode() const
Return the name of the currently used mode.
Definition: katedocument.cpp:1468
static int warningYesNoCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
virtual bool setHighlightingMode(const QString &name)
Set the current mode of the document by giving its name.
Definition: katedocument.cpp:1484
Definition: katedocument.h:734
virtual bool replaceText(const KTextEditor::Range &range, const QString &s, bool block=false)
Definition: katedocument.cpp:4687
void viewCreated(KTextEditor::Document *document, KTextEditor::View *view)
virtual bool insertText(const KTextEditor::Cursor &position, const QString &s, bool block=false)
Definition: katedocument.cpp:530
void setBackspaceIndents(bool on)
Definition: kateconfig.cpp:599
virtual QStringList textLines(const KTextEditor::Range &range, bool block=false) const
Definition: katedocument.cpp:398
static Result getSaveUrlAndEncoding(const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
QString decodeCharacters(const KTextEditor::Range &range, KateDocument::OffsetList &decToEncOffsetList, KateDocument::OffsetList &encToDecOffsetList)
The first OffsetList is from decoded to encoded, and the second OffsetList from encoded to decoded...
Definition: katedocument.cpp:5266
void makeAttribs(bool needInvalidate=true)
Definition: katedocument.cpp:2502
void setDefaultDictionary(const QString &dict)
Definition: katedocument.cpp:5137
void removeDocument(KTextEditor::Document *doc)
Definition: katepartpluginmanager.cpp:112
InsertBehavior
void newBracketMark(const KTextEditor::Cursor &start, KTextEditor::Range &bm, int maxLines=-1)
Definition: katedocument.cpp:3572
KGuiItem overwrite()
const Cursor & toCursor() const
Convert this clever cursor into a dumb one.
Definition: documentcursor.cpp:217
bool openFile(const QString &m_file, bool enforceTextCodec)
Open a file, use the given filename.
Definition: katebuffer.cpp:161
void transformRange(KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision=-1)
Transform a range from one revision to an other.
Definition: katetexthistory.cpp:484
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
virtual QChar character(const KTextEditor::Cursor &position) const
Definition: katedocument.cpp:388
void canceled(const QString &errMsg)
virtual bool setSelection(const KTextEditor::Range &selection)
Definition: kateview.cpp:1931
void setDictionary(const QString &dict, const KTextEditor::Range &range)
Definition: katedocument.cpp:5057
void transform(KateView *view, const KTextEditor::Cursor &, TextTransform)
Handling uppercase, lowercase and capitalize for the view.
Definition: katedocument.cpp:3383
bool editInsertText(int line, int col, const QString &s)
Add a string in the given line/column.
Definition: katedocument.cpp:971
virtual KComponentData componentData() const
int line() const
Retrieve the line on which this cursor is situated.
Definition: documentcursor.cpp:77
void textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range)
void editEnd(int editTagLineStart, int editTagLineEnd, bool tagFrom)
Definition: kateview.cpp:1841
KSharedPtr< Attribute > Ptr
void slotLineInserted(int line, const QString &s)
Notify KateUndoManager that a line was inserted.
Definition: kateundomanager.cpp:169
QList< KTextEditor::Attribute::Ptr > attributes(const QString &schema)
Definition: katehighlight.cpp:2134
void setDigest(const QByteArray &md5sum)
Set the md5sum of this buffer.
Definition: katetextbuffer.cpp:697
void sigQueryClose(bool *handled, bool *abortClosing)
QList< QPair< KTextEditor::MovingRange *, QString > > dictionaryRanges() const
Definition: katedocument.cpp:5037
void deregisterDocument(KateDocument *doc)
unregister document at the factory
Definition: kateglobal.cpp:478
void postMessage(KTextEditor::Message *message, QList< QSharedPointer< QAction > > actions)
Used by Document::postMessage().
Definition: kateview.cpp:3192
static const QChar spaceChar(' ')
virtual bool isEmpty() const
virtual QString variable(const QString &name) const
Definition: katedocument.cpp:4339
static Range invalid()
virtual QList< KTextEditor::HighlightInterface::AttributeBlock > lineAttributes(const unsigned int line)
Definition: katedocument.cpp:5372
virtual Document * document() const =0
bool isReadWrite() const
const QHash< QChar, QString > & getReverseCharacterEncodings(int attrib) const
Definition: katehighlight.cpp:699
virtual bool isDataRecoveryAvailable() const
Definition: katedocument.cpp:2451
KateDocument(bool bSingleViewMode=false, bool bBrowserView=false, bool bReadOnly=false, QWidget *parentWidget=0, QObject *=0)
Definition: katedocument.cpp:111
virtual KTextEditor::Cursor documentEnd() const
Definition: katedocument.cpp:4682
void setPersistentSelection(bool on)
Definition: kateconfig.cpp:1677
void textChanged(KTextEditor::Document *document)
KTextEditor::Range rangeOnLine(KTextEditor::Range range, int line) const
Definition: katedocument.cpp:319
QList< QAction * > actions() const
QString csqueeze(const QString &str, int maxlen=40)
void setBackgroundColor(const QColor &col)
Definition: kateconfig.cpp:2186
QList< QPair< KTextEditor::MovingRange *, QString > > m_dictionaryRanges
Definition: katedocument.h:1149
void defaultDictionaryChanged(KateDocument *document)
virtual Cursor cursorPosition() const =0
KUrl url() const
virtual void setComponentData(const KComponentData &componentData)
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const
Range documentRange() const
virtual QVariant configValue(const QString &key)
Definition: katedocument.cpp:4609
virtual QPixmap markPixmap(MarkInterface::MarkTypes) const
Definition: katedocument.cpp:1816
Definition: katedocument.h:734
static KatePartPluginManager * self()
Definition: katepartpluginmanager.cpp:70
bool handleMarkContextMenu(int line, QPoint position)
Returns true if the context-menu event should not further be processed.
Definition: katedocument.cpp:1774
virtual QColor markColor(MarkInterface::MarkTypes) const
Definition: katedocument.cpp:1821
bool typeChars(KateView *type, const QString &realChars)
Type chars in a view.
Definition: katedocument.cpp:2594
QStringList getEmbeddedHighlightingModes() const
Returns a list of names of embedded modes.
Definition: katehighlight.cpp:2166
void setBackupPrefix(const QString &prefix)
Definition: kateconfig.cpp:975
Definition: kateview.h:78
uint redoCount() const
Returns how many redo() actions can be performed.
Definition: kateundomanager.cpp:229
void messageDestroyed(KTextEditor::Message *message)
Definition: katedocument.cpp:5543
QStringList types(Mode mode=Writing)
Definition: katemodemanager.h:34
void aboutToReload(KTextEditor::Document *document)
QString text() const
void slotTextInserted(KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text)
Definition: kateview.cpp:2245
bool onSingleLine() const
void refreshSpellCheck(const KTextEditor::Range &range=KTextEditor::Range::invalid())
Definition: ontheflycheck.cpp:680
Definition: katedocument.h:74
void updateAttributes()
update the highlighting attributes (for example after an hl change or after hl config changed) ...
Definition: katerenderer.cpp:74
void userTypedChar(KateView *view, const KTextEditor::Cursor &position, QChar typedChar)
The user typed some char, the indenter can react on this ' ' will be send as char if the user wraps a...
Definition: kateautoindent.cpp:436
void updateLineModifications()
Definition: kateundomanager.cpp:382
void requestMarkTooltip(int line, QPoint position)
Definition: katedocument.cpp:1752
OpenUrlArguments arguments() const
virtual void removeText(const KTextEditor::Range &range)
Remove text at given range.
Definition: katetextbuffer.cpp:338
static const QChar tabChar('\t')
bool findMatchingBracket(KTextEditor::Range &range, int maxLines=-1)
Definition: katedocument.cpp:3588
void del(KateView *view, const KTextEditor::Cursor &)
Definition: katedocument.cpp:2805
void setUndoMergeAllEdits(bool merge)
Definition: katedocument.cpp:4723
bool changeIndent(const KTextEditor::Range &range, int change)
Function to provide the common indent/unindent/clean indent functionality to the document This should...
Definition: kateautoindent.cpp:381
void undoSafePoint()
Prevent latest KateUndoGroup from being merged with the next one.
Definition: kateundomanager.cpp:190
KateViReplaceMode * getViReplaceMode()
Definition: kateviinputmodemanager.cpp:549
void variableChanged(KTextEditor::Document *, const QString &, const QString &)
virtual void setWidget(QWidget *widget)
bool hasKey(const QString &key) const
bool editWrapLine(int line, int col, bool newLine=true, bool *newLineAdded=0)
Wrap line.
Definition: katedocument.cpp:1083
virtual QVector< KTextEditor::Range > searchText(const KTextEditor::Range &range, const QString &pattern, const KTextEditor::Search::SearchOptions options)
Definition: katedocument.cpp:1387
const QString & indentationMode() const
Definition: kateconfig.cpp:451
void addDocument(KTextEditor::Document *doc)
Definition: katepartpluginmanager.cpp:100
ModifiedOnDiskReason
virtual int line() const
void charactersSemiInteractivelyInserted(const KTextEditor::Cursor &position, const QString &text)
KUrl::List URLs
virtual void setAnnotationModel(KTextEditor::AnnotationModel *model)
Definition: katedocument.cpp:4793
void setFileName(const QString &_txt)
QVector< KTextEditor::Range > search(const QString &pattern, const KTextEditor::Range &inputRange, bool backwards=false)
Search for the regular expression regexp inside the range inputRange.
Definition: kateregexpsearch.cpp:201
QAction * action(const char *name) const
virtual void setLine(int line)
virtual void setModifiedOnDisk(ModifiedOnDiskReason reason)
Definition: katedocument.cpp:3786
virtual bool setEncoding(const QString &e)
Definition: katedocument.cpp:3953
bool editRemoveText(int line, int col, int len)
Remove a string in the given line/column.
Definition: katedocument.cpp:1012
void setProgressInfoEnabled(bool show)
qint64 revision() const
Current revision, just relay the revision of the buffer.
Definition: katetexthistory.cpp:39
QString getWord(const KTextEditor::Cursor &cursor)
Definition: katedocument.cpp:3537
int autoHide() const
QString getCommentSingleLineStart(int attrib=0) const
Definition: katehighlight.cpp:1129
virtual void readSessionConfig(const KConfigGroup &)
Definition: katedocument.cpp:1543
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
virtual void setPosition(const Cursor &position)
void setPageUpDownMovesCursor(bool on)
Definition: kateconfig.cpp:544
const QHash< QString, QChar > & getCharacterEncodings(int attrib) const
Definition: katehighlight.cpp:689
virtual void removeMark(int line, uint markType)
Definition: katedocument.cpp:1714
void setWordWrap(bool wordWrap)
virtual QStringList modes() const
Return a list of the names of all possible modes.
Definition: katedocument.cpp:1473
virtual void setEditableMarks(uint markMask)
Definition: katedocument.cpp:1836
void aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *document)
This signal is emitted before the ranges of a document are invalidated and the revisions are deleted ...
QString encoding
virtual QString setVariable(const QString &name, const QString &value)
Definition: katedocument.cpp:4344
DefaultStyle
Cursor & end()
Definition: katehighlight.h:119
void clearMisspellingForWord(const QString &word)
Definition: ontheflycheck.cpp:106
QSharedPointer< TextLineData > TextLine
The normal world only accesses the text lines with shared pointers.
Definition: katetextline.h:443
void markToolTipRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint position, bool &handled)
void modifiedOnDisk(KTextEditor::Document *doc, bool isModified, KTextEditor::ModificationInterface::ModifiedOnDiskReason reason)
Indicate this file is modified on disk.
static int reservedMarkersCount()
bool isOnTheFlySpellCheckingEnabled() const
Definition: katedocument.cpp:5172
void setAutoDeletePart(bool autoDeletePart)
virtual bool openUrl(const KUrl &url)
Definition: katedialogs.h:401
virtual const QList< KTextEditor::View * > & views() const
Definition: katedocument.cpp:309
int numberOfLines() const
const QColor & backgroundColor() const
Definition: kateconfig.cpp:2178
virtual bool openFile()
open the file obtained by the kparts framework the framework abstracts the loading of remote files ...
Definition: katedocument.cpp:1931
bool containsCharacterEncoding(const KTextEditor::Range &range)
Definition: katedocument.cpp:5228
virtual void setMarkDescription(MarkInterface::MarkTypes, const QString &)
Definition: katedocument.cpp:1811
virtual void setReadWrite(bool readwrite=true)
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void refreshOnTheFlyCheck(const KTextEditor::Range &range=KTextEditor::Range::invalid())
Definition: katedocument.cpp:5194
bool pageUpDownMovesCursor() const
Definition: kateconfig.cpp:536
void setWordWrapMarkerColor(const QColor &col)
Definition: kateconfig.cpp:2304
KGuiItem save()
Range intersect(const Range &range) const
void slotQueryClose_save(bool *handled, bool *abortClosing)
Definition: katedocument.cpp:4559
virtual const QHash< int, KTextEditor::Mark * > & marks()
Definition: katedocument.cpp:1747
Definition: kateconfig.h:145
void configChanged()
Definition: katedialogs.h:400
void setIconBarColor(const QColor &col)
Definition: kateconfig.cpp:2367
void insertTab(KateView *view, const KTextEditor::Cursor &)
Definition: katedocument.cpp:2913
virtual void lockRevision(qint64 revision)
Lock a revision, this will keep it around until released again.
Definition: katedocument.cpp:4757
int toVirtualColumn(int line, int column) const
Definition: katedocument.cpp:2564
bool editUnWrapLine(int line, bool removeLine=true, int length=0)
Unwrap line.
Definition: katedocument.cpp:1153
void invalidateHighlighting()
Invalidate highlighting of whole buffer.
Definition: katebuffer.cpp:389
void slotLineWrapped(int line, int col, int length, bool newLine)
Notify KateUndoManager that a line was wrapped.
Definition: kateundomanager.cpp:157
Definition: katedocument.h:734
bool contains(const Range &range) const
This dialog will prompt the user for what do with a file that is modified on disk.
Definition: katedialogs.h:395
virtual bool postMessage(KTextEditor::Message *message)
Definition: katedocument.cpp:5498
int column() const
Retrieve the column on which this cursor is situated.
Definition: documentcursor.cpp:82
void setOpeningError(bool errors)
void setIndentPastedText(bool on)
Definition: kateconfig.cpp:578
void reflectOnTheFlySpellCheckStatus(bool enabled)
Definition: kateview.cpp:3034
bool pageUpDownMovesCursor() const
Definition: katedocument.cpp:3947
void insertChildClient(KXMLGUIClient *child)
virtual qint64 lastSavedRevision() const
Last revision the buffer got successful saved.
Definition: katedocument.cpp:4752
virtual QStringList highlightingModes() const
Return a list of the names of all possible modes.
Definition: katedocument.cpp:1499
void aboutToClose(KTextEditor::Document *document)
void transformCursor(int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1)
Transform a cursor from one revision to an other.
Definition: katetexthistory.cpp:436
void documentUrlChanged(KTextEditor::Document *document)
void slotMarkLineAutoWrapped(int line, bool autowrapped)
Notify KateUndoManager that a line was marked as autowrapped.
Definition: kateundomanager.cpp:151
void markContextMenuRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint pos, bool &handled)
uint undoCount() const
Returns how many undo() actions can be performed.
Definition: kateundomanager.cpp:224
void editStart()
Enclose editor actions with editStart() and editEnd() to group them.
Definition: katedocument.cpp:776
void revertToDefaultDictionary(const KTextEditor::Range &range)
Definition: katedocument.cpp:5132
void removeView(KTextEditor::View *)
removes the view from the list of views.
Definition: katedocument.cpp:2540
ViMode getCurrentViMode() const
Definition: kateviinputmodemanager.cpp:449
bool isLocalFile() const
QString findPrefix(const QString &s, int start=0) const
Returns the shortest prefix of the given string that is contained in this prefix store starting at po...
Definition: prefixstore.cpp:120
KateOnTheFlyChecker * m_onTheFlyChecker
Definition: katedocument.h:1147
bool isEmpty() const
void setAllowComplexMerge(bool allow)
Allows or disallows merging of "complex" undo groups.
Definition: kateundomanager.cpp:429
void removeFile(const QString &file)
void textInserted(KTextEditor::Document *document, const KTextEditor::Range &range)
bool isInWord(QChar c, int attrib=0) const
Definition: katehighlight.cpp:1084
virtual void transformCursor(KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1)
Transform a cursor from one revision to an other.
Definition: katedocument.cpp:4772
KMimeType::Ptr mimeTypeForContent()
Definition: katedocument.cpp:1874
virtual bool saveFile()
save the file obtained by the kparts framework the framework abstracts the uploading of remote files ...
Definition: katedocument.cpp:2076
virtual void writeParameterizedSessionConfig(KConfigGroup &, unsigned long configParameters)
Definition: katedocument.cpp:1602
virtual void setColumn(int column)
int column() const
virtual QString highlightingModeSection(int index) const
Returns the name of the section for a highlight given its index in the highlight list (as returned by...
Definition: katedocument.cpp:1509
void editStart()
Notify KateUndoManager about the beginning of an edit.
Definition: kateundomanager.cpp:65
void lockRevision(qint64 revision)
Lock a revision, this will keep it around until released again.
Definition: katetexthistory.cpp:143
T readEntry(const QString &key, const T &aDefault) const
bool setCursorPositionInternal(const KTextEditor::Cursor &position, uint tabwidth=1, bool calledExternally=false)
Definition: kateview.cpp:1278
int searchDirConfigDepth() const
Should Kate Part search for dir wide config file and if, how depth?
Definition: kateconfig.cpp:1022
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
void setBothLines(int line)
bool editInsertLine(int line, const QString &s)
Insert a string at the given line.
Definition: katedocument.cpp:1223
void setIndentationWidth(int indentationWidth)
Definition: kateconfig.cpp:435
virtual void setMarkPixmap(MarkInterface::MarkTypes, const QPixmap &)
Definition: katedocument.cpp:1806
Definition: ontheflycheck.h:40
bool editMarkLineAutoWrapped(int line, bool autowrapped)
Mark line as autowrapped.
Definition: katedocument.cpp:1056
void annotationModelChanged(KTextEditor::AnnotationModel *, KTextEditor::AnnotationModel *)
void setPosition(const KTextEditor::Cursor &position)
Set the current cursor position to position.
Definition: documentcursor.cpp:68
void slotLineRemoved(int line, const QString &s)
Notify KateUndoManager that a line was removed.
Definition: kateundomanager.cpp:175
void deleteDictionaryRange(KTextEditor::MovingRange *movingRange)
Definition: katedocument.cpp:5211
virtual bool removeText(const KTextEditor::Range &range, bool block=false)
Definition: katedocument.cpp:633
void documentSavedOrUploaded(KTextEditor::Document *document, bool saveAs)
void setPageUpDownMovesCursor(bool on)
Definition: katedocument.cpp:3942
void slotLineUnWrapped(int line, int col, int length, bool lineRemoved)
Notify KateUndoManager that a line was un-wrapped.
Definition: kateundomanager.cpp:163
void setHighlightedLineColor(const QColor &col)
Definition: kateconfig.cpp:2228
static void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
bool isModified() const
virtual void discardDataRecovery()
Definition: katedocument.cpp:2462
virtual void slotModifiedOnDisk(KTextEditor::View *v=0)
Ask the user what to do, if the file has been modified on disk.
Definition: katedocument.cpp:3712
void checkRequiredStyle()
Check if the current highlighting mode provides the style required by the current indenter...
Definition: kateautoindent.cpp:355
void addAction(QAction *action, bool closeOnTrigger=true)
QString fileType(KateDocument *doc, const QString &fileToReadFrom)
get the right fileType for the given document -1 if none found !
Definition: katemodemanager.cpp:205
bool setEncoding(const QString &encoding)
Definition: kateconfig.cpp:811
void setAutoDeleteWidget(bool autoDeleteWidget)
virtual void readParameterizedSessionConfig(const KConfigGroup &, unsigned long configParameters)
Definition: katedocument.cpp:1548
virtual KTextEditor::Search::SearchOptions supportedSearchOptions() const
Definition: katedocument.cpp:1432
QStringList list(const QString &fileClass)
QString localFilePath() const
void rangeEmpty(KTextEditor::MovingRange *movingRange)
Definition: katedocument.cpp:5206
virtual QString markDescription(MarkInterface::MarkTypes) const
Definition: katedocument.cpp:1831
void exclusiveEditStart(KTextEditor::Document *document)
static bool checkOverwrite(KUrl u, QWidget *parent)
Definition: katedocument.cpp:4585
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.