KTextEditor

application.h
1 /* SPDX-License-Identifier: LGPL-2.0-or-later
2 
3  Copyright (C) 2013 Christoph Cullmann <[email protected]>
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 
21 #ifndef KTEXTEDITOR_APPLICATION_H
22 #define KTEXTEDITOR_APPLICATION_H
23 
24 #include <ktexteditor_export.h>
25 
26 #include <QObject>
27 
28 namespace KTextEditor
29 {
30 class Plugin;
31 class Document;
32 class MainWindow;
33 
53 class KTEXTEDITOR_EXPORT Application : public QObject
54 {
55  Q_OBJECT
56 
57 public:
64  Application(QObject *parent);
65 
69  virtual ~Application();
70 
77  bool quit();
78 
79  //
80  // MainWindow related accessors
81  //
82 public:
88 
95  KTextEditor::MainWindow *activeMainWindow();
96 
97  //
98  // Document related accessors
99  //
100 public:
106  QList<KTextEditor::Document *> documents();
107 
114  KTextEditor::Document *findUrl(const QUrl &url);
115 
124  KTextEditor::Document *openUrl(const QUrl &url, const QString &encoding = QString());
125 
131  bool closeDocument(KTextEditor::Document *document);
132 
140  bool closeDocuments(const QList<KTextEditor::Document *> &documents);
141 
142 Q_SIGNALS:
148  void documentCreated(KTextEditor::Document *document);
149 
157  void documentWillBeDeleted(KTextEditor::Document *document);
158 
167  void documentDeleted(KTextEditor::Document *document);
168 
174  void aboutToCreateDocuments();
175 
181  void documentsCreated(const QList<KTextEditor::Document *> &documents);
182 
189  void aboutToDeleteDocuments(const QList<KTextEditor::Document *> &);
190 
197  void documentsDeleted(const QList<KTextEditor::Document *> &documents);
198 
199  //
200  // Application plugin accessors
201  //
202 public:
208  KTextEditor::Plugin *plugin(const QString &name);
209 
210  //
211  // Signals related to application plugins
212  //
213 Q_SIGNALS:
220  void pluginCreated(const QString &name, KTextEditor::Plugin *plugin);
221 
231  void pluginDeleted(const QString &name, KTextEditor::Plugin *plugin);
232 
233 private:
237  friend class ApplicationPrivate;
238 
242  class ApplicationPrivate *const d;
243 };
244 
245 } // namespace KTextEditor
246 
247 #endif
A KParts derived class representing a text document.
Definition: document.h:197
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
KTextEditor Plugin interface.
Definition: plugin.h:90
This class allows the application that embeds the KTextEditor component to allow it access to applica...
Definition: application.h:53
This class allows the application that embeds the KTextEditor component to allow it to access parts o...
Definition: mainwindow.h:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 23:10:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.