• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • interfaces
  • ktexteditor
editor.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 * Copyright (C) 2005 Christoph Cullmann <cullmann@kde.org>
3 * Copyright (C) 2005 Dominik Haumann (dhdev@gmx.de) (documentation)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.*/
19
20#ifndef KDELIBS_KTEXTEDITOR_EDITOR_H
21#define KDELIBS_KTEXTEDITOR_EDITOR_H
22
23#include <ktexteditor/ktexteditor_export.h>
24// our main baseclass of the KTextEditor::Editor
25#include <QtCore/QObject>
26
27#include <kicon.h>
28
29class KAboutData;
30class KConfig;
31
32namespace KTextEditor
33{
34
35class Document;
36class ConfigPage;
37
102class KTEXTEDITOR_EXPORT Editor : public QObject
103{
104 Q_OBJECT
105
106 public:
113 Editor ( QObject *parent );
114
118 virtual ~Editor ();
119
123 public:
131 void setSimpleMode (bool on);
132
138 bool simpleMode () const;
139
140 /*
141 * Methods to create and manage the documents.
142 */
143 public:
150 virtual Document *createDocument ( QObject *parent ) = 0;
151
157 virtual const QList<Document*> &documents () = 0;
158
159 /*
160 * General Information about this editor.
161 */
162 public:
167 virtual const KAboutData *aboutData () const = 0;
168
174 const QString &defaultEncoding () const;
175
176 protected:
183 void setDefaultEncoding (const QString &defaultEncoding);
184
185 /*
186 * Configuration management.
187 */
188 public:
198 virtual void readConfig (KConfig *config = 0) = 0;
199
209 virtual void writeConfig (KConfig *config = 0) = 0;
210
217 virtual bool configDialogSupported () const = 0;
218
230 virtual void configDialog (QWidget *parent) = 0;
231
239 virtual int configPages () const = 0;
240
249 virtual ConfigPage *configPage (int number, QWidget *parent) = 0;
250
258 virtual QString configPageName (int number) const = 0;
259
271 virtual QString configPageFullName (int number) const = 0;
272
279 virtual KIcon configPageIcon (int number) const = 0;
280
281 Q_SIGNALS:
289 void documentCreated (KTextEditor::Editor *editor,
290 KTextEditor::Document *document);
291
292 private:
293 class EditorPrivate* const d;
294};
295
296
305KTEXTEDITOR_EXPORT Editor *editor ( const char *libname );
306
307}
308
309#endif
310
311// kate: space-indent on; indent-width 2; replace-tabs on;
KAboutData
KConfig
KIcon
KTextEditor::ConfigPage
Config page interface for the Editor.
Definition: configpage.h:47
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:112
KTextEditor::Editor
Accessor interface for Editor part.
Definition: editor.h:103
KTextEditor::Editor::writeConfig
virtual void writeConfig(KConfig *config=0)=0
Write editor configuration to KConfig config.
KTextEditor::Editor::documents
virtual const QList< Document * > & documents()=0
Get a list of all documents of this editor.
KTextEditor::Editor::configPage
virtual ConfigPage * configPage(int number, QWidget *parent)=0
Get the config page with the number, config pages from 0 to configPages()-1 are available if configPa...
KTextEditor::Editor::documentCreated
void documentCreated(KTextEditor::Editor *editor, KTextEditor::Document *document)
The editor emits this signal whenever a document was successfully created.
KTextEditor::Editor::configPageFullName
virtual QString configPageFullName(int number) const =0
Get a readable full name for the config page number.
KTextEditor::Editor::configDialog
virtual void configDialog(QWidget *parent)=0
Show the editor's config dialog, changes will be applied to the editor, but not saved anywhere automa...
KTextEditor::Editor::configPages
virtual int configPages() const =0
Get the number of available config pages.
KTextEditor::Editor::configPageName
virtual QString configPageName(int number) const =0
Get a readable name for the config page number.
KTextEditor::Editor::aboutData
virtual const KAboutData * aboutData() const =0
Get the about data of this Editor part.
KTextEditor::Editor::readConfig
virtual void readConfig(KConfig *config=0)=0
Read editor configuration from KConfig config.
KTextEditor::Editor::createDocument
virtual Document * createDocument(QObject *parent)=0
Create a new document object with parent.
KTextEditor::Editor::configDialogSupported
virtual bool configDialogSupported() const =0
Check, whether this editor has a configuration dialog.
KTextEditor::Editor::configPageIcon
virtual KIcon configPageIcon(int number) const =0
Get a pixmap with size for the config page number.
QList
QObject
QWidget
kicon.h
ktexteditor_export.h
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
KTextEditor::editor
Editor * editor(const char *libname)
Helper function for the EditorChooser.
Definition: ktexteditor.cpp:173
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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