kontact

Kontact::Plugin Class Reference

#include <plugin.h>

Inheritance diagram for Kontact::Plugin:

Akregator::Plugin JournalPlugin KAddressbookPlugin KarmPlugin KitchenSyncPlugin KMailPlugin KNodePlugin KNotesPlugin KOrganizerPlugin KPilotPlugin MultiSynkPlugin NewsTickerPlugin SpecialdatesPlugin SummaryView TodoPlugin WeatherPlugin List of all members.

Detailed Description

Base class for all Plugins in Kontact.

Inherit from it to get a plugin. It can insert an icon into the sidepane, add widgets to the widgetstack and add menu items via XMLGUI.

Definition at line 58 of file plugin.h.


Public Slots

void slotConfigUpdated ()

Public Member Functions

 Plugin (Core *core, QObject *parent, const char *name)
 ~Plugin ()
void setIdentifier (const QString &identifier)
QString identifier () const
void setTitle (const QString &title)
QString title () const
void setIcon (const QString &icon)
QString icon () const
void setExecutableName (const QString &bin)
QString executableName () const
void setPartLibraryName (const QCString &)
virtual bool createDCOPInterface (const QString &)
virtual bool isRunningStandalone ()
virtual void bringToForeground ()
virtual const KAboutData * aboutData ()
KParts::ReadOnlyPart * part ()
virtual QString tipFile () const
virtual void select ()
virtual void configUpdated ()
virtual SummarycreateSummaryWidget (QWidget *)
virtual bool showInSideBar () const
void setShowInSideBar (bool hasPart)
virtual bool queryClose () const
DCOPClient * dcopClient () const
virtual int weight () const
void insertNewAction (KAction *action)
QPtrList< KAction > * newActions () const
virtual QStringList invisibleToolbarActions () const
virtual bool canDecodeDrag (QMimeSource *)
virtual void processDropEvent (QDropEvent *)
virtual void readProperties (KConfig *)
virtual void saveProperties (KConfig *)
Corecore () const

Protected Member Functions

virtual KParts::ReadOnlyPart * createPart ()=0
KParts::ReadOnlyPart * loadPart ()
virtual void virtual_hook (int id, void *data)

Constructor & Destructor Documentation

Plugin::Plugin ( Core core,
QObject *  parent,
const char *  name 
)

Creates a new Plugin, note that name parameter name is required if you want your plugin to do dcop via it's own instance of DCOPClient by calling dcopClient.

Note:
name MUST be the name of the application that provides the part! This is the name used for DCOP registration. It's ok to have several plugins using the same application name.

Definition at line 54 of file plugin.cpp.


Member Function Documentation

void Plugin::setIdentifier ( const QString &  identifier  ) 

Sets the identifier.

Definition at line 75 of file plugin.cpp.

QString Plugin::identifier (  )  const

Returns the identifier.

It is used as argument for several methods of Kontacts core.

Definition at line 80 of file plugin.cpp.

void Plugin::setTitle ( const QString &  title  ) 

Sets the localized title.

Definition at line 85 of file plugin.cpp.

QString Plugin::title (  )  const

Returns the localized title.

Definition at line 90 of file plugin.cpp.

void Plugin::setIcon ( const QString &  icon  ) 

Sets the icon name.

Definition at line 95 of file plugin.cpp.

QString Plugin::icon (  )  const

Returns the icon name.

Definition at line 100 of file plugin.cpp.

void Plugin::setExecutableName ( const QString &  bin  ) 

Sets the name of executable (if existant).

Definition at line 105 of file plugin.cpp.

QString Plugin::executableName (  )  const

Returns the name of the binary (if existant).

Definition at line 110 of file plugin.cpp.

void Plugin::setPartLibraryName ( const QCString &   ) 

Set name of library which contains the KPart used by this plugin.

Definition at line 115 of file plugin.cpp.

virtual bool Kontact::Plugin::createDCOPInterface ( const QString &   )  [inline, virtual]

Create the DCOP interface for the given serviceType, if this plugin provides it.

Return false otherwise.

Reimplemented in KAddressbookPlugin, KMailPlugin, KNodePlugin, JournalPlugin, KOrganizerPlugin, and TodoPlugin.

Definition at line 125 of file plugin.h.

virtual bool Kontact::Plugin::isRunningStandalone (  )  [inline, virtual]

Reimplement this method and return wether a standalone application is still running This is only required if your part is also available as standalone application.

Reimplemented in Akregator::Plugin, KAddressbookPlugin, KMailPlugin, KNodePlugin, JournalPlugin, KOrganizerPlugin, and TodoPlugin.

Definition at line 131 of file plugin.h.

void Plugin::bringToForeground (  )  [virtual]

Reimplement this method if your application needs a different approach to be brought in the foreground.

The default behaviour is calling the binary. This is only required if your part is also available as standalone application.

Definition at line 205 of file plugin.cpp.

const KAboutData * Plugin::aboutData (  )  [virtual]

Reimplement this method if you want to add your credits to the Kontact about dialog.

Reimplemented in KNotesPlugin, KPilotPlugin, SpecialdatesPlugin, SummaryView, and WeatherPlugin.

