Main Page | Recent changes | Edit this page | Page history

Printable version | Disclaimers | Privacy policy

Not logged in
Log in | Help
 

Extension Interfaces and Plugins

From KDevelop

The idea behind extension interfaces is to provide following features:

The extension interfaces framework is implemented with QExtensionManager and Co. See the Qt documentation for reference.

Contents

[edit] To declare extension interface

       KDEV_DECLARE_EXTENSION_INTERFACE_NS( KDevelop, IMyInterface, "org.kdevelop.IMyInterface")
       Q_DECLARE_INTERFACE( KDevelop::IMyInterface, "org.kdevelop.IMyInterface" )
or use (when the interface is not in a namespace)
       KDEV_DECLARE_EXTENSION_INTERFACE( IMyInterface, "org.kdevelop.IMyInterface" )
       Q_DECLARE_INTERFACE( IMyInterface, "org.kdevelop.IMyInterface" )

[edit] To implement extension interface

       KDEV_USE_EXTENSION_INTERFACE( IMyInterface )
       X-KDevelop-Interfaces=IMyInterface
Code Example:
       class MyPlugin: public KDevelop::IPlugin, public KDevelop::IMyInterface {
           Q_OBJECT
           Q_INTERFACES(KDevelop::IMyInterface)
       public:
           MyPlugin( QObject* parent ) : IPlugin( parent )
           {
               KDEV_USE_EXTENSION_INTERFACE( KDevelop::IMyInterface )
           }
       };

[edit] To load a plugin that supports extension interface

[edit] To set a dependency between plugins

       X-KDevelop-IRequired=IMyInterface,IMyOtherInterface
It is not possible to set direct inter-plugin dependencies. The plugin shall never expect another plugin, it shall only expect an interface.

Retrieved from "http://www.kdevelop.org/mediawiki/index.php/Extension_Interfaces_and_Plugins"

This page has been accessed 5,257 times. This page was last modified 07:42, 10 July 2007. Content is available under GNU Free Documentation License 1.2.


[Main Page]
Main Page
Community portal
Current events
Recent changes
Help
Donations

Edit this page
Discuss this page
Page history
What links here
Related changes

Special pages
Bug reports