KParts
KParts::PartBase Class Reference
#include <part.h>

Detailed Description
Base class for all parts.Base class for all parts.
Definition at line 66 of file part.h.
Public Member Functions | |
| PartBase () | |
| virtual | ~PartBase () |
| void | setPartObject (QObject *object) |
| QObject * | partObject () const |
Protected Types | |
| enum | PluginLoadingMode { DoNotLoadPlugins = 0, LoadPlugins = 1, LoadPluginsIfEnabled = 2 } |
Protected Member Functions | |
| virtual void | setComponentData (const KComponentData &componentData) |
| virtual void | setComponentData (const KComponentData &componentData, bool loadPlugins) |
| void | loadPlugins (QObject *parent, KXMLGUIClient *parentGUIClient, const KComponentData &componentData) |
| void | setPluginLoadingMode (PluginLoadingMode loadingMode) |
| void | setPluginInterfaceVersion (int version) |
| PartBase (PartBasePrivate &dd) | |
Protected Attributes | |
| PartBasePrivate * | d_ptr |
Member Enumeration Documentation
enum KParts::PartBase::PluginLoadingMode [protected] |
We have three different policies, whether to load new plugins or not.
The value in the KConfig object of the KComponentData object always overrides LoadPlugins and LoadPluginsIfEnabled.
- Enumerator:
Constructor & Destructor Documentation
Member Function Documentation
| void PartBase::setPartObject | ( | QObject * | object | ) |
Internal method.
Called by KParts::Part to specify the parent object for plugin objects.
| void PartBase::setComponentData | ( | const KComponentData & | componentData | ) | [protected, virtual] |
Set the componentData(KComponentData) for this part.
Call this *first* in the inherited class constructor, because it loads the i18n catalogs.
Reimplemented from KXMLGUIClient.
| void PartBase::setComponentData | ( | const KComponentData & | componentData, | |
| bool | loadPlugins | |||
| ) | [protected, virtual] |
| void PartBase::loadPlugins | ( | QObject * | parent, | |
| KXMLGUIClient * | parentGUIClient, | |||
| const KComponentData & | componentData | |||
| ) | [protected] |
Load the Plugins honoring the PluginLoadingMode.
If you call this method in an already constructed GUI (like when the user has changed which plugins are enabled) you need to add the new plugins to the KXMLGUIFactory:
if( factory() ) { QList<KParts::Plugin *> plugins = KParts::Plugin::pluginObjects( this ); for(int i = 0; i != plugins.size(); ++i) { factory()->addClient( plugins[i] ); } }
| void PartBase::setPluginLoadingMode | ( | PluginLoadingMode | loadingMode | ) | [protected] |
Set how plugins should be loaded.
- Parameters:
-
loadingMode see PluginLoadingMode
| void KParts::PartBase::setPluginInterfaceVersion | ( | int | version | ) | [protected] |
If you change the binary interface offered by your part, you can avoid crashes from old plugins lying around by setting X-KDE-InterfaceVersion=2 in the .desktop files of the plugins, and calling setPluginInterfaceVersion( 2 ), so that the old plugins are not loaded.
Increase both numbers every time a binary incompatible change in the application's plugin interface is made.
- Parameters:
-
version the interface version that plugins must have in order to be loaded.
Member Data Documentation
PartBasePrivate* KParts::PartBase::d_ptr [protected] |
The documentation for this class was generated from the following files:
KDE 4.0 API Reference