• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KParts

  • KParts
  • PartBase
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
KParts::PartBase Class Reference

#include <part.h>

Inheritance diagram for KParts::PartBase:
Inheritance graph
[legend]

Public Member Functions

 PartBase ()
 
virtual ~PartBase ()
 
QObject * partObject () const
 
void setPartObject (QObject *object)
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient ()
 
 KXMLGUIClient (KXMLGUIClient *parent)
 
virtual ~KXMLGUIClient ()
 
QAction * action (const char *name) const
 
virtual QAction * action (const QDomElement &element) const
 
virtual KActionCollection * actionCollection () const
 
void addStateActionDisabled (const QString &state, const QString &action)
 
void addStateActionEnabled (const QString &state, const QString &action)
 
void beginXMLPlug (QWidget *)
 
QList< KXMLGUIClient * > childClients ()
 
KXMLGUIBuilder * clientBuilder () const
 
virtual KComponentData componentData () const
 
virtual QDomDocument domDocument () const
 
void endXMLPlug ()
 
KXMLGUIFactory * factory () const
 
StateChange getActionsToChangeForState (const QString &state)
 
void insertChildClient (KXMLGUIClient *child)
 
virtual QString localXMLFile () const
 
KXMLGUIClient * parentClient () const
 
void plugActionList (const QString &name, const QList< QAction * > &actionList)
 
void prepareXMLUnplug (QWidget *)
 
void reloadXML ()
 
void removeChildClient (KXMLGUIClient *child)
 
void replaceXMLFile (const QString &xmlfile, const QString &localxmlfile, bool merge=false)
 
void setClientBuilder (KXMLGUIBuilder *builder)
 
void setFactory (KXMLGUIFactory *factory)
 
void setXMLGUIBuildDocument (const QDomDocument &doc)
 
void unplugActionList (const QString &name)
 
virtual QString xmlFile () const
 
QDomDocument xmlguiBuildDocument () const
 

Protected Types

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

Protected Member Functions

 PartBase (PartBasePrivate &dd)
 
void loadPlugins (QObject *parent, KXMLGUIClient *parentGUIClient, const KComponentData &componentData)
 
virtual void setComponentData (const KComponentData &componentData)
 
virtual void setComponentData (const KComponentData &componentData, bool loadPlugins)
 
void setPluginInterfaceVersion (int version)
 
void setPluginLoadingMode (PluginLoadingMode loadingMode)
 
- Protected Member Functions inherited from KXMLGUIClient
void loadStandardsXmlFile ()
 
virtual void setDOMDocument (const QDomDocument &document, bool merge=false)
 
virtual void setLocalXMLFile (const QString &file)
 
virtual void setXML (const QString &document, bool merge=false)
 
virtual void setXMLFile (const QString &file, bool merge=false, bool setXMLDoc=true)
 
virtual void stateChanged (const QString &newstate, ReverseStateChange reverse=StateNoReverse)
 
virtual void virtual_hook (int id, void *data)
 

Protected Attributes

PartBasePrivate * d_ptr
 

Additional Inherited Members

- Public Types inherited from KXMLGUIClient
enum  ReverseStateChange
 
- Static Public Member Functions inherited from KXMLGUIClient
static QString findMostRecentXMLFile (const QStringList &files, QString &doc)
 

Detailed Description

Base class for all parts.

Definition at line 64 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 KComponentData 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 119 of file part.h.

Constructor & Destructor Documentation

PartBase::PartBase ( )

Constructor.

Definition at line 108 of file part.cpp.

PartBase::~PartBase ( )
virtual

Destructor.

Definition at line 118 of file part.cpp.

PartBase::PartBase ( PartBasePrivate &  dd)
protected

Definition at line 113 of file part.cpp.

Member Function Documentation

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] );
}
}

Definition at line 156 of file part.cpp.

QObject * PartBase::partObject ( ) const

Definition at line 130 of file part.cpp.

void PartBase::setComponentData ( const KComponentData &  componentData)
protectedvirtual

Set the componentData(KComponentData) for this part.

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

Reimplemented from KXMLGUIClient.

Definition at line 137 of file part.cpp.

void PartBase::setComponentData ( const KComponentData &  componentData,
bool  loadPlugins 
)
protectedvirtual

Set the componentData(KComponentData) for this part.

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

It is recommended to call setComponentData with loadPlugins set to false, and to load plugins at the end of your part constructor (in the case of KParts::MainWindow, plugins are automatically loaded in createGUI anyway, so set loadPlugins to false for KParts::MainWindow as well).

Definition at line 142 of file part.cpp.

void PartBase::setPartObject ( QObject *  object)

Internal method.

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

Definition at line 123 of file part.cpp.

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
versionthe interface version that plugins must have in order to be loaded.

For a KParts::Part: call this before setComponentData. For a KParts::MainWindow: call this before createGUI.

Definition at line 171 of file part.cpp.

void PartBase::setPluginLoadingMode ( PluginLoadingMode  loadingMode)
protected

Set how plugins should be loaded.

Parameters
loadingModesee PluginLoadingMode

For a KParts::Part: call this before setComponentData. For a KParts::MainWindow: call this before createGUI.

Definition at line 164 of file part.cpp.

Member Data Documentation

PartBasePrivate* KParts::PartBase::d_ptr
protected

Definition at line 184 of file part.h.


The documentation for this class was generated from the following files:
  • part.h
  • part.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KParts

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal