KTextEditor

mainwindow.h
1 /*
2  SPDX-FileCopyrightText: 2013 Christoph Cullmann <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KTEXTEDITOR_MAINWINDOW_H
8 #define KTEXTEDITOR_MAINWINDOW_H
9 
10 #include <ktexteditor_export.h>
11 
12 #include <QObject>
13 
14 class QEvent;
15 class QIcon;
16 class QUrl;
17 class QWidget;
18 
19 class KXMLGUIFactory;
20 
21 namespace KTextEditor
22 {
23 class Plugin;
24 class Document;
25 class View;
26 
43 class KTEXTEDITOR_EXPORT MainWindow : public QObject
44 {
45  Q_OBJECT
46 
47 public:
54  MainWindow(QObject *parent);
55 
59  virtual ~MainWindow();
60 
61  //
62  // Accessors to some window properties and contents
63  //
64 public:
69  QWidget *window();
70 
75  KXMLGUIFactory *guiFactory();
76 
77  //
78  // Signals related to the main window
79  //
80 Q_SIGNALS:
85  void unhandledShortcutOverride(QEvent *e);
86 
87  //
88  // View access and manipulation interface
89  //
90 public:
96 
101  KTextEditor::View *activeView();
102 
110  KTextEditor::View *activateView(KTextEditor::Document *document);
111 
121  KTextEditor::View *openUrl(const QUrl &url, const QString &encoding = QString());
122 
128  bool closeView(KTextEditor::View *view);
129 
134  void splitView(Qt::Orientation orientation);
135 
141  bool closeSplitView(KTextEditor::View *view);
142 
147  bool viewsInSameSplitView(KTextEditor::View *view1, KTextEditor::View *view2);
148 
149  //
150  // Signals related to view handling
151  //
152 Q_SIGNALS:
157  void viewChanged(KTextEditor::View *view);
158 
163  void viewCreated(KTextEditor::View *view);
164 
165  //
166  // Interface to allow view bars to be constructed in a central place per window
167  //
168 public:
174  QWidget *createViewBar(KTextEditor::View *view);
175 
180  void deleteViewBar(KTextEditor::View *view);
181 
187  void addWidgetToViewBar(KTextEditor::View *view, QWidget *bar);
188 
193  void showViewBar(KTextEditor::View *view);
194 
199  void hideViewBar(KTextEditor::View *view);
200 
201  //
202  // ToolView stuff, here all stuff belong which allows to
203  // add/remove and manipulate the toolview of this main windows
204  //
205 public:
211  Left = 0,
212  Right = 1,
213  Top = 2,
214  Bottom = 3
215  };
216 
229  QWidget *createToolView(KTextEditor::Plugin *plugin, const QString &identifier, KTextEditor::MainWindow::ToolViewPosition pos, const QIcon &icon, const QString &text);
230 
239 
247  bool showToolView(QWidget *widget);
248 
255  bool hideToolView(QWidget *widget);
256 
257  //
258  // Application plugin accessors
259  //
260 public:
268  bool showPluginConfigPage(KTextEditor::Plugin *plugin, int page);
269 
276  QObject *pluginView(const QString &name);
277 
278  //
279  // Signals related to application plugins
280  //
281 Q_SIGNALS:
288  void pluginViewCreated(const QString &name, QObject *pluginView);
289 
299  void pluginViewDeleted(const QString &name, QObject *pluginView);
300 
301 private:
305  friend class MainWindowPrivate;
306 
310  class MainWindowPrivate *const d;
311 };
312 
313 } // namespace KTextEditor
314 
315 #endif
ToolViewPosition
Toolview position.
Definition: mainwindow.h:210
Left
QWidget * widget() override
A KParts derived class representing a text document.
Definition: document.h:185
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Top
KTextEditor Plugin interface.
Definition: plugin.h:78
Orientation
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:143
This class allows the application that embeds the KTextEditor component to allow it to access parts o...
Definition: mainwindow.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Nov 26 2020 22:56:14 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.