• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

kate/interfaces/kate

Kate::PluginView

Kate::PluginView Class Reference

PluginView interface. More...

#include <plugin.h>

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

List of all members.

Public Member Functions

 PluginView (MainWindow *mainWindow)
virtual ~PluginView ()
MainWindow * mainWindow () const
virtual void readSessionConfig (KConfigBase *config, const QString &groupPrefix)
virtual void writeSessionConfig (KConfigBase *config, const QString &groupPrefix)

Detailed Description

PluginView interface.

Topics:

  • Introduction
  • Plugin Views
  • Basic PluginView Example

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 Kate::XMLGUIClient, the following example shows the basic skeleton of the PluginView.

   class PluginView : public QObject, public Kate::XMLGUIClient
   {
       Q_OBJECT
   public:
       // Constructor and other methods
       PluginView( Kate::MainWindow* mainwindow )
         : QObject( mainwindow )
         , Kate::XMLGUIClient( YourPluginFactory::componentData() )
         , 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, XMLGUIClient, KXMLGUIClient, MainWindow
Author:
Christoph Cullmann <cullmann@kde.org>

Definition at line 243 of file plugin.h.


Constructor & Destructor Documentation

Kate::PluginView::PluginView ( MainWindow *  mainWindow  ) 

Constructor.

Definition at line 88 of file plugin.cpp.

Kate::PluginView::~PluginView (  )  [virtual]

Virtual destructor.

Definition at line 95 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 100 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 105 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 108 of file plugin.cpp.


The documentation for this class was generated from the following files:
  • plugin.h
  • plugin.cpp

kate/interfaces/kate

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

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal