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

KUtils

KSettings::PluginPage

KSettings::PluginPage Class Reference
[Settings UI classes, Plugin handling classes]

Convenience KCModule for creating a plugins config page. More...

#include <pluginpage.h>

Inheritance diagram for KSettings::PluginPage:

Inheritance graph
[legend]

List of all members.


Public Member Functions

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

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.


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.

KSettings::PluginPage::~PluginPage (  ) 

Definition at line 60 of file pluginpage.cpp.


Member Function Documentation

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

Reimplemented from KCModule.

Definition at line 80 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.

KPluginSelector * KSettings::PluginPage::pluginSelector (  ) 

Returns:
a reference to the KPluginSelector.

Definition at line 65 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:
  • pluginpage.h
  • pluginpage.cpp

KUtils

Skip menu "KUtils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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