KSettings::PluginPage Class Reference
[Settings UI classesPlugin handling classes]

#include <pluginpage.h>

Inheritance diagram for KSettings::PluginPage:

KCModule QWidget List of all members.

Detailed Description

Convenience KCModule for creating a plugins config page.

This class makes it very easy to create a plugins configuration page to your program. All you need to do is create a class that is derived from PluginPage and add the appropriate plugin infos to the KPluginSelector. This is done using the pluginSelector() method:

 typedef KGenericFactory<MyAppPluginConfig, QWidget> MyAppPluginConfigFactory;
 K_EXPORT_COMPONENT_FACTORY( kcm_myapppluginconfig, MyAppPluginConfigFactory( "kcm_myapppluginconfig" ) );

 MyAppPluginConfig( QWidget * parent, const char *, const QStringList & args )
     : PluginPage( MyAppPluginConfigFactory::instance(), parent, args )
 {
     pluginSelector()->addPlugins( KGlobal::instance()->instanceName(), i18n( "General Plugins" ), "General" );
     pluginSelector()->addPlugins( KGlobal::instance()->instanceName(), i18n( "Effects" ), "Effects" );
 }

All that remains to be done is to create the appropriate .desktop file

   [Desktop Entry]
   Encoding=UTF-8
   Icon=plugin
   Type=Service
   ServiceTypes=KCModule

   X-KDE-ModuleType=Library
   X-KDE-Library=myapppluginconfig
   X-KDE-FactoryName=MyAppPluginConfigFactory
   X-KDE-ParentApp=myapp
   X-KDE-ParentComponents=myapp

   Name=Plugins
   Comment=Select and configure your plugins:
   

Author:
Matthias Kretz <kretz@kde.org>
Since:
3.2

Definition at line 73 of file pluginpage.h.


Public Member Functions

 PluginPage (QWidget *parent=0, const char *name=0, const QStringList &args=QStringList())
 PluginPage (KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList())
 ~PluginPage ()
KPluginSelectorpluginSelector ()
virtual void load ()
virtual void save ()
virtual void defaults ()

Constructor & Destructor Documentation

KSettings::PluginPage::PluginPage ( QWidget parent = 0,
const char *  name = 0,
const QStringList args = QStringList() 
)

Standart KCModule constructor.

Automatically creates the the KPluginSelector widget.

Definition at line 40 of file pluginpage.cpp.

KSettings::PluginPage::PluginPage ( KInstance instance,
QWidget parent = 0,
const QStringList args = QStringList() 
)

Standart KCModule constructor.

Automatically creates the the KPluginSelector widget.

Definition at line 49 of file pluginpage.cpp.


Member Function Documentation

KPluginSelector * KSettings::PluginPage::pluginSelector (  ) 

Returns:
a reference to the KPluginSelector.

Definition at line 65 of file pluginpage.cpp.

void KSettings::PluginPage::load (  )  [virtual]

Load the state of the plugins (selected or not) from the KPluginInfo objects.

For KParts plugins everything should work automatically. For your own type of plugins you might need to reimplement the KPluginInfo::pluginLoaded() method. If that doesn't fit your needs you can also reimplement this method.

Reimplemented from KCModule.

Definition at line 70 of file pluginpage.cpp.

void KSettings::PluginPage::save (  )  [virtual]

Save the state of the plugins to KConfig objects.

Reimplemented from KCModule.

Definition at line 75 of file pluginpage.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys