class KTextEditor.Editor


abstract class

Table of contents
Modules
ktexteditor Classes
All Classes
Module ktexteditor
Namespace ktexteditor
Class KTextEditor.Editor
Inherits QObject

Accessor interface for Editor part.

Topics: - editor_intro - editor_config - editor_notes - editor_extensions

Introduction

The Editor part can be accessed via the KTextEditor.Factory or the KTextEditor.EditorChooser and provides general information and configuration methods for the Editor implementation, for example KAboutData by using aboutData().

The Editor implementation has a list of all opened documents. Get this list with documents(). To create a new Document call createDocument(). The signal documentCreated() is emitted whenever the Editor created a new document.

Editor Configuration

If the Editor implementation supports a config dialog configDialogSupported() returns true, then the config dialog can be shown with configDialog(). Instead of using the config dialog, the config pages can be embedded into the application's config dialog. To do this, configPages() returns the number of config pages the Editor implementation provides and configPage() returns the requested page. Further, a config page has a short descriptive name, get it with configPageName(). You can get more detailed name by using configPageFullName(). Also every config page has a pixmap, get it with configPagePixmap(). The configuration can be saved and loaded with readConfig() and writeConfig().

We recommend to embedd the config pages into the main application's config dialog instead of using a separate config dialog, if the config dialog does not look cluttered then. This way, all settings are grouped together in one place.

Implementation Notes

Usually only one instance of the Editor exists. The Kate Part implementation internally uses a static accessor to make sure that only one Kate Part Editor object exists. So several factories still use the same Editor.

readConfig() and writeConfig() should be forwarded to all loaded plugins as well, see KTextEditor.Plugin.readConfig() and KTextEditor.Plugin.writeConfig().

Editor Extension Interfaces

There is only a single extension interface for the Editor: the CommandInterface. With the CommandInterface it is possible to add and remove new command line commands which are valid for all documents. Common use cases are for example commands like find or setting document variables. For further details read the detailed descriptions in the class KTextEditor.CommandInterface.

See also KTextEditor.Factory, KTextEditor.Document, KTextEditor.ConfigPage KTextEditor.Plugin, KTextEditor.CommandInterface Author Christoph Cullmann \



methods