class KTextEditor.Editorabstract class |
|
|
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 \ |
|
Constructor. Create the Editor object with parent. parent - parent object |
|
Get the about data of this Editor part. Returns about data |
|
Show the editor's config dialog, changes will be applied to the editor, but not saved anywhere automagically, call writeConfig() to save them. Instead of using the config dialog, the config pages can be embedded into your own config dialog by using configPages() and configPage(). parent - parent widget See also configDialogSupported() |
|
Check, whether this editor has a configuration dialog. Returns true, if the editor has a configuration dialog, otherwise false See also configDialog() |
|
Get the config page with the number, config pages from 0 to configPages()-1 are available if configPages() > 0. number - index of config page parent - parent widget for config page Returns created config page or 0, if the number is out of bounds See also configPages() |
|
Get a readable full name for the config page number. The name should be translated. Example: If the name is "Filetypes", the full name could be "Filetype Specific Settings". For "Shortcuts" the full name would be something like "Shortcut Configuration". number - index of config page Returns full name of given page index See also configPageName(), configPagePixmap() |
|
Get a pixmap with size for the config page number. number - index of config page Returns pixmap for the given page index See also configPageName(), configPageFullName() |
|
Get a readable name for the config page number. The name should be translated. number - index of config page Returns name of given page index See also configPageFullName(), configPagePixmap() |
|
Get the number of available config pages. If the editor returns a number < 1, it does not support config pages and the embedding application should use configDialog() instead. Returns number of config pages See also configPage(), configDialog() |
|
Create a new document object with parent. parent - parent object Returns new KTextEditor.Document object See also documents() |
|
The editor emits this signal whenever a document was successfully created. editor - editor which created the new document document - the newly created document instance See also createDocument() |
|
Get a list of all documents of this editor. Returns list of all existing documents See also createDocument() |
|
Read editor configuration from KConfig config. Implementation Notes: If config is 0 you should use KApplication.kApplication ()->config() as a fallback solution. Additionally the readConfig() call should be forwarded to every loaded plugin. config - config object See also writeConfig() |
|
Write editor configuration to KConfig config. Implementation Notes: If config is 0 you should use KApplication.kApplication ()->config() as a fallback solution. Additionally the writeConfig() call should be forwarded to every loaded plugin. config - config object See also readConfig() |