• 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
  • Plugin
Public Member Functions | List of all members
Kate::Plugin Class Reference

#include <plugin.h>

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

Public Member Functions

 Plugin (Application *application=0, const char *name=0)
 
virtual ~Plugin ()
 
Application * application () const
 
virtual PluginView * createView (MainWindow *mainWindow)
 
virtual void readSessionConfig (KConfigBase *config, const QString &groupPrefix)
 
virtual void writeSessionConfig (KConfigBase *config, const QString &groupPrefix)
 
- 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

Kate plugin interface.

Topics:

  • Introduction
  • Configuration Management
  • Plugin Views
  • Config Pages

Introduction

The Plugin class is the central part of a Kate plugin. It is possible to represent your plugin in the GUI with a subclass of PluginView. Furthermore if the plugin is configurable (and thus has config pages) you have to additionally derive your plugin from PluginConfigPageInterface.

Configuration Management

When Kate loads a session it calls readSessionConfig(), so if you have config settings use this function to load them. To save config settings for a session use writeSessionConfig(), as it will be called whenever a session is saved/closed.

If you want to save config settings which are not bound to a session but valid for all plugin instances you have to create your own KConfig like this:

KConfig* myConfig = new KConfig("katemypluginrc");

Plugin Views

If your plugin needs to be present in the GUI (e.g. menu or toolbar entries) you have to subclass PluginView and return a new instance of your plugin view, like this:

class MyPluginView : public Kate::PluginView
{
Q_OBJECT
public:
MyPluginView(MainWindow *mainWindow);
// possibilities of gui:
// - hook into the menus with KXMLGUIClient
// - create a toolView and put a widget into it with MainWindow::createToolView()
};
class MyPlugin : public Kate::Plugin
{
Q_OBJECT
public:
// other methods etc...
PluginView *createView(MainWindow *mainWindow)
{
return new MyPluginView(mainWindow);
}
};

The Kate application takes care and deletes all plugin views. Further information can be found in the class documentation of PluginView.

Config Pages

If your plugin is configurable it makes sense to have config pages which appear in Kate's settings dialog. To tell the plugin loader that your plugin supports config pages you have to additionally derive your plugin from the class PluginConfigPageInterface. Read the class documentation for PluginConfigPageInterface to see how to do this right.

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

Definition at line 114 of file plugin.h.

Constructor & Destructor Documentation

Kate::Plugin::Plugin ( Application *  application = 0,
const char *  name = 0 
)
explicit

Constructor.

Parameters
applicationthe Kate application
nameidentifier

Definition at line 58 of file plugin.cpp.

Kate::Plugin::~Plugin ( )
virtual

Virtual destructor.

Definition at line 63 of file plugin.cpp.

Member Function Documentation

Application * Kate::Plugin::application ( ) const

Accessor to the Kate application.

Returns
the application object

Definition at line 81 of file plugin.cpp.

PluginView * Kate::Plugin::createView ( MainWindow *  mainWindow)
virtual

Create a new View for this plugin for the given Kate MainWindow This may be called arbitrary often by the application to create as much views as mainwindows are around, the application will take care to delete this views if mainwindows close, you don't need to handle this yourself in the plugin.

The default implementation just doesn't create any view and returns a NULL pointer

Parameters
mainWindowthe MainWindow for which a view should be created
Returns
the new created view or NULL

Definition at line 86 of file plugin.cpp.

void Kate::Plugin::readSessionConfig ( KConfigBase *  config,
const QString &  groupPrefix 
)
virtual

Load session specific settings here.

This function is called whenever a Kate session is loaded. You should use the given config and prefix groupPrefix to store the data. The group prefix exist so that the group does not clash with other applications that use the same config file.

Parameters
configthe KConfig object which is to be used
groupPrefixthe group prefix which is to be used
See also
writeSessionConfig()

Definition at line 91 of file plugin.cpp.

void Kate::Plugin::writeSessionConfig ( KConfigBase *  config,
const QString &  groupPrefix 
)
virtual

Store session specific settings here.

This function is called whenever a Kate session is saved. You should use the given config and prefix groupPrefix to store the data. The group prefix exists so that the group does not clash with other applications that use the same config file.

Parameters
configthe KConfig object which is to be used
groupPrefixthe group prefix which is to be used
See also
readSessionConfig()

Definition at line 94 of file plugin.cpp.


The documentation for this class was generated from the following files:
  • plugin.h
  • plugin.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