kate/kate/interfaces/kate
#include <mainwindow.h>
Public Types | |
enum | Position { Left = 0, Right = 1, Top = 2, Bottom = 3 } |
Signals | |
void | pluginViewCreated (const QString &name, Kate::PluginView *pluginView) |
void | pluginViewDeleted (const QString &name, Kate::PluginView *pluginView) |
void | unhandledShortcutOverride (QEvent *e) |
void | viewChanged () |
void | viewCreated (KTextEditor::View *view) |
Public Member Functions | |
MainWindow (void *mainWindow) | |
virtual | ~MainWindow () |
KTextEditor::View * | activateView (KTextEditor::Document *document) |
KTextEditor::View * | activeView () |
class QWidget * | centralWidget () const |
QWidget * | createToolView (const QString &identifier, MainWindow::Position pos, const QPixmap &icon, const QString &text) |
QWidget * | createToolView (Kate::Plugin *plugin, const QString &identifier, MainWindow::Position pos, const QPixmap &icon, const QString &text) |
KXMLGUIFactory * | guiFactory () const |
bool | hideToolView (QWidget *widget) |
bool | moveToolView (QWidget *widget, MainWindow::Position pos) |
KTextEditor::View * | openUrl (const KUrl &url, const QString &encoding=QString()) |
PluginView * | pluginView (const QString &name) |
void | showPluginConfigPage (Kate::PluginConfigPageInterface *configpageinterface, uint id) |
bool | showToolView (QWidget *widget) |
const QList< KTextEditor::View * > & | views () const |
class QWidget * | window () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
Interface to a mainwindow.
Introduction
The class MainWindow represents a toplevel window, with menu bar, statusbar etc, get it with window(). A mainwindow usually has an active View, access it with activeView(). To set another active view use activateView().
Toolviews
It is possible to embedd new toolviews into a mainwindow. To create a toolview use createToolView(), then you can move, hide or show the toolview by using moveToolView(), hideToolView() or showToolView().
With guiFactory() you can access the KXMLGUIFactory framework and add gui clients.
To access a mainwindow use the Application object. You should never have to create an instance of this class yourself.
- See also
- KXMLGUIFactory
Definition at line 68 of file mainwindow.h.
Member Enumeration Documentation
Toolview position.
A toolview can only be at one side at a time.
Enumerator | |
---|---|
Left |
Left side. |
Right |
Right side. |
Top |
Top side. |
Bottom |
Bottom side. |
Definition at line 207 of file mainwindow.h.
Constructor & Destructor Documentation
Kate::MainWindow::MainWindow | ( | void * | mainWindow | ) |
Constructor.
Create a new mainwindow. You as a plugin developer should never have to create a new mainwindow yourself. Access the mainwindows via the global Application.
- Parameters
-
mainWindow internal usage
Definition at line 45 of file mainwindow.cpp.
|
virtual |
Virtual destructor.
Definition at line 53 of file mainwindow.cpp.
Member Function Documentation
KTextEditor::View * Kate::MainWindow::activateView | ( | KTextEditor::Document * | document | ) |
Activate the view with the corresponding document
.
If none exist for this document, create one
- Parameters
-
document the document
- Returns
- activated view of this document
Definition at line 83 of file mainwindow.cpp.
KTextEditor::View * Kate::MainWindow::activeView | ( | ) |
QWidget * Kate::MainWindow::centralWidget | ( | ) | const |
Access the widget (in the middle of the four sidebars) in which the editor component and the KateTabBar are embedded.
This widget is a KVBox, so other child widgets can be embedded themselves under the editor widget.
- Returns
- the central widget
Definition at line 68 of file mainwindow.cpp.
QWidget * Kate::MainWindow::createToolView | ( | const QString & | identifier, |
MainWindow::Position | pos, | ||
const QPixmap & | icon, | ||
const QString & | text | ||
) |
Create a new toolview with unique identifier
at side pos
with icon
and caption text
.
Use the returned widget to embedd your widgets.
- Parameters
-
identifier unique identifier for this toolview pos position for the toolview, if we are in session restore, this is only a preference icon icon to use in the sidebar for the toolview text translated text (i18n()) to use in addition to icon
- Returns
- created toolview on success, otherwise NULL
Definition at line 93 of file mainwindow.cpp.
QWidget * Kate::MainWindow::createToolView | ( | Kate::Plugin * | plugin, |
const QString & | identifier, | ||
MainWindow::Position | pos, | ||
const QPixmap & | icon, | ||
const QString & | text | ||
) |
Create a new toolview with unique identifier
at side pos
with icon
and caption text
.
Use the returned widget to embedd your widgets.
- Parameters
-
plugin which owns this tool view identifier unique identifier for this toolview pos position for the toolview, if we are in session restore, this is only a preference icon icon to use in the sidebar for the toolview text translated text (i18n()) to use in addition to icon
- Returns
- created toolview on success, otherwise NULL
Definition at line 98 of file mainwindow.cpp.
KXMLGUIFactory * Kate::MainWindow::guiFactory | ( | ) | const |
Accesstor to the XMLGUIFactory.
- Returns
- the mainwindow's KXMLGUIFactory.
Definition at line 58 of file mainwindow.cpp.
bool Kate::MainWindow::hideToolView | ( | QWidget * | widget | ) |
Hide the toolview widget
.
- Parameters
-
widget the toolview to hide, where the widget was constructed by createToolView().
- Returns
- true on success, otherwise false
Definition at line 120 of file mainwindow.cpp.
bool Kate::MainWindow::moveToolView | ( | QWidget * | widget, |
MainWindow::Position | pos | ||
) |
Move the toolview widget
to position pos
.
- Parameters
-
widget the toolview to move, where the widget was constructed by createToolView(). pos new position to move widget to
- Returns
- true on success, otherwise false
Definition at line 104 of file mainwindow.cpp.
KTextEditor::View * Kate::MainWindow::openUrl | ( | const KUrl & | url, |
const QString & | encoding = QString() |
||
) |
Open the document url
with the given encoding
.
- Parameters
-
url the document's url encoding the preferred encoding. If encoding is QString() the encoding will be guessed or the default encoding will be used.
- Returns
- a pointer to the created view for the new document, if a document with this url is already existing, its view will be activated
Definition at line 88 of file mainwindow.cpp.
PluginView * Kate::MainWindow::pluginView | ( | const QString & | name | ) |
Get a plugin view with identifier name
.
- Parameters
-
name the plugin's name
- Returns
- pointer to the plugin view if a plugin with
name
is loaded and has a view for this mainwindow, otherwise NULL
Definition at line 133 of file mainwindow.cpp.
|
signal |
This signal is emitted when a Plugin::View is created for this main window.
- Parameters
-
name name of plugin pluginView the new plugin view
|
signal |
This signal is emitted when the Plugin::View got deleted.
- Parameters
-
name name of plugin pluginView the deleted plugin view
Warning !!! DO NOT ACCESS THE DATA REFERENCED BY THE POINTER, IT IS ALREADY INVALID Use the pointer only to remove mappings in hash or maps
void Kate::MainWindow::showPluginConfigPage | ( | Kate::PluginConfigPageInterface * | configpageinterface, |
uint | id | ||
) |
This function is used by a plugin to open the kate configuration dialog at one of its own config pages.
- Parameters
-
configpageinterface the plugin config page interface of the plugin which requests the settings dialog id the positional id of the page within the configuration
Definition at line 128 of file mainwindow.cpp.
bool Kate::MainWindow::showToolView | ( | QWidget * | widget | ) |
Show the toolview widget
.
- Parameters
-
widget the toolview to show, where the widget was constructed by createToolView().
- Returns
- true on success, otherwise false
Definition at line 112 of file mainwindow.cpp.
|
signal |
This signal is emitted for every unhandled ShortcutOverride in a view.
|
signal |
This signal is emitted whenever the active view changes.
|
signal |
This signal is emitted whenever a new view is created.
- Since
- 4.2
const QList< KTextEditor::View * > & Kate::MainWindow::views | ( | ) | const |
QWidget * Kate::MainWindow::window | ( | ) | const |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.