/** \mainpage libkipi reference page. This page will tell you both how to develop a new plugin for KIPI, and how to add KIPI support to a new application (referred to as host application). You can find more information about KIPI at this url. This documentation has been writen by Renchi Raju, Gilles Caulier, Jesper K. Pedersen, and Aurelien Gateau.

Developing a new Plugin

The easiest way to start a new plugin, is to copy the hello world plugin, which you may find in kdeextragear-libs-1/kipi-plugins. Please also read this tutorial which tells in general about developing a plugin structure for an application, but it also gives some background information on how plugins are loaded, and especially on the macros involved. The tutorial has been written by one of the KIPI authors, so it matches fairly good the model of KIPI (except the part on merging GUI's from plugins).

General things to do to implement a plugin

Here is a list of things to do.

Retrieving information from the host application

The above was the required step to build the plugin. The following will tell you about the functions with which you communicate with the host application. The origin of all your communication with the host application is \ref KIPI::Interface. You obtain a pointer to this by casting the parent pointer given to your plugin during construction. Selection of images can be obtained using KIPI::Interface::currentSelection(), KIPI::Interface::currentAlbum() and KIPI::Interface::allAlbums(). These methods uses KIPI::ImageCollection to wrap a selection of images. Finally to obtain information about individual images, call KIPI::Interface::info(), which returns a KIPI::ImageInfo, with the information. When developing plugins, you should pay special attention to the fact the different host applications may have different feature sets they support. Information about what the host application support can be obtained from KIPI::Interface::hasFeature().

Utilities for Plugins

KIPI has a number of utilities useful when developing plugins:

Adding KIPI support to a new host application.

To add KIPI support to your application you must inherit KIPI::Interface, and give an instance of this class to KIPI::PluginLoader. See \ref KIPI::PluginLoader for details on loading plugins. To be able to create an instance of your subclass of KIPI::Interface, you must of course implement all the pure virtual method of the super class, among others this requires you to create and return instances of KIPI::ImageCollection and KIPI::ImageInfo. The only way you can do so are by giving the classes a pointer to a subclass of KIPI::ImageCollectionShared and KIPI::ImageInfoShared. These sub classes are also your responsibility to implement. The reason why things are that complicated, are to solve the problem of ownership of pointers to the classes in question. The KIPI::ImageCollectionShared pointer you give to KIPI::ImageCollection constructor will be the owned by the ImageCollection instance. */