kate/kate/interfaces/kate
#include <plugin.h>
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) |
Detailed Description
Kate plugin interface.
Topics:
intro
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:
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:
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
Constructor & Destructor Documentation
|
explicit |
Constructor.
- Parameters
-
application the Kate application name identifier
Definition at line 58 of file plugin.cpp.
|
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.
|
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
-
mainWindow the MainWindow for which a view should be created
- Returns
- the new created view or NULL
Definition at line 86 of file plugin.cpp.
|
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
-
config the KConfig object which is to be used groupPrefix the group prefix which is to be used
- See also
- writeSessionConfig()
Definition at line 91 of file plugin.cpp.
|
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
-
config the KConfig object which is to be used groupPrefix the 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:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.