#include <kdevdocumentationplugin.h>
Inherits TQObject.
Public Types | |
enum | Capability { Index =1, FullTextSearch =2, ProjectDocumentation =8, ProjectUserManual =16 } |
enum | ProjectDocType { APIDocs, UserManual } |
Public Slots | |
virtual void | createIndex (IndexBox *index) |
Public Member Functions | |
DocumentationPlugin (TDEConfig *pluginConfig, TQObject *parent=0, const char *name=0) | |
virtual TQString | pluginName () const =0 |
virtual DocumentationCatalogItem * | createCatalog (TDEListView *contents, TDEListViewItem *after, const TQString &title, const TQString &url)=0 |
virtual void | init (TDEListView *contents) |
virtual void | reinit (TDEListView *contents, IndexBox *index, TQStringList restrictions) |
virtual void | autoSetup () |
virtual void | autoSetupPlugin ()=0 |
virtual bool | catalogEnabled (const TQString &name) const |
virtual void | setCatalogEnabled (const TQString &name, bool e) |
virtual bool | needRefreshIndex (DocumentationCatalogItem *item)=0 |
virtual bool | indexEnabled (DocumentationCatalogItem *item) const |
virtual void | setIndexEnabled (DocumentationCatalogItem *item, bool e) |
virtual void | createIndex (IndexBox *index, DocumentationCatalogItem *item)=0 |
virtual void | createTOC (DocumentationCatalogItem *item)=0 |
virtual void | setCatalogURL (DocumentationCatalogItem *item)=0 |
virtual TQStringList | fullTextSearchLocations ()=0 |
virtual void | loadCatalogConfiguration (TDEListView *configurationView) |
virtual void | saveCatalogConfiguration (TDEListView *configurationView) |
virtual void | addCatalogConfiguration (TDEListView *configurationView, const TQString &title, const TQString &url) |
virtual void | editCatalogConfiguration (ConfigurationItem *configurationItem, const TQString &title, const TQString &url) |
virtual void | deleteCatalogConfiguration (const ConfigurationItem *const configurationItem) |
virtual TQPair< KFile::Mode, TQString > | catalogLocatorProps ()=0 |
virtual TQString | catalogTitle (const TQString &url)=0 |
virtual void | clear () |
bool | hasCapability (Capability cap) const |
void | setDirtyIndex (bool dirty) |
virtual void | cacheIndex (DocumentationCatalogItem *item) |
virtual bool | loadCachedIndex (IndexBox *index, DocumentationCatalogItem *item) |
virtual ProjectDocumentationPlugin * | projectDocumentationPlugin (ProjectDocType) |
Protected Member Functions | |
void | setCapabilities (int caps) |
virtual void | clearCatalogIndex (DocumentationCatalogItem *item) |
void | loadIndex (IndexBox *index, DocumentationCatalogItem *item) |
TDEListViewItem * | findCatalogPosition (const TQString &key, const TDEListView *contents) const |
Protected Attributes | |
TQValueList< DocumentationCatalogItem * > | catalogs |
TQMap< TQString, DocumentationCatalogItem * > | namedCatalogs |
TQMap< DocumentationCatalogItem *, TQValueList< IndexItemProto * > > | indexes |
TQStringList | deletedConfigurationItems |
TDEConfig * | config |
Friends | |
class | IndexItemProto |
class | DocumentationCatalogItem |
Detailed Description
Documentation Plugin Interface.
All KDevelop documentation plugins must implement this interface. Documentation plugin handles certain documentation type. It provides methods to load documentation catalogs and indexes for a documentation of that type. It also has methods to configure catalogs and provides a list of URL's for the full text search tool.
Definition at line 217 of file kdevdocumentationplugin.h.
Member Enumeration Documentation
◆ Capability
Capability of documentation plugin.
Definition at line 223 of file kdevdocumentationplugin.h.
◆ ProjectDocType
Possible project documentation types.
Definition at line 228 of file kdevdocumentationplugin.h.
Constructor & Destructor Documentation
◆ DocumentationPlugin()
DocumentationPlugin::DocumentationPlugin | ( | TDEConfig * | pluginConfig, |
TQObject * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructor.
Should initialize capabilities of the plugin by using setCapabilities protected method. For example,
Definition at line 246 of file kdevdocumentationplugin.cpp.
Member Function Documentation
◆ addCatalogConfiguration()
|
virtual |
Adds new catalog to a configuration.
Definition at line 392 of file kdevdocumentationplugin.cpp.
◆ autoSetup()
|
virtual |
Initializes plugin configuration.
Documentation plugins should be able to initialize the default configuration on startup without any user interaction. Call this in the constructor of your plugin.
Definition at line 255 of file kdevdocumentationplugin.cpp.
◆ autoSetupPlugin()
|
pure virtual |
Plugin specific automatic setup code.
This method is called by autoSetup.
◆ cacheIndex()
|
virtual |
Caches index for documentation catalog.
Reimplement this only if custom caching algorythm is used (do not forget to reimplement also loadCachedIndex and createIndex).
Definition at line 322 of file kdevdocumentationplugin.cpp.
◆ catalogEnabled()
|
virtual |
Indicates if a catalog with specified name is enabled.
Documentation plugin should check this and do not load catalogs disabled in configuration. All catalogs are enabled by default.
Definition at line 613 of file kdevdocumentationplugin.cpp.
◆ catalogLocatorProps()
|
pure virtual |
Returns a mode and a filter for catalog locator dialogs.
◆ catalogTitle()
|
pure virtual |
Returns a title of catalog defined by an url parameter.
◆ clear()
|
virtual |
Clears documentation catalogs and indices.
Definition at line 267 of file kdevdocumentationplugin.cpp.
◆ clearCatalogIndex()
|
protectedvirtual |
Clears index of given catalog.
Definition at line 411 of file kdevdocumentationplugin.cpp.
◆ createCatalog()
|
pure virtual |
Creates documentation catalog with given title and url.
Catalog lists are sorted alphabetically in increasing order.
◆ createIndex() [1/2]
|
pure virtual |
Builds index for given catalog.
This method should fill index with IndexItem objects.
- Parameters
-
index the listbox which contains index items item the catalog item that holds an index being built
◆ createIndex [2/2]
|
virtualslot |
Creates index and fills index listbox.
Reimplement this only if custom caching algorythm is used (do not forget to reimplement also cacheIndex and loadCachedIndex).
Definition at line 309 of file kdevdocumentationplugin.cpp.
◆ createTOC()
|
pure virtual |
Creates a table of contents for given catalog.
Documentation part uses lazy loading of toc's to reduce startup time. This means that createTOC will be called on expand event of catalog item.
◆ deleteCatalogConfiguration()
|
virtual |
Removes catalog from configuration.
configurationItem should not be removed here.
Definition at line 406 of file kdevdocumentationplugin.cpp.
◆ editCatalogConfiguration()
|
virtual |
Edits catalog configuration.
Definition at line 399 of file kdevdocumentationplugin.cpp.
◆ findCatalogPosition()
|
protected |
Find catalog insert position to maintain a sorted order.
Definition at line 432 of file kdevdocumentationplugin.cpp.
◆ hasCapability()
|
inline |
Checks if documentation plugin has given capability.
Definition at line 322 of file kdevdocumentationplugin.h.
◆ indexEnabled()
|
virtual |
Indicates if an index is enabled for given catalog.
If documentation plugin has Index capability, indices for it's catalogs can be enabled/disabled in configuration dialog.
Definition at line 604 of file kdevdocumentationplugin.cpp.
◆ init()
|
virtual |
Initialize a list of catalogs.
- Parameters
-
contents the listview to fill with catalogs
Definition at line 447 of file kdevdocumentationplugin.cpp.
◆ loadCachedIndex()
|
virtual |
Loads index from the cache.
Reimplement this only if custom caching algorythm is used (do not forget to reimplement also cacheIndex and createIndex).
Definition at line 347 of file kdevdocumentationplugin.cpp.
◆ loadCatalogConfiguration()
|
virtual |
Loads catalog configuration and fills configurationView with ConfigurationItem objects.
Definition at line 520 of file kdevdocumentationplugin.cpp.
◆ loadIndex()
|
protected |
Loads index from cache or creates and caches it if does not exist.
Definition at line 422 of file kdevdocumentationplugin.cpp.
◆ needRefreshIndex()
|
pure virtual |
Indicates if an index of given catalog should be rebuilt.
This method is used by index caching algorythm to make a descision to rebuild index or to load it from cache.
◆ pluginName()
|
pure virtual |
Returns the i18n name of the plugin.
◆ projectDocumentationPlugin()
|
inlinevirtual |
Returns associated project documentation plugin.
Default implementation returns zero. Reimplement this if the documentation plugin can also handle project documentation.
Definition at line 339 of file kdevdocumentationplugin.h.
◆ reinit()
|
virtual |
Reloads a list of catalogs.
This method should add missing catalogs to the view, update index for added catalogs and also delete restricted catalogs.
- Parameters
-
contents the listview to fill with catalogs index the listbox with index to update restrictions the list of catalogs names to remove
Definition at line 467 of file kdevdocumentationplugin.cpp.
◆ saveCatalogConfiguration()
|
virtual |
Saves catalog configuration basing on configurationView and deletedConfigurationItems contents.
If you use TDEConfig to store configuration, it is important that you call TDEConfig::sync() method after saving.
Definition at line 545 of file kdevdocumentationplugin.cpp.
◆ setCapabilities()
|
inlineprotected |
Sets capabilities of documentation plugin.
Definition at line 356 of file kdevdocumentationplugin.h.
◆ setCatalogEnabled()
|
virtual |
Enables or disables documentation catalog.
Definition at line 622 of file kdevdocumentationplugin.cpp.
◆ setCatalogURL()
|
pure virtual |
Sets the URL to the catalog.
This method will be called each time user clicks the documentation item. If it is too much overhead to determine the documentation catalog url in createCatalog method then you can set it here.
◆ setDirtyIndex()
|
inline |
Sets dirty flag for all indices.
Index caching algorythm will update the cache next time createIndex is called.
Definition at line 326 of file kdevdocumentationplugin.h.
◆ setIndexEnabled()
|
virtual |
Enables or disables index for documentation catalog.
Definition at line 596 of file kdevdocumentationplugin.cpp.
Member Data Documentation
◆ catalogs
|
protected |
A list of loaded documentation catalogs.
Definition at line 349 of file kdevdocumentationplugin.h.
◆ config
|
protected |
Configuration object used by a plugin.
Definition at line 370 of file kdevdocumentationplugin.h.
◆ deletedConfigurationItems
|
protected |
Stores items deleted from configuration.
saveCatalogConfiguration uses this to remove entries from configuration file.
Definition at line 367 of file kdevdocumentationplugin.h.
◆ indexes
|
protected |
A map of indices of loaded documentation catalogs.
Definition at line 353 of file kdevdocumentationplugin.h.
◆ namedCatalogs
|
protected |
A map of names of loaded documentation catalogs.
Definition at line 351 of file kdevdocumentationplugin.h.
The documentation for this class was generated from the following files: