kate/interfaces/kate
Kate::PluginView Class Reference
PluginView interface. More...
#include <plugin.h>

Public Member Functions | |
| MainWindow * | mainWindow () const |
| PluginView (MainWindow *mainWindow) | |
| virtual void | readSessionConfig (KConfigBase *config, const QString &groupPrefix) |
| virtual void | writeSessionConfig (KConfigBase *config, const QString &groupPrefix) |
| virtual | ~PluginView () |
Detailed Description
PluginView interface.
Topics:
Introduction
The class PluginView is a interface for the view of a plugin.
Plugin Views
The Kate application supports multiple mainwindows (Window > New Window). For every Kate MainWindow Plugin::createView() is called, i.e. overwrite createView() in your Plugin derived class and hook your view into the given mainwindow's KXMLGUIFactory. That means you have to create an own KXMLGUIClient derived PluginView class and create an own instance for every mainwindow. One PluginView then is bound to this specific MainWindow.
As already mentioned in the Plugin class documentation, readSessionConfig() and writeSessionConfig() are called to load and save session related data.
Basic PluginView Example
A PluginView is bound to a single MainWindow. To add GUI elements KDE's GUI XML frameworks is used, i.e. the MainWindow provides a KXMLGUIFactory into which the KXMLGUIClient is to be hooked. So the plugin view must inherit from KXMLGUIClient, the following example shows the basic skeleton of the PluginView.
class PluginView : public QObject, public KXMLGUIClient { Q_OBJECT public: // Constructor and other methods PluginView( Kate::MainWindow* mainwindow ) : QObject( mainwindow ), KXMLGUIClient( mainwindow ), m_mainwindow(mainwindow) { ... } // ... private: Kate::MainWindow* m_mainwindow; };
To embedd a plugin view as a tool view you have to call MainWindow::createToolView() and hook your gui into the returned widget.
- See also:
- Plugin, KXMLGUIClient, MainWindow
Definition at line 241 of file plugin.h.
Constructor & Destructor Documentation
| Kate::PluginView::PluginView | ( | MainWindow * | mainWindow | ) |
Constructor.
Definition at line 83 of file plugin.cpp.
| Kate::PluginView::~PluginView | ( | ) | [virtual] |
Virtual destructor.
Definition at line 90 of file plugin.cpp.
Member Function Documentation
| MainWindow * Kate::PluginView::mainWindow | ( | ) | const |
Accessor to the Kate mainwindow of this view.
- Returns:
- the mainwindow object
Definition at line 95 of file plugin.cpp.
| void Kate::PluginView::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:
-
config the KConfig object which is to be used groupPrefix the group prefix which is to be used
- See also:
- writeSessionConfig()
Definition at line 100 of file plugin.cpp.
| void Kate::PluginView::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:
-
config the KConfig object which is to be used groupPrefix the group prefix which is to be used
- See also:
- readSessionConfig()
Definition at line 103 of file plugin.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference