DocumentationFactory;
+K_EXPORT_COMPONENT_FACTORY( libtdevdocumentation, DocumentationFactory( data ) )
DocumentationPart::DocumentationPart(TQObject *parent, const char *name, const TQStringList& )
- :KDevPlugin(&data, parent, name ? name : "DocumentationPart" ),
+ :TDevPlugin(&data, parent, name ? name : "DocumentationPart" ),
m_projectDocumentationPlugin(0), m_userManualPlugin(0), m_hasIndex(false)
{
setInstance(DocumentationFactory::instance());
- setXMLFile("kdevpart_documentation.rc");
+ setXMLFile("tdevpart_documentation.rc");
m_configProxy = new ConfigWidgetProxy(core());
m_configProxy->createGlobalConfigPage(i18n("Documentation"), GLOBALDOC_OPTIONS, info()->icon() );
@@ -109,7 +109,7 @@ DocumentationPart::DocumentationPart(TQObject *parent, const char *name, const T
TQTimer::singleShot(0, this, TQT_SLOT(init()));
- new KDevDocumentationIface(this);
+ new TDevDocumentationIface(this);
}
DocumentationPart::~DocumentationPart()
@@ -250,6 +250,12 @@ void DocumentationPart::setupActions()
"all possible sources of documentation like "
"table of contents, index, man and info databases, "
"Google, etc."));
+ action = new TDEAction(i18n("TDevelop Programming Handbook"), 0,
+ this, TQT_SLOT(programmingHandbook()),
+ actionCollection(), "help_programming_handbook" );
+ action->setToolTip(i18n("Open the TDevelop Programming Handbook"));
+ action->setWhatsThis(i18n("Open the TDevelop Programming HandbookOpens Open the TDevelop Programming Handbook."));
+
}
void DocumentationPart::emitBookmarkLocation(const TQString &title, const KURL &url)
@@ -259,12 +265,12 @@ void DocumentationPart::emitBookmarkLocation(const TQString &title, const KURL &
void DocumentationPart::searchInDocumentation()
{
- TQString word = KDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
+ TQString word = TDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
if ( word.isEmpty() )
{
if ( isAssistantUsed() )
- callAssistant ( "KDevDocumentation", "searchInDocumentation()" );
+ callAssistant ( "TDevDocumentation", "searchInDocumentation()" );
else
{
mainWindow()->raiseView ( m_widget );
@@ -274,7 +280,7 @@ void DocumentationPart::searchInDocumentation()
else
{
if ( isAssistantUsed() )
- callAssistant ( "KDevDocumentation", "searchInDocumentation(TQString)", word );
+ callAssistant ( "TDevDocumentation", "searchInDocumentation(TQString)", word );
else
{
mainWindow()->raiseView ( m_widget );
@@ -292,24 +298,29 @@ void DocumentationPart::searchInDocumentation(const TQString &term)
void DocumentationPart::contextSearchInDocumentation()
{
if (isAssistantUsed())
- callAssistant("KDevDocumentation", "searchInDocumentation(TQString)", m_contextStr);
+ callAssistant("TDevDocumentation", "searchInDocumentation(TQString)", m_contextStr);
else
searchInDocumentation(m_contextStr);
}
+void DocumentationPart::programmingHandbook()
+{
+ kapp->invokeHelp (TQString::null, "tde_app_devel");
+}
+
void DocumentationPart::manPage()
{
- TQString word = KDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
+ TQString word = TDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
if ( isAssistantUsed() )
{
if ( word.isEmpty() )
{
- callAssistant ( "KDevDocumentation", "manPage()" );
+ callAssistant ( "TDevDocumentation", "manPage()" );
}
else
{
- callAssistant ( "KDevDocumentation", "manPage(TQString)", word );
+ callAssistant ( "TDevDocumentation", "manPage(TQString)", word );
}
}
else
@@ -323,17 +334,17 @@ void DocumentationPart::manPage()
void DocumentationPart::infoPage()
{
- TQString word = KDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
+ TQString word = TDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
if ( isAssistantUsed() )
{
if ( word.isEmpty() )
{
- callAssistant ( "KDevDocumentation", "infoPage()" );
+ callAssistant ( "TDevDocumentation", "infoPage()" );
}
else
{
- callAssistant ( "KDevDocumentation", "infoPage(TQString)", word );
+ callAssistant ( "TDevDocumentation", "infoPage(TQString)", word );
}
}
else
@@ -360,7 +371,7 @@ void DocumentationPart::infoPage(const TQString &term)
void DocumentationPart::contextManPage()
{
if (isAssistantUsed())
- callAssistant("KDevDocumentation", "manPage(TQString)", m_contextStr);
+ callAssistant("TDevDocumentation", "manPage(TQString)", m_contextStr);
else
manPage(m_contextStr);
}
@@ -368,7 +379,7 @@ void DocumentationPart::contextManPage()
void DocumentationPart::contextInfoPage()
{
if (isAssistantUsed())
- callAssistant("KDevDocumentation", "infoPage(TQString)", m_contextStr);
+ callAssistant("TDevDocumentation", "infoPage(TQString)", m_contextStr);
else
infoPage(m_contextStr);
}
@@ -376,19 +387,19 @@ void DocumentationPart::contextInfoPage()
void DocumentationPart::contextFindDocumentation()
{
if (isAssistantUsed())
- callAssistant("KDevDocumentation", "findInFinder(TQString)", m_contextStr);
+ callAssistant("TDevDocumentation", "findInFinder(TQString)", m_contextStr);
else
findInDocumentation(m_contextStr);
}
void DocumentationPart::findInDocumentation()
{
- TQString word = KDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
+ TQString word = TDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
if ( word.isEmpty() )
{
if ( isAssistantUsed() )
- callAssistant ( "KDevDocumentation", "findInFinder()" );
+ callAssistant ( "TDevDocumentation", "findInFinder()" );
else
{
mainWindow()->raiseView ( m_widget );
@@ -398,7 +409,7 @@ void DocumentationPart::findInDocumentation()
else
{
if ( isAssistantUsed() )
- callAssistant ( "KDevDocumentation", "findInFinder(TQString)", word );
+ callAssistant ( "TDevDocumentation", "findInFinder(TQString)", word );
else
{
mainWindow()->raiseView ( m_widget );
@@ -415,12 +426,12 @@ void DocumentationPart::findInDocumentation(const TQString &term)
void DocumentationPart::lookInDocumentationIndex()
{
- TQString word = KDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
+ TQString word = TDevEditorUtil::currentWord( dynamic_cast( partController()->activePart() ) );
if ( word.isEmpty() )
{
if ( isAssistantUsed() )
- callAssistant ( "KDevDocumentation", "lookupInIndex()" );
+ callAssistant ( "TDevDocumentation", "lookupInIndex()" );
else
{
mainWindow()->raiseView ( m_widget );
@@ -430,7 +441,7 @@ void DocumentationPart::lookInDocumentationIndex()
else
{
if ( isAssistantUsed() )
- callAssistant ( "KDevDocumentation", "lookupInIndex(TQString)", word );
+ callAssistant ( "TDevDocumentation", "lookupInIndex(TQString)", word );
else
{
mainWindow()->raiseView ( m_widget );
@@ -448,7 +459,7 @@ void DocumentationPart::lookInDocumentationIndex(const TQString &term)
void DocumentationPart::contextLookInDocumentationIndex()
{
if (isAssistantUsed())
- callAssistant("KDevDocumentation", "lookupInIndex(TQString)", m_contextStr);
+ callAssistant("TDevDocumentation", "lookupInIndex(TQString)", m_contextStr);
else
lookInDocumentationIndex(m_contextStr);
}
@@ -564,11 +575,11 @@ void DocumentationPart::setContextFeature(ContextFeature feature, bool b)
void DocumentationPart::projectOpened()
{
- TQString projectDocSystem = DomUtil::readEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docsystem");
- TQString projectDocURL = DomUtil::readEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docurl");
+ TQString projectDocSystem = DomUtil::readEntry(*(projectDom()), "/tdevdocumentation/projectdoc/docsystem");
+ TQString projectDocURL = DomUtil::readEntry(*(projectDom()), "/tdevdocumentation/projectdoc/docurl");
if (!projectDocURL.isEmpty())
projectDocURL = TQDir::cleanDirPath(project()->projectDirectory() + "/" + projectDocURL);
- TQString userManualURL = DomUtil::readEntry(*(projectDom()), "/kdevdocumentation/projectdoc/usermanualurl");
+ TQString userManualURL = DomUtil::readEntry(*(projectDom()), "/tdevdocumentation/projectdoc/usermanualurl");
for (TQValueList::const_iterator it = m_plugins.constBegin();
it != m_plugins.constEnd(); ++it)
@@ -602,21 +613,21 @@ void DocumentationPart::saveProjectDocumentationInfo()
{
if (m_projectDocumentationPlugin)
{
- DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docsystem", m_projectDocumentationPlugin->pluginName());
+ DomUtil::writeEntry(*(projectDom()), "/tdevdocumentation/projectdoc/docsystem", m_projectDocumentationPlugin->pluginName());
TQString relPath = URLUtil::extractPathNameRelative(project()->projectDirectory(),
m_projectDocumentationPlugin->catalogURL());
- DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docurl", relPath);
+ DomUtil::writeEntry(*(projectDom()), "/tdevdocumentation/projectdoc/docurl", relPath);
}
else
{
- DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docsystem", "");
- DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docurl", "");
+ DomUtil::writeEntry(*(projectDom()), "/tdevdocumentation/projectdoc/docsystem", "");
+ DomUtil::writeEntry(*(projectDom()), "/tdevdocumentation/projectdoc/docurl", "");
}
if (m_userManualPlugin)
- DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/usermanualurl", m_userManualPlugin->catalogURL());
+ DomUtil::writeEntry(*(projectDom()), "/tdevdocumentation/projectdoc/usermanualurl", m_userManualPlugin->catalogURL());
else
- DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/usermanualurl", "");
+ DomUtil::writeEntry(*(projectDom()), "/tdevdocumentation/projectdoc/usermanualurl", "");
}
TQCString DocumentationPart::startAssistant()
@@ -627,7 +638,7 @@ TQCString DocumentationPart::startAssistant()
return lastAssistant;
const char *function = 0;
- TQString app = "kdevassistant";
+ TQString app = "tdevassistant";
function = "start_service_by_desktop_name(TQString,TQStringList)";
TQStringList URLs;
@@ -665,7 +676,7 @@ TQCString DocumentationPart::startAssistant()
kdDebug() << dcopName.data() << endl;
//@fixme: is there another way to wait for the remote object to be loaded
- while (!TDEApplication::dcopClient()->remoteObjects(dcopName).contains("KDevDocumentation"))
+ while (!TDEApplication::dcopClient()->remoteObjects(dcopName).contains("TDevDocumentation"))
usleep(500);
}
}
@@ -674,8 +685,8 @@ TQCString DocumentationPart::startAssistant()
bool DocumentationPart::isAssistantUsed() const
{
- // hack to solve BR #90334 - don't call kdevassistant via DCOP if we ARE kdevassistant
- if ( kapp->instanceName().find("kdevassistant") != -1 )
+ // hack to solve BR #90334 - don't call tdevassistant via DCOP if we ARE tdevassistant
+ if ( kapp->instanceName().find("tdevassistant") != -1 )
{
return false;
}
@@ -686,7 +697,7 @@ bool DocumentationPart::isAssistantUsed() const
void DocumentationPart::setAssistantUsed(bool b)
{
m_assistantUsed = b;
- //use global config to store different settings for kdevassistant and tdevelop
+ //use global config to store different settings for tdevassistant and tdevelop
TDEConfig *config = kapp->config();
config->setGroup("Documentation");
config->writeEntry("UseAssistant", isAssistantUsed());
@@ -739,7 +750,7 @@ void DocumentationPart::loadSettings()
config->setGroup("Documentation");
m_assistantUsed = config->readBoolEntry("UseAssistant", false);
- if (TQString(TDEGlobal::instance()->aboutData()->appName()) == "kdevassistant")
+ if (TQString(TDEGlobal::instance()->aboutData()->appName()) == "tdevassistant")
{
int page = config->readNumEntry("LastPage", 0);
switch (page)
diff --git a/parts/documentation/documentation_part.h b/parts/documentation/documentation_part.h
index 722ad4bd..aafe1669 100644
--- a/parts/documentation/documentation_part.h
+++ b/parts/documentation/documentation_part.h
@@ -17,11 +17,11 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef __KDEVPART_DOCUMENTATION_H__
-#define __KDEVPART_DOCUMENTATION_H__
+#ifndef __TDEVPART_DOCUMENTATION_H__
+#define __TDEVPART_DOCUMENTATION_H__
#include
-#include
+#include
class FindDocumentation;
@@ -39,7 +39,7 @@ class TQPopupMenu;
/*
Please read the README.dox file for more info about this part
*/
-class DocumentationPart : public KDevPlugin
+class DocumentationPart : public TDevPlugin
{
Q_OBJECT
@@ -69,6 +69,7 @@ public slots:
void searchInDocumentation();
void searchInDocumentation(const TQString &term);
void contextSearchInDocumentation();
+ void programmingHandbook();
void manPage();
void manPage(const TQString &term);
void contextManPage();
diff --git a/parts/documentation/documentation_widget.cpp b/parts/documentation/documentation_widget.cpp
index b1ab69ca..b69e80a5 100644
--- a/parts/documentation/documentation_widget.cpp
+++ b/parts/documentation/documentation_widget.cpp
@@ -31,8 +31,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "documentation_part.h"
#include "contentsview.h"
diff --git a/parts/documentation/documentation_widget.h b/parts/documentation/documentation_widget.h
index a813b393..fccd03b9 100644
--- a/parts/documentation/documentation_widget.h
+++ b/parts/documentation/documentation_widget.h
@@ -23,7 +23,7 @@
#include
class FindDocumentation;
-class KDevProject;
+class TDevProject;
class DocumentationPart;
class ContentsView;
class IndexView;
diff --git a/parts/documentation/docutils.cpp b/parts/documentation/docutils.cpp
index 5360a73f..ba00ea83 100644
--- a/parts/documentation/docutils.cpp
+++ b/parts/documentation/docutils.cpp
@@ -27,9 +27,9 @@
#include
#include
-#include
+#include
-#include "kdevdocumentationplugin.h"
+#include "tdevdocumentationplugin.h"
#include "documentation_part.h"
TQString DocUtils::noEnvURL(const TQString &url)
diff --git a/parts/documentation/editcatalogdlg.cpp b/parts/documentation/editcatalogdlg.cpp
index 8bdc19d5..2fb81fec 100644
--- a/parts/documentation/editcatalogdlg.cpp
+++ b/parts/documentation/editcatalogdlg.cpp
@@ -26,7 +26,7 @@
#include
#include "docutils.h"
-#include "kdevdocumentationplugin.h"
+#include "tdevdocumentationplugin.h"
EditCatalogDlg::EditCatalogDlg(DocumentationPlugin *plugin, TQWidget* parent,
const char* name, bool modal, WFlags fl)
diff --git a/parts/documentation/find_documentation.cpp b/parts/documentation/find_documentation.cpp
index ebddcd4c..2f730b81 100644
--- a/parts/documentation/find_documentation.cpp
+++ b/parts/documentation/find_documentation.cpp
@@ -29,8 +29,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "documentation_widget.h"
#include "documentation_part.h"
diff --git a/parts/documentation/indexview.cpp b/parts/documentation/indexview.cpp
index cae33db5..25762451 100644
--- a/parts/documentation/indexview.cpp
+++ b/parts/documentation/indexview.cpp
@@ -30,8 +30,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "docutils.h"
#include "selecttopic.h"
diff --git a/parts/documentation/interfaces/CMakeLists.txt b/parts/documentation/interfaces/CMakeLists.txt
index f4a2ff08..2e1f0ae3 100644
--- a/parts/documentation/interfaces/CMakeLists.txt
+++ b/parts/documentation/interfaces/CMakeLists.txt
@@ -23,7 +23,7 @@ link_directories(
##### headers ###################################
install( FILES
- kdevdocumentationplugin.h
+ tdevdocumentationplugin.h
DESTINATION ${INCLUDE_INSTALL_DIR}/tdevelop/parts/documentation )
@@ -37,7 +37,7 @@ install( FILES
##### documentation_interfaces (shared) #########
tde_add_library( documentation_interfaces SHARED AUTOMOC
- SOURCES kdevdocumentationplugin.cpp
+ SOURCES tdevdocumentationplugin.cpp
VERSION 0.0.0
LINK tdeio-shared
DESTINATION ${LIB_INSTALL_DIR}
diff --git a/parts/documentation/interfaces/Makefile.am b/parts/documentation/interfaces/Makefile.am
index f128dabc..b0feb598 100644
--- a/parts/documentation/interfaces/Makefile.am
+++ b/parts/documentation/interfaces/Makefile.am
@@ -5,12 +5,12 @@ partincludedirdir = $(includedir)/tdevelop/parts/documentation
lib_LTLIBRARIES = libdocumentation_interfaces.la
libdocumentation_interfaces_la_LDFLAGS = $(all_libraries)
libdocumentation_interfaces_la_LIBADD = $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_TDEIO)
-libdocumentation_interfaces_la_SOURCES = kdevdocumentationplugin.cpp
-partincludedir_HEADERS = kdevdocumentationplugin.h
+libdocumentation_interfaces_la_SOURCES = tdevdocumentationplugin.cpp
+partincludedir_HEADERS = tdevdocumentationplugin.h
servicetypedir = $(kde_servicetypesdir)
servicetype_DATA = tdevelopdocumentationplugins.desktop
-DOXYGEN_REFERENCES = dcop interfaces tdecore tdefx tdeui tdehtml tdemdi tdeio kjs tdeparts tdeutils kdevutil kdevinterfaces
-DOXYGEN_PROJECTNAME = KDevelop Documentation Part Interfaces Library
-DOXYGEN_DOCDIRPREFIX = kdevdoc
+DOXYGEN_REFERENCES = dcop interfaces tdecore tdefx tdeui tdehtml tdemdi tdeio kjs tdeparts tdeutils tdevutil tdevinterfaces
+DOXYGEN_PROJECTNAME = TDevelop Documentation Part Interfaces Library
+DOXYGEN_DOCDIRPREFIX = tdevdoc
include ../../../Doxyfile.am
diff --git a/parts/documentation/interfaces/kdevdocumentationplugin.cpp b/parts/documentation/interfaces/kdevdocumentationplugin.cpp
deleted file mode 100644
index afc9abad..00000000
--- a/parts/documentation/interfaces/kdevdocumentationplugin.cpp
+++ /dev/null
@@ -1,721 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2004 by Alexander Dymo
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-#include "kdevdocumentationplugin.h"
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-//class DocumentationItem
-
-DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListView *parent,
- const TQString &name)
- :TDEListViewItem(parent, name), m_type(type)
-{
- init();
-}
-
-DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListViewItem *parent,
- const TQString &name)
- :TDEListViewItem(parent, name), m_type(type)
-{
- init();
-}
-
-DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListView *parent,
- TDEListViewItem *after, const TQString &name)
- :TDEListViewItem(parent, after, name), m_type(type)
-{
- init();
-}
-
-DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListViewItem * parent,
- TDEListViewItem * after, const TQString & name )
- :TDEListViewItem(parent, after, name), m_type(type)
-{
- init();
-}
-
-
-void DocumentationItem::init( )
-{
- TQString icon;
-
- switch (m_type)
- {
- case Collection:
- case Catalog:
- icon = "folder";
- break;
- case Book:
- icon = "contents";
- break;
- default:
- icon = "document";
- }
-
- setPixmap(0, SmallIcon(icon));
-}
-
-
-
-
-
-//class DocumentationCatalogItem
-
-
-DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin,
- TDEListView *parent, const TQString &name)
- :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin),
- isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false)
-{
- setExpandable(true);
- m_plugin->addCatalog(this);
-}
-
-DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin,
- DocumentationItem *parent, const TQString &name)
- :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin),
- isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false)
-{
- setExpandable(true);
- m_plugin->addCatalog(this);
-}
-
-DocumentationCatalogItem::~ DocumentationCatalogItem( )
-{
- m_plugin->clearCatalog(this);
-}
-
-void DocumentationCatalogItem::setOpen(bool o)
-{
- if (o)
- {
- load();
- }
- DocumentationItem::setOpen(o);
-}
-
-void DocumentationCatalogItem::load()
-{
-if(isLoaded)
-return;
-
- plugin()->createTOC(this);
- isLoaded = true;
-}
-
-void DocumentationCatalogItem::activate()
-{
- if (!isActivated)
- {
- plugin()->setCatalogURL(this);
- isActivated = true;
- }
- DocumentationItem::activate();
-}
-
-
-
-
-//class IndexItemProto
-
-IndexItemProto::IndexItemProto(DocumentationPlugin *plugin, DocumentationCatalogItem *catalog,
- IndexBox *listbox, const TQString &text, const TQString &description)
- : m_listbox(listbox), m_text(text), m_description(description)
-{
- plugin->indexes[catalog].append(this);
- m_listbox->addIndexItem(this);
-}
-
-IndexItemProto::~IndexItemProto()
-{
- m_listbox->removeIndexItem(this);
-}
-
-
-//class IndexItem
-
-IndexItem::IndexItem(IndexBox *listbox, const TQString &text)
- :TQListBoxText(listbox, text), m_listbox(listbox)
-{
-}
-
-IndexItem::List IndexItem::urls() const
-{
- List urlList;
- TQValueList itemProtos = m_listbox->items[text()];
- for (TQValueList::const_iterator it = itemProtos.begin();
- it != itemProtos.end(); ++it)
- urlList.append(tqMakePair((*it)->description(), (*it)->url()));
- return urlList;
-}
-
-
-
-
-//class ConfigurationItem
-
-ConfigurationItem::ConfigurationItem(TQListView *parent, DocumentationPlugin * plugin, const TQString &title, const TQString &url,
- bool indexPossible, bool fullTextSearchPossible)
- :TQCheckListItem(parent, "", TQCheckListItem::CheckBox), m_title(title), m_url(url),
- m_origTitle(title), m_contents(true), m_index(false), m_fullTextSearch(false),
- m_indexPossible(indexPossible), m_fullTextSearchPossible(fullTextSearchPossible),
- m_docPlugin( plugin )
-{
- setText(3, m_title);
- setText(4, m_url);
-}
-
-void ConfigurationItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column,
- int width, int align)
-{
- if ( (column == 0) || (column == 1) || (column == 2) )
- {
- if ( !p )
- return;
-
- TQListView *lv = listView();
- if ( !lv )
- return;
-
- const BackgroundMode bgmode = lv->viewport()->backgroundMode();
- const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode );
- p->fillRect(0, 0, width, height(), cg.brush(crole));
-
- TQFontMetrics fm(lv->fontMetrics());
- int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv);
- int marg = lv->itemMargin();
- int styleflags = TQStyle::Style_Default;
-
- if (((column == 0) && m_contents) || ((column == 1) && m_index) || ((column == 2) && m_fullTextSearch))
- styleflags |= TQStyle::Style_On;
- else
- styleflags |= TQStyle::Style_Off;
- if ((column == 0) || ((column == 1) && m_indexPossible) || ((column == 2) && m_fullTextSearchPossible))
- styleflags |= TQStyle::Style_Enabled;
-
- int x = 0;
- int y = 0;
- x += 3;
- if (align & AlignVCenter)
- y = ((height() - boxsize) / 2) + marg;
- else
- y = (fm.height() + 2 + marg - boxsize) / 2;
-
- TQStyleOption opt(this);
- lv->style().tqdrawPrimitive(TQStyle::PE_CheckListIndicator, p,
- TQRect(x, y, boxsize, fm.height() + 2 + marg), cg, styleflags, opt);
-
- return;
- }
- TQListViewItem::paintCell(p, cg, column, width, align);
-}
-
-int ConfigurationItem::width(const TQFontMetrics &fm, const TQListView *lv, int c) const
-{
- if ((c == 0) || (c == 1) || (c == 2))
- return lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv) + 4;
- return TQListViewItem::width(fm, lv, c);
-}
-
-
-
-
-
-
-
-
-//class DocumentationPlugin
-
-DocumentationPlugin::DocumentationPlugin(TDEConfig *pluginConfig, TQObject *parent, const char *name)
- :TQObject(parent, name), config(pluginConfig), m_indexCreated(false)
-{
-}
-
-DocumentationPlugin::~DocumentationPlugin()
-{
-}
-
-void DocumentationPlugin::autoSetup()
-{
- config->setGroup("General");
- if ( ! config->readBoolEntry("Autosetup", false) )
- {
- autoSetupPlugin();
- config->setGroup("General");
- config->writeEntry("Autosetup", true);
- config->sync();
- }
-}
-
-void DocumentationPlugin::reload()
-{
- clear();
- for (TQValueList::iterator it = catalogs.begin();
- it != catalogs.end(); ++it)
- {
- createTOC(*it);
- }
-}
-
-void DocumentationPlugin::clear()
-{
- for (TQValueList::iterator it = catalogs.begin();
- it != catalogs.end(); ++it)
- {
- clearCatalog(*it);
- }
-}
-
-void DocumentationPlugin::clearCatalog(DocumentationCatalogItem *item)
-{
- //clear named catalog map
- for (TQMap::iterator it = namedCatalogs.begin();
- it != namedCatalogs.end(); ++it)
- {
- if (it.data() == item)
- {
- namedCatalogs.remove(it);
- break;
- }
- }
- //clear indexes for catalog
- TQValueList idx = indexes[item];
- for (TQValueList::iterator it = idx.begin(); it != idx.end(); ++it)
- {
- delete *it;
- }
- indexes.remove(item);
-
- //remove catalog
- catalogs.remove(item);
-}
-
-void DocumentationPlugin::createIndex(IndexBox *index)
-{
- if (m_indexCreated)
- return;
-
- for (TQValueList::iterator it = catalogs.begin();
- it != catalogs.end(); ++it)
- {
- loadIndex(index, *it);
- }
- m_indexCreated = true;
-}
-
-void DocumentationPlugin::cacheIndex(DocumentationCatalogItem *item)
-{
- kdDebug() << "Creating index cache for " << item->text(0) << endl;
-
- TQString cacheName = locateLocal("data", TQString("kdevdocumentation/index/cache_") + item->text(0));
- TQFile cacheFile(cacheName);
- if (!cacheFile.open(IO_WriteOnly))
- return;
-
- TQTextStream str(&cacheFile);
- str.setEncoding(TQTextStream::Unicode);
- str << CACHE_VERSION << endl;
-
- TQValueList catalogIndexes = indexes[item];
- for (TQValueList::const_iterator it = catalogIndexes.constBegin();
- it != catalogIndexes.constEnd(); ++it)
- {
- str << (*it)->text() << endl;
- str << (*it)->description() << endl;
- str << (*it)->url().url() << endl;
- }
-
- cacheFile.close();
-}
-
-bool DocumentationPlugin::loadCachedIndex(IndexBox *index, DocumentationCatalogItem *item)
-{
- TQString cacheName = locateLocal("data", TQString("kdevdocumentation/index/cache_") + item->cacheVersion() + item->text(0));
- TQFile cacheFile(cacheName);
- if (!cacheFile.open(IO_ReadOnly))
- return false;
-
- kdDebug() << "Using cached index for item: " << item->text(0) << endl;
-
- TQTextStream str(&cacheFile);
- str.setEncoding(TQTextStream::Unicode);
- TQString cache = str.read();
- TQStringList cacheList = TQStringList::split("\n", cache, true);
- TQString ver = cacheList.first();
- if (ver != CACHE_VERSION)
- {
- kdDebug() << "Wrong cache version: " << ver << endl;
- return false;
- }
- TQStringList::const_iterator it = cacheList.begin();
- it++;
- TQString s[3]; int c = 0;
- for (; it != cacheList.end(); ++it)
- {
- s[c] = *it;
- if (c == 2)
- {
- IndexItemProto *ii = new IndexItemProto(this, item, index, s[0], s[1]);
- ii->addURL(KURL(s[2]));
- c = 0;
- }
- else c++;
- }
- cacheFile.close();
-
- return true;
-}
-
-void DocumentationPlugin::addCatalog(DocumentationCatalogItem *item)
-{
- catalogs.append(item);
- namedCatalogs[item->text(0)] = item;
-// indexes[item] = TQValueList();
-}
-
-void DocumentationPlugin::addCatalogConfiguration(TDEListView *configurationView,
- const TQString &title, const TQString &url)
-{
- new ConfigurationItem(configurationView, this, title, url,
- hasCapability(Index), hasCapability(FullTextSearch));
-}
-
-void DocumentationPlugin::editCatalogConfiguration(ConfigurationItem *configurationItem,
- const TQString &title, const TQString &url)
-{
- configurationItem->setTitle(title);
- configurationItem->setURL(url);
-}
-
-void DocumentationPlugin::deleteCatalogConfiguration(const ConfigurationItem *const configurationItem)
-{
- deletedConfigurationItems << configurationItem->title();
-}
-
-void DocumentationPlugin::clearCatalogIndex(DocumentationCatalogItem *item)
-{
- //clear indexes for catalog
- TQValueList idx = indexes[item];
- for (TQValueList::iterator it = idx.begin(); it != idx.end(); ++it)
- {
- delete *it;
- }
- indexes.remove(item);
-}
-
-void DocumentationPlugin::loadIndex(IndexBox *index, DocumentationCatalogItem *item)
-{
- if (!indexEnabled(item))
- return;
- if (!needRefreshIndex(item) && loadCachedIndex(index, item))
- return;
- createIndex(index, item);
- cacheIndex(item);
-}
-
-void DocumentationPlugin::init(TDEListView *contents)
-{
- config->setGroup("Locations");
- TQMap entryMap = config->entryMap("Locations");
-
- for (TQMap::const_iterator it = entryMap.begin();
- it != entryMap.end(); ++it)
- {
- if (catalogEnabled(it.key()))
- createCatalog(contents, it.key(), config->readPathEntry(it.key()));
- }
-}
-
-void DocumentationPlugin::reinit(TDEListView *contents, IndexBox *index, TQStringList restrictions)
-{
- config->setGroup("Locations");
- TQMap entryMap = config->entryMap("Locations");
-
- //remove deleted in configuration catalogs
- for (TQStringList::const_iterator it = deletedConfigurationItems.constBegin();
- it != deletedConfigurationItems.constEnd(); ++it)
- {
- if (namedCatalogs.contains(*it))
- delete namedCatalogs[*it];
- }
- deletedConfigurationItems.clear();
-
- //update configuration
- for (TQMap::const_iterator it = entryMap.begin();
- it != entryMap.end(); ++it)
- {
- config->setGroup("Locations");
- if (restrictions.contains(it.key()) || (!catalogEnabled(it.key())))
- {
- if (namedCatalogs.contains(it.key()))
- delete namedCatalogs[it.key()];
- }
- else
- {
- kdDebug() << "updating 1" << endl;
- if (!namedCatalogs.contains(it.key())) //create catalog if it does not exist
- {
- DocumentationCatalogItem * item = createCatalog(contents, it.key(), config->readPathEntry(it.key()));
- loadIndex(index, item);
- index->setDirty(true);
-// index->refill(indexes[item]);
- }
- else if (!indexEnabled(namedCatalogs[it.key()])) //clear index if it is disabled in configuration
- {
- kdDebug() << " updating: clearCatalogIndex" << endl;
- clearCatalogIndex(namedCatalogs[it.key()]);
- }
- else if ( (indexEnabled(namedCatalogs[it.key()])) //index is requested in configuration but does not yet exist
- && (!indexes.contains(namedCatalogs[it.key()])) )
- {
- kdDebug() << " index requested " << endl;
- loadIndex(index, namedCatalogs[it.key()]);
- index->setDirty(true);
- }
- m_indexCreated = true;
- }
- }
-}
-
-void DocumentationPlugin::loadCatalogConfiguration(TDEListView *configurationView)
-{
- config->setGroup("Locations");
- TQMap entryMap = config->entryMap("Locations");
-
- for (TQMap::const_iterator it = entryMap.begin();
- it != entryMap.end(); ++it)
- {
- if (namedCatalogs.contains(it.key())
- && namedCatalogs[it.key()]->isProjectDocumentationItem())
- continue;
-
- config->setGroup("Locations");
- ConfigurationItem *item = new ConfigurationItem(configurationView, this, it.key(),
- config->readPathEntry(it.key()),
- hasCapability(Index), hasCapability(FullTextSearch));
- config->setGroup("TOC Settings");
- item->setContents(config->readBoolEntry(item->title(), true));
- config->setGroup("Index Settings");
- item->setIndex(config->readBoolEntry(item->title(), false));
- config->setGroup("Search Settings");
- item->setFullTextSearch(config->readBoolEntry(item->title(), false));
- }
-}
-
-void DocumentationPlugin::saveCatalogConfiguration(TDEListView *configurationView)
-{
- config->setGroup("Locations");
-
- for (TQStringList::const_iterator it = deletedConfigurationItems.constBegin();
- it != deletedConfigurationItems.constEnd(); ++it)
- {
- config->deleteEntry(*it);
- }
-
- TQListViewItemIterator it(configurationView);
- while (it.current())
- {
- ConfigurationItem *confItem = dynamic_cast(it.current());
- if ( confItem->docPlugin() != this )
- {
- ++it;
- continue;
- }
-
- config->setGroup("Locations");
- if (confItem->isChanged())
- config->deleteEntry(confItem->origTitle());
- config->writePathEntry(confItem->title(), confItem->url());
-
- config->setGroup("TOC Settings");
- if (confItem->isChanged())
- config->deleteEntry(confItem->origTitle());
- config->writeEntry(confItem->title(), confItem->contents());
-
- config->setGroup("Index Settings");
- if (confItem->isChanged())
- config->deleteEntry(confItem->origTitle());
- config->writeEntry(confItem->title(), confItem->index());
-
- config->setGroup("Search Settings");
- if (confItem->isChanged())
- config->deleteEntry(confItem->origTitle());
- config->writeEntry(confItem->title(), confItem->fullTextSearch());
-
- ++it;
- }
- config->sync();
-}
-
-void DocumentationPlugin::setIndexEnabled( DocumentationCatalogItem * item, bool e )
-{
- TQString group = config->group();
- config->setGroup("Index Settings");
- config->writeEntry(item->text(0), e);
- config->setGroup(group);
-}
-
-bool DocumentationPlugin::indexEnabled( DocumentationCatalogItem * item ) const
-{
- TQString group = config->group();
- config->setGroup("Index Settings");
- bool b = config->readBoolEntry(item->text(0), false);
- config->setGroup(group);
- return b;
-}
-
-bool DocumentationPlugin::catalogEnabled(const TQString &name) const
-{
- TQString group = config->group();
- config->setGroup("TOC Settings");
- bool b = config->readBoolEntry(name, true);
- config->setGroup(group);
- return b;
-}
-
-void DocumentationPlugin::setCatalogEnabled(const TQString &name, bool e)
-{
- TQString group = config->group();
- config->setGroup("TOC Settings");
- config->writeEntry(name, e);
- config->setGroup(group);
-}
-
-
-
-
-//class IndexBox
-
-IndexBox::IndexBox(TQWidget *parent, const char *name)
- :TDEListBox(parent, name), m_dirty(false)
-{
-}
-
-void IndexBox::addIndexItem(IndexItemProto *item)
-{
- items[item->text()].append(item);
-}
-
-void IndexBox::removeIndexItem(IndexItemProto *item)
-{
- TQString text = item->text();
- items[text].remove(item);
- if (items[text].count() == 0)
- {
- items.remove(text);
- TQListBoxItem *item = findItem(text, TQt::CaseSensitive | TQt::ExactMatch);
- if (item)
- delete item;
- }
-}
-
-void IndexBox::fill()
-{
- for (TQMap >::const_iterator it = items.begin();
- it != items.end(); ++it)
- {
- new IndexItem(this, it.key());
- }
-}
-
-void IndexBox::setDirty(bool dirty)
-{
- m_dirty = dirty;
-}
-
-void IndexBox::refill()
-{
- if (m_dirty)
- {
- clear();
- fill();
- setDirty(false);
- }
-}
-
-
-ProjectDocumentationPlugin::ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type)
- :TQObject(0, 0), m_docPlugin(docPlugin), m_catalog(0), m_type(type), m_contents(0), m_index(0)
-{
- kdDebug() << "ProjectDocumentationPlugin::ProjectDocumentationPlugin for type " << type << endl;
-
- m_watch = new KDirWatch(this);
- connect(m_watch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(reinit()));
- m_watch->startScan();
-}
-
-ProjectDocumentationPlugin::~ProjectDocumentationPlugin()
-{
- deinit();
-}
-
-void ProjectDocumentationPlugin::init(TDEListView *contents, IndexBox *index, const TQString &url)
-{
- m_contents = contents;
- m_index = index;
- m_url = url;
-
- if (m_catalog)
- deinit();
- m_catalog = m_docPlugin->createCatalog(contents,
- m_type == DocumentationPlugin::APIDocs ? i18n("Project API Documentation")
- : i18n("Project User Manual"), url);
- if (m_catalog)
- {
- m_catalog->setProjectDocumentationItem(true);
- m_watch->addFile(url);
- }
-}
-
-void ProjectDocumentationPlugin::reinit()
-{
- deinit();
- if (m_contents != 0 && m_index != 0 && m_url != 0)
- init(m_contents, m_index, m_url);
-}
-
-void ProjectDocumentationPlugin::deinit()
-{
- m_watch->removeFile(m_url);
- delete m_catalog;
- m_catalog = 0;
-}
-
-TQString ProjectDocumentationPlugin::pluginName() const
-{
- return m_docPlugin->pluginName();
-}
-
-TQString ProjectDocumentationPlugin::catalogURL() const
-{
- return m_url;
-}
-
-#include "kdevdocumentationplugin.moc"
diff --git a/parts/documentation/interfaces/kdevdocumentationplugin.h b/parts/documentation/interfaces/kdevdocumentationplugin.h
deleted file mode 100644
index a5dbe458..00000000
--- a/parts/documentation/interfaces/kdevdocumentationplugin.h
+++ /dev/null
@@ -1,423 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2004 by Alexander Dymo
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-#ifndef KDEV_DOC_PLUGIN_H
-#define KDEV_DOC_PLUGIN_H
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#define CACHE_VERSION "3"
-
-/**Documentation list item.
-Stores the type of a documentation it represents and an URL.*/
-class DocumentationItem: public TDEListViewItem
-{
-public:
- /**Type of documentation which is represented by this item.*/
- enum Type {
- Collection /** URL;
- typedef TQValueList List;
-
- IndexItem(IndexBox *listbox, const TQString &text);
-
- List urls() const;
-
-private:
- IndexBox *m_listbox;
-};
-
-/**Documentation index view.*/
-class IndexBox: public TDEListBox{
-public:
- IndexBox(TQWidget *parent = 0, const char *name = 0);
-
- virtual void addIndexItem(IndexItemProto *item);
- virtual void removeIndexItem(IndexItemProto *item);
- virtual void fill();
- virtual void refill();
- virtual void setDirty(bool dirty);
-// virtual void refill(TQValueList &items);
-
-private:
- TQMap > items;
- friend class IndexItem;
-
- bool m_dirty;
-};
-
-class TQPainter;
-class TQColorGroup;
-class TQFontMetrics;
-class DocumentationPlugin;
-
-/**Documentation configuration item.*/
-class ConfigurationItem: public TQCheckListItem
-{
-public:
- ConfigurationItem(TQListView *parent, DocumentationPlugin * plugin, const TQString &title, const TQString &url,
- bool indexPossible, bool fullTextSearchPossible);
-
- virtual TQString title() const { return m_title; }
- virtual void setTitle(const TQString title) { setText(3, m_title = title); }
- virtual TQString url() const { return m_url; }
- virtual void setURL(const TQString url) { setText(4, m_url = url); }
-
- virtual bool isChanged() const { return m_title == m_origTitle; }
- virtual TQString origTitle() const {return m_origTitle; }
-
- virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align);
- virtual int width(const TQFontMetrics &fm, const TQListView *lv, int c) const;
-
- bool contents() const { return m_contents; }
- void setContents(bool contents) { m_contents = contents; }
- bool index() const { return m_index; }
- void setIndex(bool index) { m_index = index; }
- bool fullTextSearch() const { return m_fullTextSearch; }
- void setFullTextSearch(bool fullTextSearch) { m_fullTextSearch = fullTextSearch; }
-
- bool indexPossible() const { return m_indexPossible; }
- bool fullTextSearchPossible() const { return m_fullTextSearchPossible; }
-
- DocumentationPlugin * docPlugin() { return m_docPlugin; }
-
-private:
- TQString m_title;
- TQString m_url;
- TQString m_origTitle;
-
- bool m_contents;
- bool m_index;
- bool m_fullTextSearch;
-
- bool m_indexPossible;
- bool m_fullTextSearchPossible;
-
- DocumentationPlugin * m_docPlugin;
-};
-
-
-class ProjectDocumentationPlugin;
-
-/**
-@short 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.
-*/
-class DocumentationPlugin: public TQObject
-{
- Q_OBJECT
-
-public:
- /**Capability of documentation plugin.*/
- enum Capability { Index=1 /** catalogLocatorProps() = 0;
- /**Returns a title of catalog defined by an url parameter.*/
- virtual TQString catalogTitle(const TQString &url) = 0;
-
- /**Reloads documentation catalogs and indices.*/
- virtual void reload();
- /**Clears documentation catalogs and indices.*/
- virtual void clear();
-
- /**Checks if documentation plugin has given capability.*/
- bool hasCapability(Capability cap) const { return m_capabilities & cap; }
-
- /**Sets dirty flag for all indices. Index caching algorythm will update
- the cache next time @ref createIndex is called.*/
- void setDirtyIndex(bool dirty) { m_indexCreated = dirty; }
-
- /**Caches index for documentation catalog. Reimplement this only if custom
- caching algorythm is used (do not forget to reimplement also @ref loadCachedIndex
- and @ref createIndex).*/
- virtual void cacheIndex(DocumentationCatalogItem *item);
- /**Loads index from the cache. Reimplement this only if custom
- caching algorythm is used (do not forget to reimplement also @ref cacheIndex
- and @ref createIndex).*/
- virtual bool loadCachedIndex(IndexBox *index, DocumentationCatalogItem *item);
-
- /**Returns associated project documentation plugin. Default implementation returns zero.
- Reimplement this if the documentation plugin can also handle project documentation.*/
- virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType /* type */) { return 0; }
-
-public slots:
- /**Creates index and fills index listbox. Reimplement this only if custom
- caching algorythm is used (do not forget to reimplement also @ref cacheIndex
- and @ref loadCachedIndex).*/
- virtual void createIndex(IndexBox *index);
-
-protected:
- /**A list of loaded documentation catalogs.*/
- TQValueList catalogs;
- /**A map of names of loaded documentation catalogs.*/
- TQMap namedCatalogs;
- /**A map of indices of loaded documentation catalogs.*/
- TQMap > indexes;
-
- /**Sets capabilities of documentation plugin.*/
- void setCapabilities(int caps) { m_capabilities = caps; }
- /**Clears index of given catalog.*/
- virtual void clearCatalogIndex(DocumentationCatalogItem *item);
- /**Loads index from cache or creates and caches it if does not exist.*/
- void loadIndex(IndexBox *index, DocumentationCatalogItem *item);
-
- /**Stores items deleted from configuration. @ref saveCatalogConfiguration
- uses this to remove entries from configuration file.*/
- TQStringList deletedConfigurationItems;
-
- /**Configuration object used by a plugin.*/
- TDEConfig *config;
-
-private:
- /**Adds catalog item to catalogs, namedCatalogs and indexes lists and maps.*/
- virtual void addCatalog(DocumentationCatalogItem *item);
- /**Removes catalog item from catalogs, namedCatalogs and indexes lists and maps.*/
- virtual void clearCatalog(DocumentationCatalogItem *item);
-
- int m_capabilities;
- bool m_indexCreated;
-
-
-friend class IndexItemProto;
-friend class DocumentationCatalogItem;
-};
-
-
-/**
-@short Project documentation plugin
-
-Represents functionality to display project documentation catalog and index in documentation browser.
-*/
-class ProjectDocumentationPlugin: public TQObject {
- Q_OBJECT
-
-public:
- ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type);
- virtual ~ProjectDocumentationPlugin();
-
- /**Initializes project documentation plugin - creates documentation catalog.*/
- virtual void init(TDEListView *contents, IndexBox *index, const TQString &url);
- /**Deinitializes project documentation plugin - removes documentation catalog.*/
- virtual void deinit();
-
- TQString pluginName() const;
- TQString catalogURL() const;
-
-public slots:
- /**Performs reinitialization if project documentation has changed (after building api documentation).*/
- virtual void reinit();
-
-protected:
- DocumentationPlugin *m_docPlugin;
- DocumentationCatalogItem *m_catalog;
-
-private:
- DocumentationPlugin::ProjectDocType m_type;
-
- class KDirWatch *m_watch;
- class TDEListView *m_contents;
- class IndexBox *m_index;
- TQString m_url;
-};
-
-#endif
diff --git a/parts/documentation/interfaces/tdevdocumentationplugin.cpp b/parts/documentation/interfaces/tdevdocumentationplugin.cpp
new file mode 100644
index 00000000..f3c20841
--- /dev/null
+++ b/parts/documentation/interfaces/tdevdocumentationplugin.cpp
@@ -0,0 +1,721 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 by Alexander Dymo
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#include "tdevdocumentationplugin.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+//class DocumentationItem
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListView *parent,
+ const TQString &name)
+ :TDEListViewItem(parent, name), m_type(type)
+{
+ init();
+}
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListViewItem *parent,
+ const TQString &name)
+ :TDEListViewItem(parent, name), m_type(type)
+{
+ init();
+}
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListView *parent,
+ TDEListViewItem *after, const TQString &name)
+ :TDEListViewItem(parent, after, name), m_type(type)
+{
+ init();
+}
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, TDEListViewItem * parent,
+ TDEListViewItem * after, const TQString & name )
+ :TDEListViewItem(parent, after, name), m_type(type)
+{
+ init();
+}
+
+
+void DocumentationItem::init( )
+{
+ TQString icon;
+
+ switch (m_type)
+ {
+ case Collection:
+ case Catalog:
+ icon = "folder";
+ break;
+ case Book:
+ icon = "contents";
+ break;
+ default:
+ icon = "document";
+ }
+
+ setPixmap(0, SmallIcon(icon));
+}
+
+
+
+
+
+//class DocumentationCatalogItem
+
+
+DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin,
+ TDEListView *parent, const TQString &name)
+ :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin),
+ isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false)
+{
+ setExpandable(true);
+ m_plugin->addCatalog(this);
+}
+
+DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin,
+ DocumentationItem *parent, const TQString &name)
+ :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin),
+ isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false)
+{
+ setExpandable(true);
+ m_plugin->addCatalog(this);
+}
+
+DocumentationCatalogItem::~ DocumentationCatalogItem( )
+{
+ m_plugin->clearCatalog(this);
+}
+
+void DocumentationCatalogItem::setOpen(bool o)
+{
+ if (o)
+ {
+ load();
+ }
+ DocumentationItem::setOpen(o);
+}
+
+void DocumentationCatalogItem::load()
+{
+if(isLoaded)
+return;
+
+ plugin()->createTOC(this);
+ isLoaded = true;
+}
+
+void DocumentationCatalogItem::activate()
+{
+ if (!isActivated)
+ {
+ plugin()->setCatalogURL(this);
+ isActivated = true;
+ }
+ DocumentationItem::activate();
+}
+
+
+
+
+//class IndexItemProto
+
+IndexItemProto::IndexItemProto(DocumentationPlugin *plugin, DocumentationCatalogItem *catalog,
+ IndexBox *listbox, const TQString &text, const TQString &description)
+ : m_listbox(listbox), m_text(text), m_description(description)
+{
+ plugin->indexes[catalog].append(this);
+ m_listbox->addIndexItem(this);
+}
+
+IndexItemProto::~IndexItemProto()
+{
+ m_listbox->removeIndexItem(this);
+}
+
+
+//class IndexItem
+
+IndexItem::IndexItem(IndexBox *listbox, const TQString &text)
+ :TQListBoxText(listbox, text), m_listbox(listbox)
+{
+}
+
+IndexItem::List IndexItem::urls() const
+{
+ List urlList;
+ TQValueList itemProtos = m_listbox->items[text()];
+ for (TQValueList::const_iterator it = itemProtos.begin();
+ it != itemProtos.end(); ++it)
+ urlList.append(tqMakePair((*it)->description(), (*it)->url()));
+ return urlList;
+}
+
+
+
+
+//class ConfigurationItem
+
+ConfigurationItem::ConfigurationItem(TQListView *parent, DocumentationPlugin * plugin, const TQString &title, const TQString &url,
+ bool indexPossible, bool fullTextSearchPossible)
+ :TQCheckListItem(parent, "", TQCheckListItem::CheckBox), m_title(title), m_url(url),
+ m_origTitle(title), m_contents(true), m_index(false), m_fullTextSearch(false),
+ m_indexPossible(indexPossible), m_fullTextSearchPossible(fullTextSearchPossible),
+ m_docPlugin( plugin )
+{
+ setText(3, m_title);
+ setText(4, m_url);
+}
+
+void ConfigurationItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column,
+ int width, int align)
+{
+ if ( (column == 0) || (column == 1) || (column == 2) )
+ {
+ if ( !p )
+ return;
+
+ TQListView *lv = listView();
+ if ( !lv )
+ return;
+
+ const BackgroundMode bgmode = lv->viewport()->backgroundMode();
+ const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode );
+ p->fillRect(0, 0, width, height(), cg.brush(crole));
+
+ TQFontMetrics fm(lv->fontMetrics());
+ int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv);
+ int marg = lv->itemMargin();
+ int styleflags = TQStyle::Style_Default;
+
+ if (((column == 0) && m_contents) || ((column == 1) && m_index) || ((column == 2) && m_fullTextSearch))
+ styleflags |= TQStyle::Style_On;
+ else
+ styleflags |= TQStyle::Style_Off;
+ if ((column == 0) || ((column == 1) && m_indexPossible) || ((column == 2) && m_fullTextSearchPossible))
+ styleflags |= TQStyle::Style_Enabled;
+
+ int x = 0;
+ int y = 0;
+ x += 3;
+ if (align & AlignVCenter)
+ y = ((height() - boxsize) / 2) + marg;
+ else
+ y = (fm.height() + 2 + marg - boxsize) / 2;
+
+ TQStyleOption opt(this);
+ lv->style().tqdrawPrimitive(TQStyle::PE_CheckListIndicator, p,
+ TQRect(x, y, boxsize, fm.height() + 2 + marg), cg, styleflags, opt);
+
+ return;
+ }
+ TQListViewItem::paintCell(p, cg, column, width, align);
+}
+
+int ConfigurationItem::width(const TQFontMetrics &fm, const TQListView *lv, int c) const
+{
+ if ((c == 0) || (c == 1) || (c == 2))
+ return lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv) + 4;
+ return TQListViewItem::width(fm, lv, c);
+}
+
+
+
+
+
+
+
+
+//class DocumentationPlugin
+
+DocumentationPlugin::DocumentationPlugin(TDEConfig *pluginConfig, TQObject *parent, const char *name)
+ :TQObject(parent, name), config(pluginConfig), m_indexCreated(false)
+{
+}
+
+DocumentationPlugin::~DocumentationPlugin()
+{
+}
+
+void DocumentationPlugin::autoSetup()
+{
+ config->setGroup("General");
+ if ( ! config->readBoolEntry("Autosetup", false) )
+ {
+ autoSetupPlugin();
+ config->setGroup("General");
+ config->writeEntry("Autosetup", true);
+ config->sync();
+ }
+}
+
+void DocumentationPlugin::reload()
+{
+ clear();
+ for (TQValueList::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ createTOC(*it);
+ }
+}
+
+void DocumentationPlugin::clear()
+{
+ for (TQValueList::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ clearCatalog(*it);
+ }
+}
+
+void DocumentationPlugin::clearCatalog(DocumentationCatalogItem *item)
+{
+ //clear named catalog map
+ for (TQMap::iterator it = namedCatalogs.begin();
+ it != namedCatalogs.end(); ++it)
+ {
+ if (it.data() == item)
+ {
+ namedCatalogs.remove(it);
+ break;
+ }
+ }
+ //clear indexes for catalog
+ TQValueList idx = indexes[item];
+ for (TQValueList::iterator it = idx.begin(); it != idx.end(); ++it)
+ {
+ delete *it;
+ }
+ indexes.remove(item);
+
+ //remove catalog
+ catalogs.remove(item);
+}
+
+void DocumentationPlugin::createIndex(IndexBox *index)
+{
+ if (m_indexCreated)
+ return;
+
+ for (TQValueList::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ loadIndex(index, *it);
+ }
+ m_indexCreated = true;
+}
+
+void DocumentationPlugin::cacheIndex(DocumentationCatalogItem *item)
+{
+ kdDebug() << "Creating index cache for " << item->text(0) << endl;
+
+ TQString cacheName = locateLocal("data", TQString("tdevdocumentation/index/cache_") + item->text(0));
+ TQFile cacheFile(cacheName);
+ if (!cacheFile.open(IO_WriteOnly))
+ return;
+
+ TQTextStream str(&cacheFile);
+ str.setEncoding(TQTextStream::Unicode);
+ str << CACHE_VERSION << endl;
+
+ TQValueList catalogIndexes = indexes[item];
+ for (TQValueList::const_iterator it = catalogIndexes.constBegin();
+ it != catalogIndexes.constEnd(); ++it)
+ {
+ str << (*it)->text() << endl;
+ str << (*it)->description() << endl;
+ str << (*it)->url().url() << endl;
+ }
+
+ cacheFile.close();
+}
+
+bool DocumentationPlugin::loadCachedIndex(IndexBox *index, DocumentationCatalogItem *item)
+{
+ TQString cacheName = locateLocal("data", TQString("tdevdocumentation/index/cache_") + item->cacheVersion() + item->text(0));
+ TQFile cacheFile(cacheName);
+ if (!cacheFile.open(IO_ReadOnly))
+ return false;
+
+ kdDebug() << "Using cached index for item: " << item->text(0) << endl;
+
+ TQTextStream str(&cacheFile);
+ str.setEncoding(TQTextStream::Unicode);
+ TQString cache = str.read();
+ TQStringList cacheList = TQStringList::split("\n", cache, true);
+ TQString ver = cacheList.first();
+ if (ver != CACHE_VERSION)
+ {
+ kdDebug() << "Wrong cache version: " << ver << endl;
+ return false;
+ }
+ TQStringList::const_iterator it = cacheList.begin();
+ it++;
+ TQString s[3]; int c = 0;
+ for (; it != cacheList.end(); ++it)
+ {
+ s[c] = *it;
+ if (c == 2)
+ {
+ IndexItemProto *ii = new IndexItemProto(this, item, index, s[0], s[1]);
+ ii->addURL(KURL(s[2]));
+ c = 0;
+ }
+ else c++;
+ }
+ cacheFile.close();
+
+ return true;
+}
+
+void DocumentationPlugin::addCatalog(DocumentationCatalogItem *item)
+{
+ catalogs.append(item);
+ namedCatalogs[item->text(0)] = item;
+// indexes[item] = TQValueList();
+}
+
+void DocumentationPlugin::addCatalogConfiguration(TDEListView *configurationView,
+ const TQString &title, const TQString &url)
+{
+ new ConfigurationItem(configurationView, this, title, url,
+ hasCapability(Index), hasCapability(FullTextSearch));
+}
+
+void DocumentationPlugin::editCatalogConfiguration(ConfigurationItem *configurationItem,
+ const TQString &title, const TQString &url)
+{
+ configurationItem->setTitle(title);
+ configurationItem->setURL(url);
+}
+
+void DocumentationPlugin::deleteCatalogConfiguration(const ConfigurationItem *const configurationItem)
+{
+ deletedConfigurationItems << configurationItem->title();
+}
+
+void DocumentationPlugin::clearCatalogIndex(DocumentationCatalogItem *item)
+{
+ //clear indexes for catalog
+ TQValueList idx = indexes[item];
+ for (TQValueList::iterator it = idx.begin(); it != idx.end(); ++it)
+ {
+ delete *it;
+ }
+ indexes.remove(item);
+}
+
+void DocumentationPlugin::loadIndex(IndexBox *index, DocumentationCatalogItem *item)
+{
+ if (!indexEnabled(item))
+ return;
+ if (!needRefreshIndex(item) && loadCachedIndex(index, item))
+ return;
+ createIndex(index, item);
+ cacheIndex(item);
+}
+
+void DocumentationPlugin::init(TDEListView *contents)
+{
+ config->setGroup("Locations");
+ TQMap entryMap = config->entryMap("Locations");
+
+ for (TQMap::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ if (catalogEnabled(it.key()))
+ createCatalog(contents, it.key(), config->readPathEntry(it.key()));
+ }
+}
+
+void DocumentationPlugin::reinit(TDEListView *contents, IndexBox *index, TQStringList restrictions)
+{
+ config->setGroup("Locations");
+ TQMap entryMap = config->entryMap("Locations");
+
+ //remove deleted in configuration catalogs
+ for (TQStringList::const_iterator it = deletedConfigurationItems.constBegin();
+ it != deletedConfigurationItems.constEnd(); ++it)
+ {
+ if (namedCatalogs.contains(*it))
+ delete namedCatalogs[*it];
+ }
+ deletedConfigurationItems.clear();
+
+ //update configuration
+ for (TQMap::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ config->setGroup("Locations");
+ if (restrictions.contains(it.key()) || (!catalogEnabled(it.key())))
+ {
+ if (namedCatalogs.contains(it.key()))
+ delete namedCatalogs[it.key()];
+ }
+ else
+ {
+ kdDebug() << "updating 1" << endl;
+ if (!namedCatalogs.contains(it.key())) //create catalog if it does not exist
+ {
+ DocumentationCatalogItem * item = createCatalog(contents, it.key(), config->readPathEntry(it.key()));
+ loadIndex(index, item);
+ index->setDirty(true);
+// index->refill(indexes[item]);
+ }
+ else if (!indexEnabled(namedCatalogs[it.key()])) //clear index if it is disabled in configuration
+ {
+ kdDebug() << " updating: clearCatalogIndex" << endl;
+ clearCatalogIndex(namedCatalogs[it.key()]);
+ }
+ else if ( (indexEnabled(namedCatalogs[it.key()])) //index is requested in configuration but does not yet exist
+ && (!indexes.contains(namedCatalogs[it.key()])) )
+ {
+ kdDebug() << " index requested " << endl;
+ loadIndex(index, namedCatalogs[it.key()]);
+ index->setDirty(true);
+ }
+ m_indexCreated = true;
+ }
+ }
+}
+
+void DocumentationPlugin::loadCatalogConfiguration(TDEListView *configurationView)
+{
+ config->setGroup("Locations");
+ TQMap entryMap = config->entryMap("Locations");
+
+ for (TQMap::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ if (namedCatalogs.contains(it.key())
+ && namedCatalogs[it.key()]->isProjectDocumentationItem())
+ continue;
+
+ config->setGroup("Locations");
+ ConfigurationItem *item = new ConfigurationItem(configurationView, this, it.key(),
+ config->readPathEntry(it.key()),
+ hasCapability(Index), hasCapability(FullTextSearch));
+ config->setGroup("TOC Settings");
+ item->setContents(config->readBoolEntry(item->title(), true));
+ config->setGroup("Index Settings");
+ item->setIndex(config->readBoolEntry(item->title(), false));
+ config->setGroup("Search Settings");
+ item->setFullTextSearch(config->readBoolEntry(item->title(), false));
+ }
+}
+
+void DocumentationPlugin::saveCatalogConfiguration(TDEListView *configurationView)
+{
+ config->setGroup("Locations");
+
+ for (TQStringList::const_iterator it = deletedConfigurationItems.constBegin();
+ it != deletedConfigurationItems.constEnd(); ++it)
+ {
+ config->deleteEntry(*it);
+ }
+
+ TQListViewItemIterator it(configurationView);
+ while (it.current())
+ {
+ ConfigurationItem *confItem = dynamic_cast(it.current());
+ if ( confItem->docPlugin() != this )
+ {
+ ++it;
+ continue;
+ }
+
+ config->setGroup("Locations");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writePathEntry(confItem->title(), confItem->url());
+
+ config->setGroup("TOC Settings");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writeEntry(confItem->title(), confItem->contents());
+
+ config->setGroup("Index Settings");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writeEntry(confItem->title(), confItem->index());
+
+ config->setGroup("Search Settings");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writeEntry(confItem->title(), confItem->fullTextSearch());
+
+ ++it;
+ }
+ config->sync();
+}
+
+void DocumentationPlugin::setIndexEnabled( DocumentationCatalogItem * item, bool e )
+{
+ TQString group = config->group();
+ config->setGroup("Index Settings");
+ config->writeEntry(item->text(0), e);
+ config->setGroup(group);
+}
+
+bool DocumentationPlugin::indexEnabled( DocumentationCatalogItem * item ) const
+{
+ TQString group = config->group();
+ config->setGroup("Index Settings");
+ bool b = config->readBoolEntry(item->text(0), false);
+ config->setGroup(group);
+ return b;
+}
+
+bool DocumentationPlugin::catalogEnabled(const TQString &name) const
+{
+ TQString group = config->group();
+ config->setGroup("TOC Settings");
+ bool b = config->readBoolEntry(name, true);
+ config->setGroup(group);
+ return b;
+}
+
+void DocumentationPlugin::setCatalogEnabled(const TQString &name, bool e)
+{
+ TQString group = config->group();
+ config->setGroup("TOC Settings");
+ config->writeEntry(name, e);
+ config->setGroup(group);
+}
+
+
+
+
+//class IndexBox
+
+IndexBox::IndexBox(TQWidget *parent, const char *name)
+ :TDEListBox(parent, name), m_dirty(false)
+{
+}
+
+void IndexBox::addIndexItem(IndexItemProto *item)
+{
+ items[item->text()].append(item);
+}
+
+void IndexBox::removeIndexItem(IndexItemProto *item)
+{
+ TQString text = item->text();
+ items[text].remove(item);
+ if (items[text].count() == 0)
+ {
+ items.remove(text);
+ TQListBoxItem *item = findItem(text, TQt::CaseSensitive | TQt::ExactMatch);
+ if (item)
+ delete item;
+ }
+}
+
+void IndexBox::fill()
+{
+ for (TQMap >::const_iterator it = items.begin();
+ it != items.end(); ++it)
+ {
+ new IndexItem(this, it.key());
+ }
+}
+
+void IndexBox::setDirty(bool dirty)
+{
+ m_dirty = dirty;
+}
+
+void IndexBox::refill()
+{
+ if (m_dirty)
+ {
+ clear();
+ fill();
+ setDirty(false);
+ }
+}
+
+
+ProjectDocumentationPlugin::ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type)
+ :TQObject(0, 0), m_docPlugin(docPlugin), m_catalog(0), m_type(type), m_contents(0), m_index(0)
+{
+ kdDebug() << "ProjectDocumentationPlugin::ProjectDocumentationPlugin for type " << type << endl;
+
+ m_watch = new KDirWatch(this);
+ connect(m_watch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(reinit()));
+ m_watch->startScan();
+}
+
+ProjectDocumentationPlugin::~ProjectDocumentationPlugin()
+{
+ deinit();
+}
+
+void ProjectDocumentationPlugin::init(TDEListView *contents, IndexBox *index, const TQString &url)
+{
+ m_contents = contents;
+ m_index = index;
+ m_url = url;
+
+ if (m_catalog)
+ deinit();
+ m_catalog = m_docPlugin->createCatalog(contents,
+ m_type == DocumentationPlugin::APIDocs ? i18n("Project API Documentation")
+ : i18n("Project User Manual"), url);
+ if (m_catalog)
+ {
+ m_catalog->setProjectDocumentationItem(true);
+ m_watch->addFile(url);
+ }
+}
+
+void ProjectDocumentationPlugin::reinit()
+{
+ deinit();
+ if (m_contents != 0 && m_index != 0 && m_url != 0)
+ init(m_contents, m_index, m_url);
+}
+
+void ProjectDocumentationPlugin::deinit()
+{
+ m_watch->removeFile(m_url);
+ delete m_catalog;
+ m_catalog = 0;
+}
+
+TQString ProjectDocumentationPlugin::pluginName() const
+{
+ return m_docPlugin->pluginName();
+}
+
+TQString ProjectDocumentationPlugin::catalogURL() const
+{
+ return m_url;
+}
+
+#include "tdevdocumentationplugin.moc"
diff --git a/parts/documentation/interfaces/tdevdocumentationplugin.h b/parts/documentation/interfaces/tdevdocumentationplugin.h
new file mode 100644
index 00000000..ed18a86a
--- /dev/null
+++ b/parts/documentation/interfaces/tdevdocumentationplugin.h
@@ -0,0 +1,423 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 by Alexander Dymo
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef TDEV_DOC_PLUGIN_H
+#define TDEV_DOC_PLUGIN_H
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#define CACHE_VERSION "3"
+
+/**Documentation list item.
+Stores the type of a documentation it represents and an URL.*/
+class DocumentationItem: public TDEListViewItem
+{
+public:
+ /**Type of documentation which is represented by this item.*/
+ enum Type {
+ Collection /** URL;
+ typedef TQValueList List;
+
+ IndexItem(IndexBox *listbox, const TQString &text);
+
+ List urls() const;
+
+private:
+ IndexBox *m_listbox;
+};
+
+/**Documentation index view.*/
+class IndexBox: public TDEListBox{
+public:
+ IndexBox(TQWidget *parent = 0, const char *name = 0);
+
+ virtual void addIndexItem(IndexItemProto *item);
+ virtual void removeIndexItem(IndexItemProto *item);
+ virtual void fill();
+ virtual void refill();
+ virtual void setDirty(bool dirty);
+// virtual void refill(TQValueList &items);
+
+private:
+ TQMap > items;
+ friend class IndexItem;
+
+ bool m_dirty;
+};
+
+class TQPainter;
+class TQColorGroup;
+class TQFontMetrics;
+class DocumentationPlugin;
+
+/**Documentation configuration item.*/
+class ConfigurationItem: public TQCheckListItem
+{
+public:
+ ConfigurationItem(TQListView *parent, DocumentationPlugin * plugin, const TQString &title, const TQString &url,
+ bool indexPossible, bool fullTextSearchPossible);
+
+ virtual TQString title() const { return m_title; }
+ virtual void setTitle(const TQString title) { setText(3, m_title = title); }
+ virtual TQString url() const { return m_url; }
+ virtual void setURL(const TQString url) { setText(4, m_url = url); }
+
+ virtual bool isChanged() const { return m_title == m_origTitle; }
+ virtual TQString origTitle() const {return m_origTitle; }
+
+ virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align);
+ virtual int width(const TQFontMetrics &fm, const TQListView *lv, int c) const;
+
+ bool contents() const { return m_contents; }
+ void setContents(bool contents) { m_contents = contents; }
+ bool index() const { return m_index; }
+ void setIndex(bool index) { m_index = index; }
+ bool fullTextSearch() const { return m_fullTextSearch; }
+ void setFullTextSearch(bool fullTextSearch) { m_fullTextSearch = fullTextSearch; }
+
+ bool indexPossible() const { return m_indexPossible; }
+ bool fullTextSearchPossible() const { return m_fullTextSearchPossible; }
+
+ DocumentationPlugin * docPlugin() { return m_docPlugin; }
+
+private:
+ TQString m_title;
+ TQString m_url;
+ TQString m_origTitle;
+
+ bool m_contents;
+ bool m_index;
+ bool m_fullTextSearch;
+
+ bool m_indexPossible;
+ bool m_fullTextSearchPossible;
+
+ DocumentationPlugin * m_docPlugin;
+};
+
+
+class ProjectDocumentationPlugin;
+
+/**
+@short 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.
+*/
+class DocumentationPlugin: public TQObject
+{
+ Q_OBJECT
+
+public:
+ /**Capability of documentation plugin.*/
+ enum Capability { Index=1 /** catalogLocatorProps() = 0;
+ /**Returns a title of catalog defined by an url parameter.*/
+ virtual TQString catalogTitle(const TQString &url) = 0;
+
+ /**Reloads documentation catalogs and indices.*/
+ virtual void reload();
+ /**Clears documentation catalogs and indices.*/
+ virtual void clear();
+
+ /**Checks if documentation plugin has given capability.*/
+ bool hasCapability(Capability cap) const { return m_capabilities & cap; }
+
+ /**Sets dirty flag for all indices. Index caching algorythm will update
+ the cache next time @ref createIndex is called.*/
+ void setDirtyIndex(bool dirty) { m_indexCreated = dirty; }
+
+ /**Caches index for documentation catalog. Reimplement this only if custom
+ caching algorythm is used (do not forget to reimplement also @ref loadCachedIndex
+ and @ref createIndex).*/
+ virtual void cacheIndex(DocumentationCatalogItem *item);
+ /**Loads index from the cache. Reimplement this only if custom
+ caching algorythm is used (do not forget to reimplement also @ref cacheIndex
+ and @ref createIndex).*/
+ virtual bool loadCachedIndex(IndexBox *index, DocumentationCatalogItem *item);
+
+ /**Returns associated project documentation plugin. Default implementation returns zero.
+ Reimplement this if the documentation plugin can also handle project documentation.*/
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType /* type */) { return 0; }
+
+public slots:
+ /**Creates index and fills index listbox. Reimplement this only if custom
+ caching algorythm is used (do not forget to reimplement also @ref cacheIndex
+ and @ref loadCachedIndex).*/
+ virtual void createIndex(IndexBox *index);
+
+protected:
+ /**A list of loaded documentation catalogs.*/
+ TQValueList catalogs;
+ /**A map of names of loaded documentation catalogs.*/
+ TQMap namedCatalogs;
+ /**A map of indices of loaded documentation catalogs.*/
+ TQMap > indexes;
+
+ /**Sets capabilities of documentation plugin.*/
+ void setCapabilities(int caps) { m_capabilities = caps; }
+ /**Clears index of given catalog.*/
+ virtual void clearCatalogIndex(DocumentationCatalogItem *item);
+ /**Loads index from cache or creates and caches it if does not exist.*/
+ void loadIndex(IndexBox *index, DocumentationCatalogItem *item);
+
+ /**Stores items deleted from configuration. @ref saveCatalogConfiguration
+ uses this to remove entries from configuration file.*/
+ TQStringList deletedConfigurationItems;
+
+ /**Configuration object used by a plugin.*/
+ TDEConfig *config;
+
+private:
+ /**Adds catalog item to catalogs, namedCatalogs and indexes lists and maps.*/
+ virtual void addCatalog(DocumentationCatalogItem *item);
+ /**Removes catalog item from catalogs, namedCatalogs and indexes lists and maps.*/
+ virtual void clearCatalog(DocumentationCatalogItem *item);
+
+ int m_capabilities;
+ bool m_indexCreated;
+
+
+friend class IndexItemProto;
+friend class DocumentationCatalogItem;
+};
+
+
+/**
+@short Project documentation plugin
+
+Represents functionality to display project documentation catalog and index in documentation browser.
+*/
+class ProjectDocumentationPlugin: public TQObject {
+ Q_OBJECT
+
+public:
+ ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type);
+ virtual ~ProjectDocumentationPlugin();
+
+ /**Initializes project documentation plugin - creates documentation catalog.*/
+ virtual void init(TDEListView *contents, IndexBox *index, const TQString &url);
+ /**Deinitializes project documentation plugin - removes documentation catalog.*/
+ virtual void deinit();
+
+ TQString pluginName() const;
+ TQString catalogURL() const;
+
+public slots:
+ /**Performs reinitialization if project documentation has changed (after building api documentation).*/
+ virtual void reinit();
+
+protected:
+ DocumentationPlugin *m_docPlugin;
+ DocumentationCatalogItem *m_catalog;
+
+private:
+ DocumentationPlugin::ProjectDocType m_type;
+
+ class KDirWatch *m_watch;
+ class TDEListView *m_contents;
+ class IndexBox *m_index;
+ TQString m_url;
+};
+
+#endif
diff --git a/parts/documentation/kdevdocumentation.desktop b/parts/documentation/kdevdocumentation.desktop
deleted file mode 100644
index 674812f4..00000000
--- a/parts/documentation/kdevdocumentation.desktop
+++ /dev/null
@@ -1,82 +0,0 @@
-[Desktop Entry]
-Type=Service
-Exec=blubb
-Comment=The Documentation plugin offers browsing and searching in local and online documentation with support for multiple documentation systems.
-Comment[ca]=El connector de documentació ofereix navegació i recerca en documentació local i en línia amb suport per a múltiples sistemes de documentació.
-Comment[da]=Dokumentations-plugin tilbyder visning og søgning i lokal og online dokumentation med understøttelse af flere dokumentations-systemer.
-Comment[de]=Die Dokumentations-Komponente bietet eine Browsefunktion und Unterstützung für die Suche in mehreren Hilfedokumenten und Dokumentationssystemen.
-Comment[el]=Το πρόσθετο τεκμηρίωσης προσφέρει περιήγηση και αναζήτηση σε τοπική και απομακρυσμένη τεκμηρίωση για πολλαπλά συστήματα τεκμηρίωσης.
-Comment[es]=El complemento de documentación proporciona navegación y búsqueda en la documentación, tanto local como en línea, y permite múltiples sistemas de documentación.
-Comment[et]=Dokumentatsiooniplugin võimaldab lehitseda ja otsida nii kohalikus kui võrgudokumentatsioonis paljusid dokumentatsioonisüsteeme kasutades.
-Comment[eu]=Dokumentazio-pluginak lokaleko eta urruneko dokumentazio arakatzeko eta bilatzeko aukera ematen dizu, eta dokumentazio-sistema anitz onartzen ditu.
-Comment[fa]=وصلۀ مستندسازی، مرور و جستجو در مستندات محلی و برخط را با پشتیبانی از سیستمهای مستندسازی چندگانه، ارائه میکند.
-Comment[fr]=Le module externe de documentation offre une navigation et une recherche dans la documentation locale et en ligne ainsi que la prise en charge de systèmes de documentation mutiples.
-Comment[gl]=A extensión de documentación ofrece navegación e búsqueda en documentación local e en liña con soporte para múltiples sistemas de documentación.
-Comment[hu]=Dokumentációmegjelenítő elem helyi és távoli dokumentáció böngészéséhez, keresési lehetőséggel. Többféle formátumot támogat.
-Comment[it]=Il plugin di documentazione offre navigazione e ricerca in locale e documentazione in linea con supporto per sistemi di documentazione multipla.
-Comment[ms]=Plugin dokumentasi menawarkan pelungsuran dan pencarian dalam dokumentasi tempatan dan dalam talian dengan sokongan untuk pelbagai sistem dokumentasi.
-Comment[nds]=Mit dat Dokmentatschoon-Moduul kannst Du lokale un Tokoppel-Dokmentatschoon dörkieken un -söken, mehr Dokmentatschoonsystemen warrt ünnerstütt.
-Comment[ne]=मिसिलीकरण प्लगइनले बहुविध मिसिलीकरण प्रणालीको समर्थनसँग अनलाइन मिसिलीकरण र स्थानीय रूपमा ब्राउज र खोजी गर्न दिन्छ ।
-Comment[nl]=De documentatieplugin welke het mogelijk maakt om door lokale documentatie en documentatie op afstand te bladeren en te zoeken. Met ondersteuning voor verschillende documentatiesystemen.
-Comment[pl]=Kontrola dokumentacji z obsługą przeglądania i wyszukiwania w różnych plikach pomocy i systemach dokumentacji.
-Comment[pt]=O 'plugin' de documentação oferece navegação e procura em documentação local e em rede com suporte para vários sistemas de documentação.
-Comment[pt_BR]=A documentação do plug-in oferece navegação e busca na documentação local e online com suporte para diversos sistemas de documentação.
-Comment[ru]=Модуль документации позволяет упростить работу с документацией.
-Comment[sk]=Dokumentačný modul proskytuje prehliadanie a vyhľadávanie v lokálnej a online dokumentácie s podporou viacerých dokumentačných systémov.
-Comment[sr]=Прикључак за документацију са подршком за прегледање и тражење у локалној и документацији на вези, за више документационих система.
-Comment[sr@Latn]=Priključak za dokumentaciju sa podrškom za pregledanje i traženje u lokalnoj i dokumentaciji na vezi, za više dokumentacionih sistema.
-Comment[sv]=Dokumentationsinsticksprogrammet erbjuder bläddring och sökning i lokal dokumentation och dokumentation på nätet, med stöd för flera dokumentationssystem.
-Comment[tr]=Belgelendirme eklentisi, çoklu belgelendirme sistemlerine destek ile, yerel ve çevrimiçi belgelere gözatma ve bu belgelerde arama yapılmasına izin verir.
-Comment[zh_CN]=文档插件提供了本地和在线文档中提供浏览和搜索功能,支持多种文档系统
-Comment[zh_TW]=文件外掛程式提供對本地與線上文件的瀏覽與搜尋功能,並支援多重文件系統。
-Name=KDevDocumentation
-Name[da]=TDevelop dokumentation
-Name[nds]=TDevelop-Dokmentatschoon
-Name[pt_BR]=KDevDocumentação
-Name[sk]=KDev dokumentácia
-Name[sv]=TDevelop dokumentation
-Name[ta]=KDev ஆவணமாக்கல்
-Name[tg]=Ҳуҷҷатҳои KDev
-Name[zh_TW]=TDevelop 文件
-GenericName=Documentation
-GenericName[br]=Teuliadur
-GenericName[ca]=Documentació
-GenericName[cy]=Dogfenniaeth
-GenericName[da]=Dokumentation
-GenericName[de]=Dokumentationsbaum
-GenericName[el]=Τεκμηρίωση
-GenericName[es]=Documentación
-GenericName[et]=Dokumentatsioon
-GenericName[eu]=Dokumentazioa
-GenericName[fa]=مستندات
-GenericName[ga]=Doiciméadú
-GenericName[gl]=Documentación
-GenericName[hi]=दस्तावेज़ीकरण
-GenericName[hu]=Dokumentáció
-GenericName[it]=Documentazione
-GenericName[ja]=ドキュメンテーション
-GenericName[ms]=Dokumentasi
-GenericName[nds]=Dokmentatschoon
-GenericName[ne]=मिसिलीकरण
-GenericName[nl]=Documentatie
-GenericName[pl]=Dokumentacja
-GenericName[pt]=Documentação
-GenericName[pt_BR]=Documentação
-GenericName[ru]=Просмотр документации
-GenericName[sk]=Dokumentácia
-GenericName[sl]=Dokumentacija
-GenericName[sr]=Документација
-GenericName[sr@Latn]=Dokumentacija
-GenericName[sv]=Dokumentation
-GenericName[ta]=ஆவணமாக்கல்
-GenericName[tg]=Намоиши ҳуҷҷатҳо
-GenericName[tr]=Belgelendirme
-GenericName[zh_CN]=文档
-GenericName[zh_TW]=文件
-Icon=khelpcenter
-ServiceTypes=TDevelop/Plugin
-X-TDevelop-Scope=Global
-X-TDE-Library=libkdevdocumentation
-X-TDevelop-Version=5
-X-TDevelop-Mode=AssistantMode
-X-TDevelop-Properties=Documentation
diff --git a/parts/documentation/kdevpart_documentation.rc b/parts/documentation/kdevpart_documentation.rc
deleted file mode 100644
index f8dac85a..00000000
--- a/parts/documentation/kdevpart_documentation.rc
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/parts/documentation/plugins/CMakeLists.txt b/parts/documentation/plugins/CMakeLists.txt
index 281c40f8..116e7674 100644
--- a/parts/documentation/plugins/CMakeLists.txt
+++ b/parts/documentation/plugins/CMakeLists.txt
@@ -12,6 +12,6 @@
add_subdirectory( qt )
add_subdirectory( doxygen )
add_subdirectory( devhelp )
-add_subdirectory( kdevtoc )
+add_subdirectory( tdevtoc )
add_subdirectory( chm )
add_subdirectory( custom )
diff --git a/parts/documentation/plugins/Makefile.am b/parts/documentation/plugins/Makefile.am
index c2002f78..253a0193 100644
--- a/parts/documentation/plugins/Makefile.am
+++ b/parts/documentation/plugins/Makefile.am
@@ -1,3 +1,3 @@
INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
METASOURCES = AUTO
-SUBDIRS = qt doxygen devhelp kdevtoc chm custom
+SUBDIRS = qt doxygen devhelp tdevtoc chm custom
diff --git a/parts/documentation/plugins/chm/docchmplugin.cpp b/parts/documentation/plugins/chm/docchmplugin.cpp
index 5acecce3..f3287540 100644
--- a/parts/documentation/plugins/chm/docchmplugin.cpp
+++ b/parts/documentation/plugins/chm/docchmplugin.cpp
@@ -28,14 +28,14 @@
#include
#include
#include
-#include
-#include
+#include
+#include
#include
#include "../../../../config.h"
-static const KDevPluginInfo data("docchmplugin");
-typedef KDevGenericFactory DocCHMPluginFactory;
+static const TDevPluginInfo data("docchmplugin");
+typedef TDevGenericFactory DocCHMPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocchmplugin, DocCHMPluginFactory(data) )
DocCHMPlugin::DocCHMPlugin(TQObject* parent, const char* name, TQStringList // args
diff --git a/parts/documentation/plugins/chm/docchmplugin.h b/parts/documentation/plugins/chm/docchmplugin.h
index 452e1c09..e814248f 100644
--- a/parts/documentation/plugins/chm/docchmplugin.h
+++ b/parts/documentation/plugins/chm/docchmplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCCHMPLUGIN_H
#define DOCCHMPLUGIN_H
-#include
+#include
class DocCHMPlugin :public DocumentationPlugin
{
diff --git a/parts/documentation/plugins/custom/doccustomplugin.cpp b/parts/documentation/plugins/custom/doccustomplugin.cpp
index dd141eba..55d6c9c6 100644
--- a/parts/documentation/plugins/custom/doccustomplugin.cpp
+++ b/parts/documentation/plugins/custom/doccustomplugin.cpp
@@ -25,11 +25,11 @@
#include
#include
-#include
-#include
+#include
+#include
-static const KDevPluginInfo data("doccustomplugin");
-typedef KDevGenericFactory DocCustomPluginFactory;
+static const TDevPluginInfo data("doccustomplugin");
+typedef TDevGenericFactory DocCustomPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdoccustomplugin, DocCustomPluginFactory(data) )
DocCustomPlugin::DocCustomPlugin(TQObject* parent, const char* name, const TQStringList // args
diff --git a/parts/documentation/plugins/custom/doccustomplugin.h b/parts/documentation/plugins/custom/doccustomplugin.h
index f83daf1a..315e0864 100644
--- a/parts/documentation/plugins/custom/doccustomplugin.h
+++ b/parts/documentation/plugins/custom/doccustomplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCCUSTOMPLUGIN_H
#define DOCCUSTOMPLUGIN_H
-#include
+#include
class DocCustomPlugin : public DocumentationPlugin {
public:
diff --git a/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp b/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp
index 4f2d50d6..d644df4f 100644
--- a/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp
+++ b/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp
@@ -32,8 +32,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "../../../../config.h"
@@ -69,8 +69,8 @@ private:
};
-static const KDevPluginInfo data("docdevhelpplugin");
-typedef KDevGenericFactory DocDevHelpPluginFactory;
+static const TDevPluginInfo data("docdevhelpplugin");
+typedef TDevGenericFactory DocDevHelpPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocdevhelpplugin, DocDevHelpPluginFactory(data) )
DocDevHelpPlugin::DocDevHelpPlugin(TQObject* parent, const char* name,
diff --git a/parts/documentation/plugins/devhelp/docdevhelpplugin.h b/parts/documentation/plugins/devhelp/docdevhelpplugin.h
index 6436a1d8..11339098 100644
--- a/parts/documentation/plugins/devhelp/docdevhelpplugin.h
+++ b/parts/documentation/plugins/devhelp/docdevhelpplugin.h
@@ -23,7 +23,7 @@
#include
#include
-#include
+#include
class DocDevHelpPlugin: public DocumentationPlugin
{
diff --git a/parts/documentation/plugins/djvu/docdjvuplugin.cpp b/parts/documentation/plugins/djvu/docdjvuplugin.cpp
index 7851a516..dafdfa1f 100644
--- a/parts/documentation/plugins/djvu/docdjvuplugin.cpp
+++ b/parts/documentation/plugins/djvu/docdjvuplugin.cpp
@@ -25,10 +25,10 @@
#include
#include
-#include
+#include
static const TDEAboutData data("docdjvuplugin", I18N_NOOP("Djvu documentation plugin"), "1.0");
-typedef KDevGenericFactory DocDjvuPluginFactory;
+typedef TDevGenericFactory DocDjvuPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocdjvuplugin, DocDjvuPluginFactory(&data) )
DocDjvuPlugin::DocDjvuPlugin(TQObject* parent, const char* name, const TQStringList args)
diff --git a/parts/documentation/plugins/djvu/docdjvuplugin.h b/parts/documentation/plugins/djvu/docdjvuplugin.h
index 6bff409c..15415c65 100644
--- a/parts/documentation/plugins/djvu/docdjvuplugin.h
+++ b/parts/documentation/plugins/djvu/docdjvuplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCDJVUPLUGIN_H
#define DOCDVJUPLUGIN_H
-#include
+#include
class DocDjvuPlugin : public DocumentationPlugin {
public:
diff --git a/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp b/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp
index 9a5a6912..e5a7da93 100644
--- a/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp
+++ b/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp
@@ -35,8 +35,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "../../../../config.h"
@@ -60,8 +60,8 @@ private:
};
-static const KDevPluginInfo data("docdoxygenplugin");
-typedef KDevGenericFactory DocDoxygenPluginFactory;
+static const TDevPluginInfo data("docdoxygenplugin");
+typedef TDevGenericFactory DocDoxygenPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocdoxygenplugin, DocDoxygenPluginFactory(data) )
DocDoxygenPlugin::DocDoxygenPlugin(TQObject* parent, const char* name, const TQStringList)
diff --git a/parts/documentation/plugins/doxygen/docdoxygenplugin.h b/parts/documentation/plugins/doxygen/docdoxygenplugin.h
index ebd4a540..8382f98e 100644
--- a/parts/documentation/plugins/doxygen/docdoxygenplugin.h
+++ b/parts/documentation/plugins/doxygen/docdoxygenplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCDOXYGENPLUGIN_H
#define DOCDOXYGENPLUGIN_H
-#include
+#include
class TQDomDocument;
class TQDomElement;
diff --git a/parts/documentation/plugins/kdevtoc/CMakeLists.txt b/parts/documentation/plugins/kdevtoc/CMakeLists.txt
deleted file mode 100644
index c12c26e3..00000000
--- a/parts/documentation/plugins/kdevtoc/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-#################################################
-#
-# (C) 2010-2011 Serghei Amelian
-# serghei (DOT) amelian (AT) gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
-
-add_definitions( ${KDE_PLUGIN} )
-
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/lib/interfaces
- ${CMAKE_SOURCE_DIR}/lib/util
- ${CMAKE_SOURCE_DIR}/parts/documentation/interfaces
- ${TDE_INCLUDE_DIR}
- ${TQT_INCLUDE_DIRS}
-)
-
-link_directories(
- ${TQT_LIBRARY_DIRS}
-)
-
-
-##### other data ################################
-
-install( FILES dockdevtocplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
-
-##### libdockdevtocplugin (module) ##############
-
-tde_add_kpart( libdockdevtocplugin AUTOMOC
- SOURCES dockdevtocplugin.cpp
- LINK documentation_interfaces-shared tdevelop-shared
- DESTINATION ${PLUGIN_INSTALL_DIR}
-)
diff --git a/parts/documentation/plugins/kdevtoc/Makefile.am b/parts/documentation/plugins/kdevtoc/Makefile.am
deleted file mode 100644
index 22dab380..00000000
--- a/parts/documentation/plugins/kdevtoc/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
- -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
-METASOURCES = AUTO
-kde_module_LTLIBRARIES = libdockdevtocplugin.la
-libdockdevtocplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
-kde_services_DATA = dockdevtocplugin.desktop
-noinst_HEADERS = dockdevtocplugin.h
-libdockdevtocplugin_la_SOURCES = dockdevtocplugin.cpp
-libdockdevtocplugin_la_LIBADD = $(top_builddir)/lib/libtdevelop.la \
- $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
deleted file mode 100644
index fa17549b..00000000
--- a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2004 by Alexander Dymo *
- * cloudtemple@mksat.net *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-#include "dockdevtocplugin.h"
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include "../../../../config.h"
-
-class TOCDocumentationCatalogItem: public DocumentationCatalogItem
-{
-public:
- TOCDocumentationCatalogItem(const TQString &tocFile, DocumentationPlugin* plugin,
- TDEListView *parent, const TQString &name)
- :DocumentationCatalogItem(plugin, parent, name), m_tocFile(tocFile)
- {
- }
- TOCDocumentationCatalogItem(const TQString &tocFile, DocumentationPlugin* plugin,
- DocumentationItem *parent, const TQString &name)
- :DocumentationCatalogItem(plugin, parent, name), m_tocFile(tocFile)
- {
- }
- TQString tocFile() const { return m_tocFile; }
-
-private:
- TQString m_tocFile;
-};
-
-
-static const KDevPluginInfo data("dockdevtocplugin");
-typedef KDevGenericFactory DocKDevTOCPluginFactory;
-K_EXPORT_COMPONENT_FACTORY( libdockdevtocplugin, DocKDevTOCPluginFactory(data) )
-
-DocKDevTOCPlugin::DocKDevTOCPlugin(TQObject* parent, const char* name,
- const TQStringList /*args*/)
- :DocumentationPlugin(DocKDevTOCPluginFactory::instance()->config(), parent, name)
-{
- setCapabilities(Index);
- autoSetup();
-}
-
-DocKDevTOCPlugin::~DocKDevTOCPlugin()
-{
-}
-
-TQString DocKDevTOCPlugin::pluginName() const
-{
- return i18n("TDevelopTOC Documentation Collection");
-}
-
-DocumentationCatalogItem* DocKDevTOCPlugin::createCatalog(TDEListView* contents, const TQString& title, const TQString& url)
-{
- return new TOCDocumentationCatalogItem(url, this, contents, title);
-}
-
-TQPair DocKDevTOCPlugin::catalogLocatorProps()
-{
- return TQPair(KFile::File, "*.toc");
-}
-
-TQString DocKDevTOCPlugin::catalogTitle(const TQString& url)
-{
- TQFileInfo fi(url);
- if (!fi.exists())
- return TQString();
-
- TQFile f(url);
- if (!f.open(IO_ReadOnly))
- return TQString();
-
- TQDomDocument doc;
- if (!doc.setContent(&f) || (doc.doctype().name() != "tdeveloptoc"))
- return TQString();
- f.close();
-
- TQDomElement titleEl = doc.documentElement().namedItem("title").toElement();
-
- return titleEl.firstChild().toText().data();
-}
-
-
-TQStringList DocKDevTOCPlugin::fullTextSearchLocations()
-{
- return TQStringList();
-}
-
-bool DocKDevTOCPlugin::needRefreshIndex(DocumentationCatalogItem* /*item*/)
-{
- return false;
-}
-
-void DocKDevTOCPlugin::autoSetupPlugin()
-{
- TQStringList tocsDir = DocKDevTOCPluginFactory::instance()->dirs()->findAllResources("data", "kdevdocumentation/tocs/*.toc");
-
- for (TQStringList::const_iterator it = tocsDir.begin(); it != tocsDir.end(); ++it)
- {
- config->setGroup("Locations");
- config->writePathEntry(catalogTitle(*it), *it);
- }
-}
-
-void DocKDevTOCPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* item)
-{
- TOCDocumentationCatalogItem *tocItem = dynamic_cast(item);
- if (!tocItem)
- return;
-
- TQFileInfo fi(tocItem->tocFile());
-
- TQFile f(tocItem->tocFile());
- if (!f.open(IO_ReadOnly))
- {
- kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
- return;
- }
- TQDomDocument doc;
- if (!doc.setContent(&f) || doc.doctype().name() != "tdeveloptoc")
- {
- kdDebug(9002) << "Not a valid tdeveloptoc file: " << tocItem->tocFile() << endl;
- return;
- }
- f.close();
-
- TQDomElement docEl = doc.documentElement();
- TQDomElement baseEl = docEl.namedItem("base").toElement();
-
- TQString base;
- if (!baseEl.isNull())
- base = baseEl.attribute("href", TQString());
-
- TQDomElement indexEl = docEl.namedItem("index").toElement();
- TQDomElement childEl = indexEl.firstChild().toElement();
- while (!childEl.isNull())
- {
- if (childEl.tagName() == "entry")
- {
- TQString name = childEl.attribute("name");
- TQString url = childEl.attribute("url");
-
- IndexItemProto *ii = new IndexItemProto(this, item, index, name, item->text(0));
- ii->addURL(KURL(constructURL(base, url)));
- }
- childEl = childEl.nextSibling().toElement();
- }
-}
-
-void DocKDevTOCPlugin::createTOC(DocumentationCatalogItem* item)
-{
- TOCDocumentationCatalogItem *tocItem = dynamic_cast(item);
- if (!tocItem)
- return;
-
- TQFileInfo fi(tocItem->tocFile());
-
- TQFile f(tocItem->tocFile());
- if (!f.open(IO_ReadOnly))
- {
- kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
- return;
- }
- TQDomDocument doc;
- if (!doc.setContent(&f) || doc.doctype().name() != "tdeveloptoc")
- {
- kdDebug(9002) << "Not a valid tdeveloptoc file: " << tocItem->tocFile() << endl;
- return;
- }
- f.close();
-
- TQDomElement docEl = doc.documentElement();
- TQDomElement baseEl = docEl.namedItem("base").toElement();
-
- TQString base;
- if (!baseEl.isNull())
- base = baseEl.attribute("href", TQString());
-
- TQDomElement childEl = docEl.lastChild().toElement();
- addTocSect(tocItem, childEl, base, 1);
-}
-
-void DocKDevTOCPlugin::addTocSect(DocumentationItem *parent, TQDomElement childEl, const TQString &base, uint level)
-{
- while (!childEl.isNull())
- {
- if (childEl.tagName() == TQString("tocsect%1").arg(level))
- {
- TQString name = childEl.attribute("name");
- TQString url = childEl.attribute("url");
-
- DocumentationItem *item = new DocumentationItem(level == 1 ? DocumentationItem::Book : DocumentationItem::Document, parent, name);
- item->setURL(KURL(constructURL(base, url)));
-
- TQDomElement grandchildEl = childEl.lastChild().toElement();
- addTocSect(item, grandchildEl, base, level+1);
- }
- childEl = childEl.previousSibling().toElement();
- }
-}
-
-void DocKDevTOCPlugin::setCatalogURL(DocumentationCatalogItem* item)
-{
- TOCDocumentationCatalogItem *tocItem = dynamic_cast(item);
- if (!tocItem)
- return;
-
- TQFileInfo fi(tocItem->tocFile());
-
- TQFile f(tocItem->tocFile());
- if (!f.open(IO_ReadOnly))
- {
- kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
- return;
- }
- TQDomDocument doc;
- if (!doc.setContent(&f) || doc.doctype().name() != "tdeveloptoc")
- {
- kdDebug(9002) << "Not a valid tdeveloptoc file: " << tocItem->tocFile() << endl;
- return;
- }
- f.close();
-
- TQDomElement docEl = doc.documentElement();
- TQDomElement baseEl = docEl.namedItem("base").toElement();
-
- if (item->url().isEmpty())
- {
- if (baseEl.isNull())
- item->setURL(KURL());
- else
- item->setURL(KURL(constructURL(baseEl.attribute("href", TQString()),
- baseEl.attribute("url", TQString()))));
- }
-}
-
-TQString DocKDevTOCPlugin::constructURL(const TQString &base, const TQString &url)
-{
- if (base.isEmpty() && !url.isEmpty())
- return url;
- if (!url.isEmpty())
- return base.endsWith("/") ? base + url : base + "/" + url;
- else
- return base;
-}
-
-#include "dockdevtocplugin.moc"
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop
deleted file mode 100644
index 1cae3582..00000000
--- a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop
+++ /dev/null
@@ -1,43 +0,0 @@
-[Desktop Entry]
-Type=Service
-Name=DocKDevTOCPlugin
-Name[da]=DocKDevTOC-plugin
-Name[sk]=Doc KDevTOC modul
-Name[sv]=TDevelop innehållsförteckning-dokumentationsinsticksmodul
-Name[ta]=DocKDevTOC சொருகு
-Name[zh_TW]=TDevelop 目錄文件外掛程式
-Exec=blubb
-Comment=Documentation plugin for TDevelopTOC documentation
-Comment[ca]=Connector de documentació per a documentació TDevelopTOC
-Comment[da]=Dokumentations-plugin for TDevelopTOC-dokumentation
-Comment[de]=Komponente für TDevelopTOC-Dokumentation
-Comment[el]=Πρόσθετο τεκμηρίωσης για τεκμηρίωση τύπου TDevelopTOC
-Comment[es]=Complemento de documentación para TDevelopTOC
-Comment[et]=TDevelopTOC dokumentatsiooni plugin
-Comment[eu]=TDevelopTOC dokumentaziorako dokumentazio plugin-a
-Comment[fa]=وصلۀ مستندسازی برای مستندات TDevelopTOC
-Comment[fr]=Module externe de documentation pour la documentation TDevelopTOC
-Comment[gl]=Extensión de documentación para documentación TDevelopTOC
-Comment[hu]=Dokumentációmodul TDevelopTOC-dokumentációhoz
-Comment[it]=Plugin di documentazione per file di TDevelopTOC
-Comment[ja]=TDevelopTOC ドキュメンテーションのためのドキュメンテーションプラグイン
-Comment[ms]=Plugin dokumentasi untuk dokumentasi TDevelopTOC
-Comment[nds]=Dokmentatschoon-Moduul för TDevelopTOC-Dokmentatschoon
-Comment[ne]=TDevelopTOC मिसिलीकरणका लागि मिसिलीकरण प्लगइन
-Comment[nl]=Documentatie plugin for TDevelopTOC documentatie
-Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie TDevelopTOC
-Comment[pt]='Plugin' para documentação TDevelopTOC
-Comment[pt_BR]=Plug-in de documentação para document TOC do TDevelop
-Comment[ru]=Модуль для просмотра TDevelopTOC
-Comment[sk]=Dokumentačný modul pre TDevelopTOC dokumentáciu
-Comment[sr]=Документациони прикључак за TDevelopTOC документацију
-Comment[sr@Latn]=Dokumentacioni priključak za TDevelopTOC dokumentaciju
-Comment[sv]=Dokumentationsinsticksmodul för TDevelop innehållsförteckningsdokumentation
-Comment[ta]= TDevelopTOC ஆவணத்திற்கான ஆவணச் சொருகு
-Comment[tg]=Модул барои наоиши TDevelopTOC
-Comment[tr]=TDevelopTOC belgelendirmesi için belgelendirme eklentisi
-Comment[zh_CN]=TDevelopTOC 文档的文档插件
-Comment[zh_TW]=TDevelop 目錄文件外掛程式
-ServiceTypes=TDevelop/DocumentationPlugins
-X-TDevelop-Version=5
-X-TDE-Library=libdockdevtocplugin
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.h b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.h
deleted file mode 100644
index 7205cc4c..00000000
--- a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2004 by Alexander Dymo *
- * cloudtemple@mksat.net *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-#ifndef DOCKDEVTOCPLUGIN_H
-#define DOCKDEVTOCPLUGIN_H
-
-#include
-
-#include
-
-class DocKDevTOCPlugin : public DocumentationPlugin
-{
- Q_OBJECT
-
-public:
- DocKDevTOCPlugin(TQObject* parent, const char* name, const TQStringList args = TQStringList());
- ~DocKDevTOCPlugin();
-
- virtual TQString pluginName() const;
-
- virtual TQString catalogTitle(const TQString& url);
- virtual DocumentationCatalogItem* createCatalog(TDEListView* contents, const TQString& title, const TQString& url);
- virtual void createTOC(DocumentationCatalogItem* item);
- virtual void setCatalogURL(DocumentationCatalogItem* item);
-
- virtual bool needRefreshIndex(DocumentationCatalogItem* item);
- virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
-
- virtual TQStringList fullTextSearchLocations();
-
- virtual TQPair catalogLocatorProps();
- virtual void autoSetupPlugin();
-
-protected:
- void addTocSect(DocumentationItem *parent, TQDomElement childEl, const TQString &base, uint level);
- static TQString constructURL(const TQString &base, const TQString &url) ;
-};
-
-#endif
diff --git a/parts/documentation/plugins/pdb/docpdbplugin.cpp b/parts/documentation/plugins/pdb/docpdbplugin.cpp
index fc647d34..b0ebd29d 100644
--- a/parts/documentation/plugins/pdb/docpdbplugin.cpp
+++ b/parts/documentation/plugins/pdb/docpdbplugin.cpp
@@ -25,10 +25,10 @@
#include
#include
-#include
+#include
static const TDEAboutData data("docpdbplugin", I18N_NOOP("PalmDoc documentation plugin"), "1.0");
-typedef KDevGenericFactory DocPDBPluginFactory;
+typedef TDevGenericFactory DocPDBPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocpdbplugin, DocPDBPluginFactory(&data) )
DocPDBPlugin::DocPDBPlugin(TQObject* parent, const char* name, const TQStringList args)
diff --git a/parts/documentation/plugins/pdb/docpdbplugin.h b/parts/documentation/plugins/pdb/docpdbplugin.h
index 40dd3a15..d1319012 100644
--- a/parts/documentation/plugins/pdb/docpdbplugin.h
+++ b/parts/documentation/plugins/pdb/docpdbplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCPDBPLUGIN_H
#define DOCPDBPLUGIN_H
-#include
+#include
class DocPDBPlugin : public DocumentationPlugin {
public:
diff --git a/parts/documentation/plugins/pdf/docpdfplugin.cpp b/parts/documentation/plugins/pdf/docpdfplugin.cpp
index 65bddd1b..322a33d3 100644
--- a/parts/documentation/plugins/pdf/docpdfplugin.cpp
+++ b/parts/documentation/plugins/pdf/docpdfplugin.cpp
@@ -25,10 +25,10 @@
#include
#include
-#include
+#include
static const TDEAboutData data("docpdfplugin", I18N_NOOP("PDF documentation plugin"), "1.0");
-typedef KDevGenericFactory DocPDFPluginFactory;
+typedef TDevGenericFactory DocPDFPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocpdfplugin, DocPDFPluginFactory(&data) )
DocPDFPlugin::DocPDFPlugin(TQObject* parent, const char* name, const TQStringList args)
diff --git a/parts/documentation/plugins/pdf/docpdfplugin.h b/parts/documentation/plugins/pdf/docpdfplugin.h
index d5ecc7eb..a5410196 100644
--- a/parts/documentation/plugins/pdf/docpdfplugin.h
+++ b/parts/documentation/plugins/pdf/docpdfplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCPDFPLUGIN_H
#define DOCPDFPLUGIN_H
-#include
+#include
class DocPDFPlugin : public DocumentationPlugin {
public:
diff --git a/parts/documentation/plugins/qt/docqtplugin.cpp b/parts/documentation/plugins/qt/docqtplugin.cpp
index 10271524..301859ca 100644
--- a/parts/documentation/plugins/qt/docqtplugin.cpp
+++ b/parts/documentation/plugins/qt/docqtplugin.cpp
@@ -32,8 +32,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include "../../../../config.h"
@@ -56,8 +56,8 @@ private:
TQString m_dcfFile;
};
-static const KDevPluginInfo data("docqtplugin");
-typedef KDevGenericFactory DocQtPluginFactory;
+static const TDevPluginInfo data("docqtplugin");
+typedef TDevGenericFactory DocQtPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdocqtplugin, DocQtPluginFactory(data) )
DocQtPlugin::DocQtPlugin(TQObject* parent, const char* name, const TQStringList)
diff --git a/parts/documentation/plugins/qt/docqtplugin.h b/parts/documentation/plugins/qt/docqtplugin.h
index 8eac8456..964ef844 100644
--- a/parts/documentation/plugins/qt/docqtplugin.h
+++ b/parts/documentation/plugins/qt/docqtplugin.h
@@ -20,7 +20,7 @@
#ifndef DOCTQTPLUGIN_H
#define DOCTQTPLUGIN_H
-#include
+#include
#include
class TDEConfig;
diff --git a/parts/documentation/plugins/tdevtoc/CMakeLists.txt b/parts/documentation/plugins/tdevtoc/CMakeLists.txt
new file mode 100644
index 00000000..f3d1efc2
--- /dev/null
+++ b/parts/documentation/plugins/tdevtoc/CMakeLists.txt
@@ -0,0 +1,39 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_definitions( ${KDE_PLUGIN} )
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/lib/interfaces
+ ${CMAKE_SOURCE_DIR}/lib/util
+ ${CMAKE_SOURCE_DIR}/parts/documentation/interfaces
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES doctdevtocplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+
+
+##### libdoctdevtocplugin (module) ##############
+
+tde_add_kpart( libdoctdevtocplugin AUTOMOC
+ SOURCES doctdevtocplugin.cpp
+ LINK documentation_interfaces-shared tdevelop-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/parts/documentation/plugins/tdevtoc/Makefile.am b/parts/documentation/plugins/tdevtoc/Makefile.am
new file mode 100644
index 00000000..4baaaa86
--- /dev/null
+++ b/parts/documentation/plugins/tdevtoc/Makefile.am
@@ -0,0 +1,10 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdoctdevtocplugin.la
+libdoctdevtocplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+kde_services_DATA = doctdevtocplugin.desktop
+noinst_HEADERS = doctdevtocplugin.h
+libdoctdevtocplugin_la_SOURCES = doctdevtocplugin.cpp
+libdoctdevtocplugin_la_LIBADD = $(top_builddir)/lib/libtdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/tdevtoc/doctdevtocplugin.cpp b/parts/documentation/plugins/tdevtoc/doctdevtocplugin.cpp
new file mode 100644
index 00000000..aa603fbd
--- /dev/null
+++ b/parts/documentation/plugins/tdevtoc/doctdevtocplugin.cpp
@@ -0,0 +1,277 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#include "doctdevtocplugin.h"
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include