• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

kate/kate/interfaces/kate

  • Kate
  • MainWindow
Public Types | Signals | Public Member Functions | List of all members
Kate::MainWindow Class Reference

#include <mainwindow.h>

Inheritance diagram for Kate::MainWindow:
Inheritance graph
[legend]

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 &regExp) 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.

Author
Christoph Cullmann <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>
See also
KXMLGUIFactory

Definition at line 68 of file mainwindow.h.

Member Enumeration Documentation

enum Kate::MainWindow::Position

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
mainWindowinternal usage

Definition at line 45 of file mainwindow.cpp.

Kate::MainWindow::~MainWindow ( )
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
documentthe document
Returns
activated view of this document

Definition at line 83 of file mainwindow.cpp.

KTextEditor::View * Kate::MainWindow::activeView ( )

Access the active view.

Returns
active view

Definition at line 78 of file mainwindow.cpp.

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
identifierunique identifier for this toolview
posposition for the toolview, if we are in session restore, this is only a preference
iconicon to use in the sidebar for the toolview
texttranslated text (i18n()) to use in addition to icon
Returns
created toolview on success, otherwise NULL
Deprecated:

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
pluginwhich owns this tool view
identifierunique identifier for this toolview
posposition for the toolview, if we are in session restore, this is only a preference
iconicon to use in the sidebar for the toolview
texttranslated 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
widgetthe 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
widgetthe toolview to move, where the widget was constructed by createToolView().
posnew 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
urlthe document's url
encodingthe 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
namethe 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.

void Kate::MainWindow::pluginViewCreated ( const QString &  name,
Kate::PluginView *  pluginView 
)
signal

This signal is emitted when a Plugin::View is created for this main window.

Parameters
namename of plugin
pluginViewthe new plugin view
void Kate::MainWindow::pluginViewDeleted ( const QString &  name,
Kate::PluginView *  pluginView 
)
signal

This signal is emitted when the Plugin::View got deleted.

Parameters
namename of plugin
pluginViewthe 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
configpageinterfacethe plugin config page interface of the plugin which requests the settings dialog
idthe 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
widgetthe toolview to show, where the widget was constructed by createToolView().
Returns
true on success, otherwise false
Todo:
add focus parameter: bool showToolView (QWidget *widget, bool giveFocus );

Definition at line 112 of file mainwindow.cpp.

void Kate::MainWindow::unhandledShortcutOverride ( QEvent *  e)
signal

This signal is emitted for every unhandled ShortcutOverride in a view.

void Kate::MainWindow::viewChanged ( )
signal

This signal is emitted whenever the active view changes.

void Kate::MainWindow::viewCreated ( KTextEditor::View *  view)
signal

This signal is emitted whenever a new view is created.

Since
4.2
const QList< KTextEditor::View * > & Kate::MainWindow::views ( ) const

Get a list of all views.

Returns
all views

Definition at line 73 of file mainwindow.cpp.

QWidget * Kate::MainWindow::window ( ) const

Get the toplevel widget.

Returns
the kate main window.

Definition at line 63 of file mainwindow.cpp.


The documentation for this class was generated from the following files:
  • mainwindow.h
  • mainwindow.cpp
This file is part of the KDE documentation.
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.

kate/kate/interfaces/kate

Skip menu "kate/kate/interfaces/kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



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