Commit 5deb0f36 authored by Eike Ziller's avatar Eike Ziller

Editors: Add at least some short documentation.

Change-Id: I7fc7946405d3cbb1af0cf29a9d328d857eb8304a
Reviewed-by: default avatarEike Ziller <>
parent 2678662f
......@@ -34,6 +34,22 @@
#include <QFile>
#include <QFileInfo>
\class Core::IDocument
\brief The IDocument class describes a document that can be saved and reloaded.
The most common use for implementing an IDocument subclass, is as a document for an IEditor
implementation. Multiple editors can work in the same document instance, so the IDocument
subclass should hold all data and functions that are independent from the specific
IEditor instance, for example the content, highlighting information, the name of the
corresponding file, and functions for saving and reloading the file.
Each IDocument subclass works only with the corresponding IEditor subclasses that it
was designed to work with.
\fn QString Core::IDocument::filePath() const
Returns the absolute path of the file that this document refers to. May be empty for
......@@ -34,12 +34,11 @@
#include <QTextCodec>
\class Core::TextFile
\brief The TextFile class is a base class for text files with encoding
\class Core::TextDocument
\brief The TextDocument class is a very general base class for documents that work with text.
This class stores the format obtained from read operations and uses that when writing
out files, thus ensuring that CRLF/encodings are preserved.
This class contains helper methods for saving and reading text files with encoding and
line ending settings.
\sa Utils::TextFileUtils
......@@ -54,6 +54,14 @@
using namespace Core;
\class TextEditor::BaseTextDocument
\brief The BaseTextDocument class is the base class for QTextDocument based documents.
Subclasses of BaseTextEditor can either use BaseTextDocument as is (and this is the default),
or created subclasses of BaseTextDocument if they have special requirements.
namespace TextEditor {
class BaseTextDocumentPrivate
......@@ -104,6 +104,14 @@
\class TextEditor::BaseTextEditor
\brief The BaseTextEditor class is a base class for QPlainTextEdit-based text editors.
The corresponding document base class is BaseTextDocument, the corresponding widget base class
is BaseTextEditorWidget.
using namespace Core;
using namespace Utils;
......@@ -33,6 +33,23 @@
using namespace TextEditor;
\class TextEditor::ITextEditorDocument
\brief The ITextEditorDocument class is an abstract base for documents of text editors.
It is the base class for documents used by implementations of the ITextEditor class,
and contains basic functions for retrieving text content and markers (like bookmarks).
\class TextEditor::ITextEditor
\brief The ITextEditor class is an abstract base class for text editors.
It contains the basic functions for retrieving and setting cursor position and selections,
and operations on them, like removing or inserting. It uses implementations of
ITextEditorDocument as the underlying document.
ITextEditorDocument::ITextEditorDocument(QObject *parent)
: Core::TextDocument(parent)
......@@ -48,6 +48,16 @@
using namespace Core;
using namespace TextEditor::Internal;
\class TextEditor::PlainTextEditor
\brief The PlainTextEditor class is a text editor implementation that adds highlighting
by using the Kate text highlighting definitions, and some basic auto indentation.
It is the default editor for text files used by \QC, if no other editor implementation
matches the MIME type. The corresponding document is implemented in PlainTextDocument,
the corresponding widget is implemented in PlainTextEditorWidget.
namespace TextEditor {
PlainTextEditor::PlainTextEditor(PlainTextEditorWidget *editor)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment