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

KParts

KParts::PartBase

KParts::PartBase Class Reference

#include <part.h>

Inheritance diagram for KParts::PartBase:

Inheritance graph
[legend]

List of all members.


Public Member Functions

 PartBase ()
QObject * partObject () const
void setPartObject (QObject *object)
virtual ~PartBase ()

Protected Types

enum  PluginLoadingMode { DoNotLoadPlugins = 0, LoadPlugins = 1, LoadPluginsIfEnabled = 2 }

Protected Member Functions

void loadPlugins (QObject *parent, KXMLGUIClient *parentGUIClient, KInstance *instance)
virtual void setInstance (KInstance *instance, bool loadPlugins)
virtual void setInstance (KInstance *instance)
void setPluginLoadingMode (PluginLoadingMode loadingMode)

Detailed Description

Base class for all parts.

Definition at line 57 of file part.h.


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 KInstance object always overrides LoadPlugins and LoadPluginsIfEnabled.

Enumerator:
DoNotLoadPlugins  Don't load any plugins at all.
LoadPlugins  Load new plugins automatically.

Can be overridden by the plugin if it sets EnabledByDefault=false in the corresponding .desktop file.

LoadPluginsIfEnabled  New plugins are disabled by default.

Can be overridden by the plugin if it sets EnabledByDefault=true in the corresponding .desktop file.

Definition at line 102 of file part.h.


Constructor & Destructor Documentation

PartBase::PartBase (  ) 

Constructor.

Definition at line 84 of file part.cpp.

PartBase::~PartBase (  )  [virtual]

Destructor.

Definition at line 90 of file part.cpp.


Member Function Documentation

void PartBase::loadPlugins ( QObject *  parent,
KXMLGUIClient *  parentGUIClient,
KInstance *  instance 
) [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() )
 {
   QPtrList<KParts::Plugin> plugins = KParts::Plugin::pluginObjects( this );
   QPtrListIterator<KParts::Plugin> it( plugins );
   KParts::Plugin * plugin;
   while( ( plugin = it.current() ) != 0 )
   {
     ++it;
     factory()->addClient(  plugin );
   }
 }

Definition at line 122 of file part.cpp.

QObject * PartBase::partObject (  )  const

Definition at line 100 of file part.cpp.

void PartBase::setInstance ( KInstance *  instance,
bool  loadPlugins 
) [protected, virtual]

Set the instance ( KInstance) for this part.

Call this *first* in the inherited class constructor, because it loads the i18n catalogues.

Definition at line 110 of file part.cpp.

void PartBase::setInstance ( KInstance *  instance  )  [protected, virtual]

Set the instance ( KInstance) for this part.

Call this *first* in the inherited class constructor, because it loads the i18n catalogues.

Reimplemented from KXMLGUIClient.

Definition at line 105 of file part.cpp.

void PartBase::setPartObject ( QObject *  object  ) 

Internal method.

Called by KParts::Part to specify the parent object for plugin objects.

For internal use only.

Definition at line 95 of file part.cpp.

void PartBase::setPluginLoadingMode ( PluginLoadingMode  loadingMode  )  [protected]

For a KParts::Part: call this before setInstance().

For a KParts::MainWindow: call this before createGUI().

Definition at line 128 of file part.cpp.


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

KParts

Skip menu "KParts"
  • Main Page
  • 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