Definition at line 125 of file plugin.cpp.

KParts::ReadOnlyPart * Plugin::part (  ) 

You can use this method if you need to access the current part.

You can be sure that you always get the same pointer as long as the part has not been deleted.

Definition at line 141 of file plugin.cpp.

QString Plugin::tipFile (  )  const [virtual]

Reimplement this method and return the a path relative to "data" to the tips file.

Reimplemented in KMailPlugin, and KOrganizerPlugin.

Definition at line 153 of file plugin.cpp.

void Plugin::select (  )  [virtual]

This function is called when the plugin is selected by the user before the widget of the KPart belonging to the plugin is raised.

Reimplemented in JournalPlugin, KOrganizerPlugin, and TodoPlugin.

Definition at line 187 of file plugin.cpp.

void Plugin::configUpdated (  )  [virtual]

This function is called whenever the config dialog has been closed successfully.

Reimplemented in KAddressbookPlugin.

Definition at line 191 of file plugin.cpp.

virtual Summary* Kontact::Plugin::createSummaryWidget ( QWidget *   )  [inline, virtual]

Reimplement this method if you want to add a widget for your application to Kontact's summary page.

Reimplemented in KMailPlugin, KNotesPlugin, KOrganizerPlugin, TodoPlugin, KPilotPlugin, NewsTickerPlugin, SpecialdatesPlugin, and WeatherPlugin.

Definition at line 174 of file plugin.h.

bool Kontact::Plugin::showInSideBar (  )  const [virtual]

Returns wether the plugin provides a part that should be shown in the sidebar.

Reimplemented in KPilotPlugin.

Definition at line 211 of file plugin.cpp.

void Kontact::Plugin::setShowInSideBar ( bool  hasPart  ) 

Set if the plugin provides a part that should be shown in the sidebar.

Definition at line 216 of file plugin.cpp.

virtual bool Kontact::Plugin::queryClose (  )  const [inline, virtual]

Reimplement this method if you want to add checks before closing down the main kontact window.

Return true if it's OK to close the window. If any loaded plugin returns false from this method, then the main kontact window will not close.

Reimplemented in KMailPlugin.

Definition at line 191 of file plugin.h.

DCOPClient * Plugin::dcopClient (  )  const

Retrieve the current DCOP Client for the plugin.

The clients name is taken from the name argument in the constructor.

Note:
: The DCOPClient object will only be created when this method is called for the first time. Make sure that the part has been loaded before calling this method, if it's the one that contains the DCOP interface that other parts might use.

Definition at line 159 of file plugin.cpp.

virtual int Kontact::Plugin::weight (  )  const [inline, virtual]

Return the weight of the plugin.

The higher the weight the lower it will be displayed in the sidebar. The default implementation returns 0.

Reimplemented in Akregator::Plugin, KAddressbookPlugin, KarmPlugin, KitchenSyncPlugin, KMailPlugin, KNodePlugin, KNotesPlugin, JournalPlugin, KOrganizerPlugin, TodoPlugin, MultiSynkPlugin, SpecialdatesPlugin, and SummaryView.

Definition at line 208 of file plugin.h.

void Plugin::insertNewAction ( KAction *  action  ) 

Insert "New" action.

Definition at line 172 of file plugin.cpp.

QPtrList< KAction > * Plugin::newActions (  )  const

FIXME: write API doc for Kontact::Plugin::newActions().

Definition at line 177 of file plugin.cpp.

virtual QStringList Kontact::Plugin::invisibleToolbarActions (  )  const [inline, virtual]

Returns a list of action name which shall be hidden in the main toolbar.

Reimplemented in Akregator::Plugin, KAddressbookPlugin, KMailPlugin, KNodePlugin, JournalPlugin, KOrganizerPlugin, and TodoPlugin.

Definition at line 223 of file plugin.h.

virtual bool Kontact::Plugin::canDecodeDrag ( QMimeSource *   )  [inline, virtual]

Return, if the plugin can handle the drag object of the given mime type.

Reimplemented in KAddressbookPlugin, KMailPlugin, KOrganizerPlugin, and TodoPlugin.

Definition at line 228 of file plugin.h.

virtual void Kontact::Plugin::processDropEvent ( QDropEvent *   )  [inline, virtual]

Process drop event.

Reimplemented in KAddressbookPlugin, KMailPlugin, KOrganizerPlugin, and TodoPlugin.

Definition at line 233 of file plugin.h.

virtual void Kontact::Plugin::readProperties ( KConfig *   )  [inline, virtual]

Session management: read properties.

Reimplemented in Akregator::Plugin.

Definition at line 238 of file plugin.h.

virtual void Kontact::Plugin::saveProperties ( KConfig *   )  [inline, virtual]

Session management: save properties.

Reimplemented in Akregator::Plugin.

Definition at line 243 of file plugin.h.

void Plugin::slotConfigUpdated (  )  [slot]

internal usage

Definition at line 200 of file plugin.cpp.

virtual KParts::ReadOnlyPart* Kontact::Plugin::createPart (  )  [protected, pure virtual]


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys