• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

Overview of the Core Interface Design

Overview | Design | Coding Guidelines | Porting to KDE 4 | Using

The core of the KTextEditor interfaces consists of several main interfaces:

  • KTextEditor::Factory
    The Factory provides access to the editor object.
  • KTextEditor::Editor
    The Editor interface allows you to create documents, get a document list, and a be informed when a new document is created.
  • KTextEditor::Document
    The Document interface represents a single document and enables the creation of views, access to and manipulation of document contents, and access to document extension interfaces.
  • KTextEditor::View
    The View provides a widget that displays the contents of a Document, and its interface allows for manipulation of text selection, position of the cursor and mouse, text selections, and behaviour of the view. Additionally it provides access to the view extension interfaces.

The hierarchy can be illustrated as follows:

ktexteditorhierarchy.png
Basic KTextEditor Hierarchy

Notes for KTextEditor Users

To use a KTextEditor implementation you first have to get the KTextEditor::Editor object. This can be done in several ways and is described in detail in the following documentation:

  • KTextEditor::Factory
  • KTextEditor::EditorChooser

Notes for KTextEditor Developers

The KTextEditor::Factory provides access to its KTextEditor::Editor. The Editor has a list of all opened documents and can create new documents. A Document's content is visualized by a View. A Document can have any number of views (or none). When the contents of the document are changed, the change is reflected in all views.

The Factory should always return the same Editor object, as it does not make sense to load the same editor implementation several times. Further notes about the Editor implementation can be found in the Implementation Notes.

As applications can load different editor implementations via different factories (for example the kate-part and the yzis-part) the signal KTextEditor::Editor::documentCreated() contains the responsible Editor as first argument.

See also
KTextEditor::Factory, KTextEditor::Editor, KTextEditor::Document, KTextEditor::View
Author
Dominik Haumann <dhdev.nosp@m.@gmx.nosp@m..de>
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal