• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • TDevelop Interfaces Library
 

TDevelop Interfaces Library

Public Member Functions | List of all members
KDevPlugin Class Reference

#include <kdevplugin.h>

Inheritance diagram for KDevPlugin:
KDevLanguageSupport KDevProject

Public Member Functions

 KDevPlugin (const KDevPluginInfo *info, TQObject *parent, const char *name=0)
 
virtual ~KDevPlugin ()
 
const KDevPluginInfo * info ()
 
KDevMainWindow * mainWindow ()
 
KDevCore * core () const
 
KDevProject * project () const
 
KDevLanguageSupport * languageSupport () const
 
CodeModel * codeModel () const
 
TQDomDocument * projectDom () const
 
KDevPartController * partController () const
 
virtual KDevPluginController * pluginController () const
 
KDevCodeRepository * codeRepository () const
 
template<class Extension >
Extension * extension (const TQString &serviceType, const TQString &constraint="")
 
virtual void restorePartialProjectSession (const TQDomElement *el)
 
virtual void savePartialProjectSession (TQDomElement *el)
 

Detailed Description

The base class for all TDevelop plugins.

Plugin is a component which is loaded into TDevelop shell at startup or by request. Each plugin should have corresponding .desktop file with a description. .desktop file template looks like:

[Desktop Entry]
Encoding=UTF-8
Type=Service
Name=
GenericName=
Comment=
Icon=
X-TDevelop-Plugin-Version=
X-TDevelop-Plugin-Homepage=
X-TDevelop-Plugin-BugsEmailAddress=
X-TDevelop-Plugin-Copyright=
X-TDE-Library=
X-TDevelop-Version=
X-TDevelop-Scope=
X-TDevelop-Properties=
X-TDevelop-Args=

Description of parameters in .desktop file:

  • Name is a non-translatable name of a plugin, it is used in TDETrader queries to search for a plugin (required);
  • GenericName is a translatable name of a plugin, it is used to show plugin names in GUI (required);
  • Comment is a short description about the plugin (optional);
  • Icon is a plugin icon (preferred);
  • X-TDevelop-Plugin-Version is a version of a plugin (optional);
  • X-TDevelop-Plugin-Homepage is a home page of a plugin (optional);
  • X-TDevelop-Plugin-License is a license (optional). can be: GPL, LGPL, BSD, Artistic, TQPL or Custom. If this property is not set, license is considered as unknown;
  • X-TDevelop-Plugin-BugsEmailAddress is an email address for bug reports (optional);
  • X-TDevelop-Plugin-Copyright is a copyright statement (optional);
  • X-TDE-Library is a name of library which contains the plugin (required);
  • X-TDevelop-Version is a version of TDevelop interfaces which is supported by the plugin (required);
  • X-TDevelop-Scope is a scope of a plugin (see below for explanation) (required);
  • X-TDevelop-Args is a list of additional arguments passed to plugins constructor (optional);
  • X-TDevelop-Properties is a list of properties which this plugin supports, see Profile class documentation for explanation (required to work with shells that support profiles).

Plugin scope can be either:

  • Core
  • Global
  • Project

Global plugins are plugins which require only shell to be loaded and do not operate on KDevProject interface and/or do not use project wide information.
Core plugins are global plugins which offer some important "core" functionality and thus are not selectable by user in plugin configuration pages.
Project plugins require a project to be loaded and are usually loaded/unloaded among with the project. If your plugin use KDevProject interface and/or operate on project-related information then this is the project plugin.

See also
KDevGenericFactory class documentation for an information about plugin instantiation and writing factories for plugins.
KDevCore class documentation for an information about features which are available to plugins from shell applications.

Definition at line 107 of file kdevplugin.h.

Constructor & Destructor Documentation

◆ KDevPlugin()

KDevPlugin::KDevPlugin ( const KDevPluginInfo *  info,
TQObject *  parent,
const char *  name = 0 
)

Constructs a plugin.

Parameters
infoImportant information about the plugin - plugin internal and generic (GUI) name, description, a list of authors, etc. That information is used to show plugin information in various places like "about application" dialog, plugin selector dialog, etc. Plugin does not take ownership on info object, also its lifetime should be equal to the lifetime of the plugin.
parentThe parent object for the plugin. Parent object must implement KDevApi interface. Otherwise the plugin will not be constructed.
nameThe internal name which identifies the plugin.

Definition at line 57 of file kdevplugin.cpp.

◆ ~KDevPlugin()

KDevPlugin::~KDevPlugin ( )
virtual

Destructs a plugin.

Definition at line 69 of file kdevplugin.cpp.

Member Function Documentation

◆ codeModel()

CodeModel * KDevPlugin::codeModel ( ) const
Returns
A reference to the memory symbol store.

Definition at line 89 of file kdevplugin.cpp.

◆ codeRepository()

KDevCodeRepository * KDevPlugin::codeRepository ( ) const
Returns
A reference to the code repository (accessor to persistent symbol stores).

Definition at line 124 of file kdevplugin.cpp.

◆ core()

KDevCore * KDevPlugin::core ( ) const
Returns
A reference to the application core - an object which provides basic functionalities for inter-parts communications / cooperation.

Definition at line 79 of file kdevplugin.cpp.

◆ extension()

template<class Extension >
Extension* KDevPlugin::extension ( const TQString &  serviceType,
const TQString &  constraint = "" 
)
inline

Queries for the plugin which supports given service type (such plugins are called extensions in KDevelop).

All already loaded plugins will be queried and the first loaded one to support the service type will be returned. Any plugin can be an extension, only "X-TDE-ServiceTypes=..." entry is required in .desktop file for that plugin.

Template argument is used as a type to cast the result to. This is done because extension is usually derived from a certain base class and not directly from KDevPlugin.

Parameters
serviceTypeThe service type of an extension (like "TDevelop/SourceFormatter").
constraintThe constraint which is applied when quering for the service. This constraint is a usual TDETrader constraint statement (like "[X-TDevelop-Foo]=='MyFoo'").
Returns
A KDevelop extension plugin for given service type or 0 if no plugin supports it

Definition at line 171 of file kdevplugin.h.

◆ info()

const KDevPluginInfo * KDevPlugin::info ( )

Provides an information about the plugin.

Returns
TDEAboutData object which was initialized in the constructor.

Definition at line 134 of file kdevplugin.cpp.

◆ languageSupport()

KDevLanguageSupport * KDevPlugin::languageSupport ( ) const
Returns
A reference to the language support component or 0 if no support available.

Definition at line 99 of file kdevplugin.cpp.

◆ mainWindow()

KDevMainWindow * KDevPlugin::mainWindow ( )
Returns
A reference to the toplevel widget.

Definition at line 74 of file kdevplugin.cpp.

◆ partController()

KDevPartController * KDevPlugin::partController ( ) const
Returns
A reference to the part controller which is used to manipulate loaded KParts.

Definition at line 104 of file kdevplugin.cpp.

◆ pluginController()

KDevPluginController * KDevPlugin::pluginController ( ) const
virtual
Returns
A reference to the plugin controller which is used to manipulate loaded plugin.

Definition at line 109 of file kdevplugin.cpp.

◆ project()

KDevProject * KDevPlugin::project ( ) const
Returns
A reference to the current project component or 0 if no project is loaded.

Definition at line 84 of file kdevplugin.cpp.

◆ projectDom()

TQDomDocument * KDevPlugin::projectDom ( ) const
Returns
A reference to the DOM tree that represents the project file or 0 if no project is loaded.

Definition at line 94 of file kdevplugin.cpp.

◆ restorePartialProjectSession()

void KDevPlugin::restorePartialProjectSession ( const TQDomElement *  el)
virtual

Override this base class method to restore any settings which differs from project to project.

Data can be read from a certain subtree of the project session file. During project loading, respectively project session (.kdevses) loading, this method will be called to give a chance to adapt the plugin to the newly loaded project. For instance, the debugger plugin might restore the list of breakpoints from the previous debug session for the certain project.

Note
Take attention to the difference to common not-project-related session stuff. They belong to the application rc file (tdeveloprc)
Project session file is useful for settings which cannot be shared between developers. If a setting should be shared, modify projectDom instead.
Parameters
elThe parent DOM element for plugins session settings.

Definition at line 114 of file kdevplugin.cpp.

◆ savePartialProjectSession()

void KDevPlugin::savePartialProjectSession ( TQDomElement *  el)
virtual

Saves session settings.

See also
restorePartialProjectSession - this is the other way round, the same just for saving.

Definition at line 119 of file kdevplugin.cpp.


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

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for TDevelop Interfaces Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.