KSettings::PluginPage Class Reference
Settings UI classes | Plugin handling classes

`#include <pluginpage.h>`

Inheritance diagram for KSettings::PluginPage:

## 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())
KPluginSelector * | pluginSelector ()
virtual void | load ()
virtual void | save ()
virtual void | defaults ()
Public Member Functions inherited from KCModule
virtual void | sysdefaults ()
virtual QString | quickHelp () const
virtual const KAboutData * | aboutData () const
void | setAboutData (KAboutData *about)
int | buttons () const
QString | rootOnlyMsg () const
bool | useRootOnlyMsg () const
const QPtrList < KConfigDialogManager > & | configs () const

## Additional Inherited Members

Public Types inherited from KCModule
enum | Button
Signals inherited from KCModule
void | changed (bool state)
void | quickHelpChanged ()
Protected Slots inherited from KCModule
void | changed ()
void | widgetChanged ()
Protected Member Functions inherited from KCModule
KConfigDialogManager * | addConfig (KConfigSkeleton *config, QWidget *widget)
void | setQuickHelp (const QString &help)
void | setButtons (int btn)
void | setRootOnlyMsg (const QString &msg)
void | setUseRootOnlyMsg (bool on)
bool | managedWidgetChangeState () const
void | unmanagedWidgetChangeState (bool)

## 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.nosp@m.@kde.nosp@m..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.

## Member Function Documentation

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

KDE Home | KDE Accessibility Home | Description of Access Keys