From 722ce1efbac31c61b1d4b13f7e075c9f311e3e73 Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Sun, 2 Mar 2014 20:05:33 +0100 Subject: Finish renaming tdevelop components --- parts/documentation/CMakeLists.txt | 12 +- parts/documentation/KDevDocumentationIface.cpp | 83 --- parts/documentation/KDevDocumentationIface.h | 53 -- parts/documentation/Makefile.am | 18 +- parts/documentation/TDevDocumentationIface.cpp | 83 +++ parts/documentation/TDevDocumentationIface.h | 53 ++ parts/documentation/addcatalogdlg.cpp | 2 +- parts/documentation/bookmarkview.cpp | 6 +- parts/documentation/contentsview.cpp | 4 +- parts/documentation/data/CMakeLists.txt | 4 +- parts/documentation/data/Makefile.am | 4 +- parts/documentation/data/nomatch.html | 4 +- parts/documentation/data/syntax.html | 4 +- parts/documentation/data/wrapper.html | 6 +- parts/documentation/docconfiglistview.cpp | 2 +- parts/documentation/docglobalconfigwidget.cpp | 12 +- parts/documentation/docprojectconfigwidget.cpp | 10 +- parts/documentation/documentation_part.cpp | 111 ++-- parts/documentation/documentation_part.h | 9 +- parts/documentation/documentation_widget.cpp | 4 +- parts/documentation/documentation_widget.h | 2 +- parts/documentation/docutils.cpp | 4 +- parts/documentation/editcatalogdlg.cpp | 2 +- parts/documentation/find_documentation.cpp | 4 +- parts/documentation/indexview.cpp | 4 +- parts/documentation/interfaces/CMakeLists.txt | 4 +- parts/documentation/interfaces/Makefile.am | 10 +- .../interfaces/kdevdocumentationplugin.cpp | 721 --------------------- .../interfaces/kdevdocumentationplugin.h | 423 ------------ .../interfaces/tdevdocumentationplugin.cpp | 721 +++++++++++++++++++++ .../interfaces/tdevdocumentationplugin.h | 423 ++++++++++++ parts/documentation/kdevdocumentation.desktop | 82 --- parts/documentation/kdevpart_documentation.rc | 19 - parts/documentation/plugins/CMakeLists.txt | 2 +- parts/documentation/plugins/Makefile.am | 2 +- parts/documentation/plugins/chm/docchmplugin.cpp | 8 +- parts/documentation/plugins/chm/docchmplugin.h | 2 +- .../plugins/custom/doccustomplugin.cpp | 8 +- .../documentation/plugins/custom/doccustomplugin.h | 2 +- .../plugins/devhelp/docdevhelpplugin.cpp | 8 +- .../plugins/devhelp/docdevhelpplugin.h | 2 +- parts/documentation/plugins/djvu/docdjvuplugin.cpp | 4 +- parts/documentation/plugins/djvu/docdjvuplugin.h | 2 +- .../plugins/doxygen/docdoxygenplugin.cpp | 8 +- .../plugins/doxygen/docdoxygenplugin.h | 2 +- parts/documentation/plugins/kdevtoc/CMakeLists.txt | 39 -- parts/documentation/plugins/kdevtoc/Makefile.am | 10 - .../plugins/kdevtoc/dockdevtocplugin.cpp | 277 -------- .../plugins/kdevtoc/dockdevtocplugin.desktop | 43 -- .../plugins/kdevtoc/dockdevtocplugin.h | 55 -- parts/documentation/plugins/pdb/docpdbplugin.cpp | 4 +- parts/documentation/plugins/pdb/docpdbplugin.h | 2 +- parts/documentation/plugins/pdf/docpdfplugin.cpp | 4 +- parts/documentation/plugins/pdf/docpdfplugin.h | 2 +- parts/documentation/plugins/qt/docqtplugin.cpp | 8 +- parts/documentation/plugins/qt/docqtplugin.h | 2 +- parts/documentation/plugins/tdevtoc/CMakeLists.txt | 39 ++ parts/documentation/plugins/tdevtoc/Makefile.am | 10 + .../plugins/tdevtoc/doctdevtocplugin.cpp | 277 ++++++++ .../plugins/tdevtoc/doctdevtocplugin.desktop | 43 ++ .../plugins/tdevtoc/doctdevtocplugin.h | 55 ++ parts/documentation/protocols/chm/CMakeLists.txt | 2 +- parts/documentation/protocols/chm/Makefile.am | 2 +- parts/documentation/protocols/chm/kchmpart.cpp | 4 +- parts/documentation/protocols/chm/kchmpart.h | 4 +- parts/documentation/searchview.cpp | 10 +- parts/documentation/selecttopic.h | 2 +- parts/documentation/tdevdocumentation.desktop | 82 +++ parts/documentation/tdevpart_documentation.rc | 20 + parts/documentation/tools/htdig/htdigindex.cpp | 20 +- 70 files changed, 1991 insertions(+), 1978 deletions(-) delete mode 100644 parts/documentation/KDevDocumentationIface.cpp delete mode 100644 parts/documentation/KDevDocumentationIface.h create mode 100644 parts/documentation/TDevDocumentationIface.cpp create mode 100644 parts/documentation/TDevDocumentationIface.h delete mode 100644 parts/documentation/interfaces/kdevdocumentationplugin.cpp delete mode 100644 parts/documentation/interfaces/kdevdocumentationplugin.h create mode 100644 parts/documentation/interfaces/tdevdocumentationplugin.cpp create mode 100644 parts/documentation/interfaces/tdevdocumentationplugin.h delete mode 100644 parts/documentation/kdevdocumentation.desktop delete mode 100644 parts/documentation/kdevpart_documentation.rc delete mode 100644 parts/documentation/plugins/kdevtoc/CMakeLists.txt delete mode 100644 parts/documentation/plugins/kdevtoc/Makefile.am delete mode 100644 parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp delete mode 100644 parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop delete mode 100644 parts/documentation/plugins/kdevtoc/dockdevtocplugin.h create mode 100644 parts/documentation/plugins/tdevtoc/CMakeLists.txt create mode 100644 parts/documentation/plugins/tdevtoc/Makefile.am create mode 100644 parts/documentation/plugins/tdevtoc/doctdevtocplugin.cpp create mode 100644 parts/documentation/plugins/tdevtoc/doctdevtocplugin.desktop create mode 100644 parts/documentation/plugins/tdevtoc/doctdevtocplugin.h create mode 100644 parts/documentation/tdevdocumentation.desktop create mode 100644 parts/documentation/tdevpart_documentation.rc (limited to 'parts/documentation') diff --git a/parts/documentation/CMakeLists.txt b/parts/documentation/CMakeLists.txt index accc3401..4b13b342 100644 --- a/parts/documentation/CMakeLists.txt +++ b/parts/documentation/CMakeLists.txt @@ -33,13 +33,13 @@ link_directories( ##### other data ################################ -install( FILES kdevdocumentation.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kdevpart_documentation.rc DESTINATION ${DATA_INSTALL_DIR}/kdevdocumentation ) +install( FILES tdevdocumentation.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) +install( FILES tdevpart_documentation.rc DESTINATION ${DATA_INSTALL_DIR}/tdevdocumentation ) -##### libkdevdocumentation (module) ############# +##### libtdevdocumentation (module) ############# -tde_add_kpart( libkdevdocumentation AUTOMOC +tde_add_kpart( libtdevdocumentation AUTOMOC SOURCES documentation_part.cpp documentation_widget.cpp contentsview.cpp indexview.cpp docglobalconfigwidgetbase.ui @@ -50,8 +50,8 @@ tde_add_kpart( libkdevdocumentation AUTOMOC find_documentation.cpp find_documentation_optionsbase.ui find_documentation_options.cpp selecttopicbase.ui selecttopic.cpp docprojectconfigwidgetbase.ui - docprojectconfigwidget.cpp KDevDocumentationIface.cpp - KDevDocumentationIface.skel addcatalogdlgbase.ui + docprojectconfigwidget.cpp TDevDocumentationIface.cpp + TDevDocumentationIface.skel addcatalogdlgbase.ui addcatalogdlg.cpp LINK documentation_interfaces-shared tdevelop-shared tdehtml-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/parts/documentation/KDevDocumentationIface.cpp b/parts/documentation/KDevDocumentationIface.cpp deleted file mode 100644 index 329b8474..00000000 --- a/parts/documentation/KDevDocumentationIface.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Alexander Dymo * - * adymo@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 "KDevDocumentationIface.h" - -#include "documentation_part.h" - -KDevDocumentationIface::KDevDocumentationIface(DocumentationPart *part) - :TQObject(part), DCOPObject("KDevDocumentation"), m_part(part) -{ -} - -KDevDocumentationIface::~KDevDocumentationIface() -{ -} - -void KDevDocumentationIface::lookupInIndex(TQString term) -{ - m_part->lookInDocumentationIndex(term); -} - -void KDevDocumentationIface::findInFinder(TQString term) -{ - m_part->findInDocumentation(term); -} - -void KDevDocumentationIface::searchInDocumentation(TQString term) -{ - m_part->searchInDocumentation(term); -} - -void KDevDocumentationIface::lookupInIndex() -{ - m_part->lookInDocumentationIndex(); -} - -void KDevDocumentationIface::searchInDocumentation() -{ - m_part->searchInDocumentation(); -} - -void KDevDocumentationIface::manPage(TQString term) -{ - m_part->manPage(term); -} - -void KDevDocumentationIface::infoPage(TQString term) -{ - m_part->infoPage(term); -} - -void KDevDocumentationIface::manPage() -{ - m_part->manPage(); -} - -void KDevDocumentationIface::infoPage() -{ - m_part->infoPage(); -} - -void KDevDocumentationIface::findInFinder( ) -{ - m_part->findInDocumentation(); -} - -#include "KDevDocumentationIface.moc" diff --git a/parts/documentation/KDevDocumentationIface.h b/parts/documentation/KDevDocumentationIface.h deleted file mode 100644 index c55143e7..00000000 --- a/parts/documentation/KDevDocumentationIface.h +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004 by Alexander Dymo * - * adymo@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 KDEVDOCUMENTATIONIFACE_H -#define KDEVDOCUMENTATIONIFACE_H - -#include -#include - -class DocumentationPart; - -class KDevDocumentationIface : public TQObject, public DCOPObject { - Q_OBJECT -// - K_DCOP -public: - KDevDocumentationIface(DocumentationPart *part); - ~KDevDocumentationIface(); - -k_dcop: - void lookupInIndex(TQString term); - void findInFinder(TQString term); - void searchInDocumentation(TQString term); - void manPage(TQString term); - void infoPage(TQString term); - - void lookupInIndex(); - void findInFinder(); - void searchInDocumentation(); - void manPage(); - void infoPage(); - -private: - DocumentationPart *m_part; -}; - -#endif diff --git a/parts/documentation/Makefile.am b/parts/documentation/Makefile.am index 13c4db3f..118c8041 100644 --- a/parts/documentation/Makefile.am +++ b/parts/documentation/Makefile.am @@ -1,31 +1,31 @@ INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes) -kde_module_LTLIBRARIES = libkdevdocumentation.la -libkdevdocumentation_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -libkdevdocumentation_la_LIBADD = $(top_builddir)/lib/libtdevelop.la \ +kde_module_LTLIBRARIES = libtdevdocumentation.la +libtdevdocumentation_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libtdevdocumentation_la_LIBADD = $(top_builddir)/lib/libtdevelop.la \ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la $(LIB_TDEHTML) -libkdevdocumentation_la_SOURCES = documentation_part.cpp \ +libtdevdocumentation_la_SOURCES = documentation_part.cpp \ documentation_widget.cpp contentsview.cpp indexview.cpp docglobalconfigwidgetbase.ui \ docglobalconfigwidget.cpp docconfiglistview.cpp editcatalogdlgbase.ui editcatalogdlg.cpp \ docutils.cpp searchview.cpp bookmarkview.cpp editbookmarkdlg.ui \ find_documentationbase.ui find_documentation.cpp find_documentation_optionsbase.ui \ find_documentation_options.cpp selecttopicbase.ui selecttopic.cpp docprojectconfigwidgetbase.ui \ - docprojectconfigwidget.cpp KDevDocumentationIface.cpp KDevDocumentationIface.skel \ + docprojectconfigwidget.cpp TDevDocumentationIface.cpp TDevDocumentationIface.skel \ addcatalogdlgbase.ui addcatalogdlg.cpp METASOURCES = AUTO servicedir = $(kde_servicesdir) -service_DATA = kdevdocumentation.desktop +service_DATA = tdevdocumentation.desktop -rcdir = $(kde_datadir)/kdevdocumentation -rc_DATA = kdevpart_documentation.rc +rcdir = $(kde_datadir)/tdevdocumentation +rc_DATA = tdevpart_documentation.rc noinst_HEADERS = contentsview.h indexview.h docglobalconfigwidget.h \ docconfiglistview.h editcatalogdlg.h docutils.h searchview.h bookmarkview.h selecttopic.h \ - docprojectconfigwidget.h KDevDocumentationIface.h addcatalogdlg.h + docprojectconfigwidget.h TDevDocumentationIface.h addcatalogdlg.h SUBDIRS = interfaces plugins tools data protocols DOXYGEN_EMPTY = YES diff --git a/parts/documentation/TDevDocumentationIface.cpp b/parts/documentation/TDevDocumentationIface.cpp new file mode 100644 index 00000000..0441eb4a --- /dev/null +++ b/parts/documentation/TDevDocumentationIface.cpp @@ -0,0 +1,83 @@ +/*************************************************************************** + * Copyright (C) 2004 by Alexander Dymo * + * adymo@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 "TDevDocumentationIface.h" + +#include "documentation_part.h" + +TDevDocumentationIface::TDevDocumentationIface(DocumentationPart *part) + :TQObject(part), DCOPObject("TDevDocumentation"), m_part(part) +{ +} + +TDevDocumentationIface::~TDevDocumentationIface() +{ +} + +void TDevDocumentationIface::lookupInIndex(TQString term) +{ + m_part->lookInDocumentationIndex(term); +} + +void TDevDocumentationIface::findInFinder(TQString term) +{ + m_part->findInDocumentation(term); +} + +void TDevDocumentationIface::searchInDocumentation(TQString term) +{ + m_part->searchInDocumentation(term); +} + +void TDevDocumentationIface::lookupInIndex() +{ + m_part->lookInDocumentationIndex(); +} + +void TDevDocumentationIface::searchInDocumentation() +{ + m_part->searchInDocumentation(); +} + +void TDevDocumentationIface::manPage(TQString term) +{ + m_part->manPage(term); +} + +void TDevDocumentationIface::infoPage(TQString term) +{ + m_part->infoPage(term); +} + +void TDevDocumentationIface::manPage() +{ + m_part->manPage(); +} + +void TDevDocumentationIface::infoPage() +{ + m_part->infoPage(); +} + +void TDevDocumentationIface::findInFinder( ) +{ + m_part->findInDocumentation(); +} + +#include "TDevDocumentationIface.moc" diff --git a/parts/documentation/TDevDocumentationIface.h b/parts/documentation/TDevDocumentationIface.h new file mode 100644 index 00000000..565070f3 --- /dev/null +++ b/parts/documentation/TDevDocumentationIface.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 2004 by Alexander Dymo * + * adymo@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 TDEVDOCUMENTATIONIFACE_H +#define TDEVDOCUMENTATIONIFACE_H + +#include +#include + +class DocumentationPart; + +class TDevDocumentationIface : public TQObject, public DCOPObject { + Q_OBJECT +// + K_DCOP +public: + TDevDocumentationIface(DocumentationPart *part); + ~TDevDocumentationIface(); + +k_dcop: + void lookupInIndex(TQString term); + void findInFinder(TQString term); + void searchInDocumentation(TQString term); + void manPage(TQString term); + void infoPage(TQString term); + + void lookupInIndex(); + void findInFinder(); + void searchInDocumentation(); + void manPage(); + void infoPage(); + +private: + DocumentationPart *m_part; +}; + +#endif diff --git a/parts/documentation/addcatalogdlg.cpp b/parts/documentation/addcatalogdlg.cpp index 21913089..51e6fe96 100644 --- a/parts/documentation/addcatalogdlg.cpp +++ b/parts/documentation/addcatalogdlg.cpp @@ -29,7 +29,7 @@ #include #include "docutils.h" -#include "kdevdocumentationplugin.h" +#include "tdevdocumentationplugin.h" AddCatalogDlg::AddCatalogDlg( TQValueList const & plugins, TQWidget* parent, const char* name, bool modal, WFlags fl) diff --git a/parts/documentation/bookmarkview.cpp b/parts/documentation/bookmarkview.cpp index f626e246..9e6f85df 100644 --- a/parts/documentation/bookmarkview.cpp +++ b/parts/documentation/bookmarkview.cpp @@ -34,8 +34,8 @@ #include #include -#include -#include +#include +#include #include "documentation_part.h" #include "documentation_widget.h" @@ -44,7 +44,7 @@ DocBookmarkManager::DocBookmarkManager(DocumentationPart */*part*/) :KBookmarkManager(locateLocal("data", - "kdevdocumentation/bookmarks/bookmarks.xml"), false) + "tdevdocumentation/bookmarks/bookmarks.xml"), false) { setEditorOptions(i18n("Documentation"), false); } diff --git a/parts/documentation/contentsview.cpp b/parts/documentation/contentsview.cpp index 532feefd..ff3c9a31 100644 --- a/parts/documentation/contentsview.cpp +++ b/parts/documentation/contentsview.cpp @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include "documentation_widget.h" #include "documentation_part.h" diff --git a/parts/documentation/data/CMakeLists.txt b/parts/documentation/data/CMakeLists.txt index 77d380d4..5bb6d766 100644 --- a/parts/documentation/data/CMakeLists.txt +++ b/parts/documentation/data/CMakeLists.txt @@ -11,8 +11,8 @@ install( FILES long.html nomatch.html short.html syntax.html wrapper.html - DESTINATION ${DATA_INSTALL_DIR}/kdevdocumentation/en ) + DESTINATION ${DATA_INSTALL_DIR}/tdevdocumentation/en ) install( FILES checked.xpm htdig.png star.png star_blank.png unchecked.xpm - DESTINATION ${DATA_INSTALL_DIR}/kdevdocumentation/pics ) + DESTINATION ${DATA_INSTALL_DIR}/tdevdocumentation/pics ) diff --git a/parts/documentation/data/Makefile.am b/parts/documentation/data/Makefile.am index 920c492a..ae52bf11 100644 --- a/parts/documentation/data/Makefile.am +++ b/parts/documentation/data/Makefile.am @@ -1,6 +1,6 @@ INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes) METASOURCES = AUTO -htmldir = $(kde_datadir)/kdevdocumentation/en -picsdir = $(kde_datadir)/kdevdocumentation/pics +htmldir = $(kde_datadir)/tdevdocumentation/en +picsdir = $(kde_datadir)/tdevdocumentation/pics html_DATA = long.html nomatch.html short.html syntax.html wrapper.html pics_DATA = checked.xpm htdig.png star.png star_blank.png unchecked.xpm diff --git a/parts/documentation/data/nomatch.html b/parts/documentation/data/nomatch.html index 8951a604..5cbd5c49 100644 --- a/parts/documentation/data/nomatch.html +++ b/parts/documentation/data/nomatch.html @@ -1,6 +1,6 @@ No match for '$&(LOGICAL_WORDS)' -

+

Search results


No matches were found for '$&(LOGICAL_WORDS)'

@@ -17,5 +17,5 @@ word with "All," try using one or more of the same words with "Any."


-ht://Dig $(VERSION) +ht://Dig $(VERSION) diff --git a/parts/documentation/data/syntax.html b/parts/documentation/data/syntax.html index 9701c37f..21a2ab2a 100644 --- a/parts/documentation/data/syntax.html +++ b/parts/documentation/data/syntax.html @@ -1,6 +1,6 @@ Error in Boolean search for '$&(WORDS)' -

+

Error in Boolean search for '$&(LOGICAL_WORDS)'


Boolean expressions need to be 'correct' in order for the search @@ -14,6 +14,6 @@ $(SYNTAXERROR)
-ht://Dig $(VERSION) +ht://Dig $(VERSION) diff --git a/parts/documentation/data/wrapper.html b/parts/documentation/data/wrapper.html index 20c1bbf2..187ffd61 100644 --- a/parts/documentation/data/wrapper.html +++ b/parts/documentation/data/wrapper.html @@ -1,10 +1,10 @@ Search results for '$&(WORDS)' -

+

Search results for '$&(LOGICAL_WORDS)'


-More *'s indicate a better match. +More *'s indicate a better match.
$(HTSEARCH_RESULTS) @@ -12,5 +12,5 @@ $(PAGEHEADER) $(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
-ht://Dig $(VERSION) +ht://Dig $(VERSION) diff --git a/parts/documentation/docconfiglistview.cpp b/parts/documentation/docconfiglistview.cpp index d2753653..ba6f30fb 100644 --- a/parts/documentation/docconfiglistview.cpp +++ b/parts/documentation/docconfiglistview.cpp @@ -21,7 +21,7 @@ #include -#include "kdevdocumentationplugin.h" +#include "tdevdocumentationplugin.h" DocConfigListView::DocConfigListView(TQWidget *parent, const char *name) :TDEListView(parent, name) diff --git a/parts/documentation/docglobalconfigwidget.cpp b/parts/documentation/docglobalconfigwidget.cpp index cb6c3776..5f66ef4a 100644 --- a/parts/documentation/docglobalconfigwidget.cpp +++ b/parts/documentation/docglobalconfigwidget.cpp @@ -38,8 +38,8 @@ #include #include -#include "kdevdocumentationplugin.h" -#include "kdevpartcontroller.h" +#include "tdevdocumentationplugin.h" +#include "tdevpartcontroller.h" #include "docconfiglistview.h" #include "documentation_part.h" @@ -67,7 +67,7 @@ DocGlobalConfigWidget::DocGlobalConfigWidget(DocumentationPart *part, //read full text search settings config->setGroup("htdig"); TQString databaseDir = kapp->dirs()->saveLocation("data", - "kdevdocumentation/search"); + "tdevdocumentation/search"); databaseDirEdit->setURL(config->readPathEntry("databaseDir", databaseDir)); htdigbinEdit->setURL(config->readPathEntry("htdigbin", kapp->dirs()->findExe("htdig"))); htmergebinEdit->setURL(config->readPathEntry("htmergebin", kapp->dirs()->findExe("htmerge"))); @@ -99,8 +99,8 @@ DocGlobalConfigWidget::DocGlobalConfigWidget(DocumentationPart *part, useAssistant_box->setChecked(m_part->isAssistantUsed()); - // Having app-specific settings isn't pretty, but this setting is nonsensical in kdevassistant - if ( kapp->instanceName().find("kdevassistant") != -1 ) + // Having app-specific settings isn't pretty, but this setting is nonsensical in tdevassistant + if ( kapp->instanceName().find("tdevassistant") != -1 ) useAssistant_box->hide(); //font sizes and zoom levels @@ -182,7 +182,7 @@ void DocGlobalConfigWidget::accept() config->writePathEntry("htsearchbin", DocUtils::envURL(htsearchbinEdit)); //write full text search locations file - TQString ftsLocationsFile = locateLocal("data", "kdevdocumentation/search/locations.txt"); + TQString ftsLocationsFile = locateLocal("data", "tdevdocumentation/search/locations.txt"); TQFile f(ftsLocationsFile); TQStringList locs; if (f.open(IO_ReadWrite | IO_Truncate)) diff --git a/parts/documentation/docprojectconfigwidget.cpp b/parts/documentation/docprojectconfigwidget.cpp index a37ad5cb..1d6678d7 100644 --- a/parts/documentation/docprojectconfigwidget.cpp +++ b/parts/documentation/docprojectconfigwidget.cpp @@ -27,8 +27,8 @@ #include "domutil.h" #include "urlutil.h" -#include "kdevproject.h" -#include "kdevdocumentationplugin.h" +#include "tdevproject.h" +#include "tdevdocumentationplugin.h" #include "documentation_part.h" #include "documentation_widget.h" @@ -45,7 +45,7 @@ DocProjectConfigWidget::DocProjectConfigWidget(DocumentationPart *part, TQWidget m_plugins[(*it)->pluginName()] = *it; } } - TQString projectDocSystem = DomUtil::readEntry(*(m_part->projectDom()), "/kdevdocumentation/projectdoc/docsystem"); + TQString projectDocSystem = DomUtil::readEntry(*(m_part->projectDom()), "/tdevdocumentation/projectdoc/docsystem"); bool hasProjectDoc = false; for (int i = 0; i < docSystemCombo->count(); ++i) @@ -64,7 +64,7 @@ DocProjectConfigWidget::DocProjectConfigWidget(DocumentationPart *part, TQWidget changeDocSystem(docSystemCombo->currentText()); } - manualURL->setURL(DomUtil::readEntry(*(m_part->projectDom()), "/kdevdocumentation/projectdoc/usermanualurl")); + manualURL->setURL(DomUtil::readEntry(*(m_part->projectDom()), "/tdevdocumentation/projectdoc/usermanualurl")); } void DocProjectConfigWidget::changeDocSystem(const TQString &text) @@ -79,7 +79,7 @@ void DocProjectConfigWidget::changeDocSystem(const TQString &text) catalogURL->setMode(plugin->catalogLocatorProps().first); catalogURL->setFilter(plugin->catalogLocatorProps().second); - TQString projectDocURL = DomUtil::readEntry(*(m_part->projectDom()), "/kdevdocumentation/projectdoc/docurl"); + TQString projectDocURL = DomUtil::readEntry(*(m_part->projectDom()), "/tdevdocumentation/projectdoc/docurl"); if (!projectDocURL.isEmpty()) projectDocURL = TQDir::cleanDirPath(m_part->project()->projectDirectory() + "/" + projectDocURL); diff --git a/parts/documentation/documentation_part.cpp b/parts/documentation/documentation_part.cpp index 75bb7c13..9515fad7 100644 --- a/parts/documentation/documentation_part.cpp +++ b/parts/documentation/documentation_part.cpp @@ -48,17 +48,17 @@ #include #include -#include "kdevplugininfo.h" -#include "kdevcore.h" -#include "kdevproject.h" -#include "kdevmainwindow.h" -#include "kdevgenericfactory.h" -#include "kdevdocumentationplugin.h" +#include "tdevplugininfo.h" +#include "tdevcore.h" +#include "tdevproject.h" +#include "tdevmainwindow.h" +#include "tdevgenericfactory.h" +#include "tdevdocumentationplugin.h" #include "configwidgetproxy.h" -#include "kdevpartcontroller.h" +#include "tdevpartcontroller.h" #include "domutil.h" #include "urlutil.h" -#include "kdeveditorutil.h" +#include "tdeveditorutil.h" #include "documentation_widget.h" #include "docglobalconfigwidget.h" @@ -66,22 +66,22 @@ #include "contentsview.h" #include "find_documentation.h" -#include "KDevDocumentationIface.h" +#include "TDevDocumentationIface.h" #define GLOBALDOC_OPTIONS 1 #define PROJECTDOC_OPTIONS 2 -static const KDevPluginInfo data("kdevdocumentation"); +static const TDevPluginInfo data("tdevdocumentation"); -typedef KDevGenericFactory DocumentationFactory; -K_EXPORT_COMPONENT_FACTORY( libkdevdocumentation, DocumentationFactory( data ) ) +typedef TDevGenericFactory 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 Handbook

Opens 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 +#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 TDevPluginInfo data("doctdevtocplugin"); +typedef TDevGenericFactory DocTDevTOCPluginFactory; +K_EXPORT_COMPONENT_FACTORY( libdoctdevtocplugin, DocTDevTOCPluginFactory(data) ) + +DocTDevTOCPlugin::DocTDevTOCPlugin(TQObject* parent, const char* name, + const TQStringList /*args*/) + :DocumentationPlugin(DocTDevTOCPluginFactory::instance()->config(), parent, name) +{ + setCapabilities(Index); + autoSetup(); +} + +DocTDevTOCPlugin::~DocTDevTOCPlugin() +{ +} + +TQString DocTDevTOCPlugin::pluginName() const +{ + return i18n("TDevelopTOC Documentation Collection"); +} + +DocumentationCatalogItem* DocTDevTOCPlugin::createCatalog(TDEListView* contents, const TQString& title, const TQString& url) +{ + return new TOCDocumentationCatalogItem(url, this, contents, title); +} + +TQPair DocTDevTOCPlugin::catalogLocatorProps() +{ + return TQPair(KFile::File, "*.toc"); +} + +TQString DocTDevTOCPlugin::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 DocTDevTOCPlugin::fullTextSearchLocations() +{ + return TQStringList(); +} + +bool DocTDevTOCPlugin::needRefreshIndex(DocumentationCatalogItem* /*item*/) +{ + return false; +} + +void DocTDevTOCPlugin::autoSetupPlugin() +{ + TQStringList tocsDir = DocTDevTOCPluginFactory::instance()->dirs()->findAllResources("data", "tdevdocumentation/tocs/*.toc"); + + for (TQStringList::const_iterator it = tocsDir.begin(); it != tocsDir.end(); ++it) + { + config->setGroup("Locations"); + config->writePathEntry(catalogTitle(*it), *it); + } +} + +void DocTDevTOCPlugin::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 DocTDevTOCPlugin::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 DocTDevTOCPlugin::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 DocTDevTOCPlugin::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 DocTDevTOCPlugin::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 "doctdevtocplugin.moc" diff --git a/parts/documentation/plugins/tdevtoc/doctdevtocplugin.desktop b/parts/documentation/plugins/tdevtoc/doctdevtocplugin.desktop new file mode 100644 index 00000000..5f89e8d7 --- /dev/null +++ b/parts/documentation/plugins/tdevtoc/doctdevtocplugin.desktop @@ -0,0 +1,43 @@ +[Desktop Entry] +Type=Service +Name=DocTDevTOCPlugin +Name[da]=DocTDevTOC-plugin +Name[sk]=Doc TDevTOC modul +Name[sv]=TDevelop innehållsförteckning-dokumentationsinsticksmodul +Name[ta]=DocTDevTOC சொருகு +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=libdoctdevtocplugin diff --git a/parts/documentation/plugins/tdevtoc/doctdevtocplugin.h b/parts/documentation/plugins/tdevtoc/doctdevtocplugin.h new file mode 100644 index 00000000..266efb94 --- /dev/null +++ b/parts/documentation/plugins/tdevtoc/doctdevtocplugin.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * 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 DOCTDEVTOCPLUGIN_H +#define DOCTDEVTOCPLUGIN_H + +#include + +#include + +class DocTDevTOCPlugin : public DocumentationPlugin +{ + Q_OBJECT + +public: + DocTDevTOCPlugin(TQObject* parent, const char* name, const TQStringList args = TQStringList()); + ~DocTDevTOCPlugin(); + + 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/protocols/chm/CMakeLists.txt b/parts/documentation/protocols/chm/CMakeLists.txt index c444c226..8d97053e 100644 --- a/parts/documentation/protocols/chm/CMakeLists.txt +++ b/parts/documentation/protocols/chm/CMakeLists.txt @@ -43,6 +43,6 @@ tde_add_kpart( tdeio_chm tde_add_kpart( libkchmpart AUTOMOC SOURCES kchmpart.cpp - LINK kdevwidgets-shared + LINK tdevwidgets-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/parts/documentation/protocols/chm/Makefile.am b/parts/documentation/protocols/chm/Makefile.am index 5a1092a2..de7e0929 100644 --- a/parts/documentation/protocols/chm/Makefile.am +++ b/parts/documentation/protocols/chm/Makefile.am @@ -9,7 +9,7 @@ tdeio_chm_la_LIBADD = $(LIB_TDEIO) tdeio_chm_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) libkchmpart_la_SOURCES = kchmpart.cpp -libkchmpart_la_LIBADD = -ltdehtml $(LIB_TDEPARTS) $(top_builddir)/lib/widgets/libkdevwidgets.la +libkchmpart_la_LIBADD = -ltdehtml $(LIB_TDEPARTS) $(top_builddir)/lib/widgets/libtdevwidgets.la libkchmpart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) noinst_HEADERS = chm.h chmfile.h decompress.h kchmpart.h diff --git a/parts/documentation/protocols/chm/kchmpart.cpp b/parts/documentation/protocols/chm/kchmpart.cpp index 952228c4..ab688ff7 100644 --- a/parts/documentation/protocols/chm/kchmpart.cpp +++ b/parts/documentation/protocols/chm/kchmpart.cpp @@ -67,7 +67,7 @@ TDEInstance* KChmPartFactory::instance() KChmPart::KChmPart( TQWidget * parent, const char * name ) - : KDevHTMLPart( ), m_job(0) + : TDevHTMLPart( ), m_job(0) { TDEInstance * instance = new TDEInstance( "kchmpart" ); setInstance( instance ); @@ -80,7 +80,7 @@ bool KChmPart::openURL( const KURL &url ) KURL chmURL = url; chmURL.setProtocol("ms-its"); chmURL.addPath("/"); - return KDevHTMLPart::openURL(chmURL); + return TDevHTMLPart::openURL(chmURL); } void KChmPart::slotDuplicate() diff --git a/parts/documentation/protocols/chm/kchmpart.h b/parts/documentation/protocols/chm/kchmpart.h index 9d1812b1..a3c8d9ec 100644 --- a/parts/documentation/protocols/chm/kchmpart.h +++ b/parts/documentation/protocols/chm/kchmpart.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include @@ -52,7 +52,7 @@ class KChmPartFactory: public KParts::Factory }; -class KChmPart : public KDevHTMLPart +class KChmPart : public TDevHTMLPart { Q_OBJECT diff --git a/parts/documentation/searchview.cpp b/parts/documentation/searchview.cpp index 67dca0ed..2893d574 100644 --- a/parts/documentation/searchview.cpp +++ b/parts/documentation/searchview.cpp @@ -43,8 +43,8 @@ #include #include -#include -#include +#include +#include #include "documentation_part.h" #include "docutils.h" @@ -160,7 +160,7 @@ void SearchView::search() return; } - TQString indexdir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search"); + TQString indexdir = kapp->dirs()->saveLocation("data", "tdevdocumentation/search"); TQDir d; if (indexdir.isEmpty() || !TQFile::exists(indexdir + "/htdig.conf")) { @@ -177,7 +177,7 @@ void SearchView::search() } } - TQString savedir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search"); + TQString savedir = kapp->dirs()->saveLocation("data", "tdevdocumentation/search"); if (!d.exists(savedir)) d.mkdir(savedir); @@ -191,7 +191,7 @@ void SearchView::search() kdDebug(9002) << "starting kprocess" << endl; kdDebug(9002) << "htdig line:" << exe << " -c " << (indexdir + "/htdig.conf ") << query << endl; TDEProcess *proc = new TDEProcess; - TQString picdir = kapp->dirs()->findResourceDir("data", "kdevdocumentation/pics/htdig.png"); + TQString picdir = kapp->dirs()->findResourceDir("data", "tdevdocumentation/pics/htdig.png"); proc->setEnvironment("PICDIR", picdir); *proc << exe << "-c" << (indexdir + "/htdig.conf") << query; diff --git a/parts/documentation/selecttopic.h b/parts/documentation/selecttopic.h index 6ca5ad8b..e7e850bf 100644 --- a/parts/documentation/selecttopic.h +++ b/parts/documentation/selecttopic.h @@ -22,7 +22,7 @@ #include "selecttopicbase.h" -#include "kdevdocumentationplugin.h" +#include "tdevdocumentationplugin.h" class SelectTopic: public SelectTopicBase{ Q_OBJECT diff --git a/parts/documentation/tdevdocumentation.desktop b/parts/documentation/tdevdocumentation.desktop new file mode 100644 index 00000000..721970e7 --- /dev/null +++ b/parts/documentation/tdevdocumentation.desktop @@ -0,0 +1,82 @@ +[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=TDevDocumentation +Name[da]=TDevelop dokumentation +Name[nds]=TDevelop-Dokmentatschoon +Name[pt_BR]=TDevDocumentaçã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=libtdevdocumentation +X-TDevelop-Version=5 +X-TDevelop-Mode=AssistantMode +X-TDevelop-Properties=Documentation diff --git a/parts/documentation/tdevpart_documentation.rc b/parts/documentation/tdevpart_documentation.rc new file mode 100644 index 00000000..6fd8b488 --- /dev/null +++ b/parts/documentation/tdevpart_documentation.rc @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + diff --git a/parts/documentation/tools/htdig/htdigindex.cpp b/parts/documentation/tools/htdig/htdigindex.cpp index c99c4a2c..d422826c 100644 --- a/parts/documentation/tools/htdig/htdigindex.cpp +++ b/parts/documentation/tools/htdig/htdigindex.cpp @@ -45,10 +45,10 @@ ProgressDialog::ProgressDialog(bool index, TQWidget *parent, const char *name) { proc = 0; - indexdir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search"); + indexdir = kapp->dirs()->saveLocation("data", "tdevdocumentation/search"); TQDir d; d.mkdir(indexdir); - TDEConfig config("kdevdocumentation", true); + TDEConfig config("tdevdocumentation", true); config.setGroup("htdig"); databaseDir = config.readPathEntry("databaseDir", indexdir); @@ -137,8 +137,8 @@ void ProgressDialog::setFilesDigged(int n) void ProgressDialog::setState(int n) { - TQPixmap unchecked = TQPixmap(locate("data", "kdevdocumentation/pics/unchecked.xpm")); - TQPixmap checked = TQPixmap(locate("data", "kdevdocumentation/pics/checked.xpm")); + TQPixmap unchecked = TQPixmap(locate("data", "tdevdocumentation/pics/unchecked.xpm")); + TQPixmap checked = TQPixmap(locate("data", "tdevdocumentation/pics/checked.xpm")); check1->setPixmap( n > 0 ? checked : unchecked); check2->setPixmap( n > 1 ? checked : unchecked); @@ -182,7 +182,7 @@ void ProgressDialog::addDir(const TQString &dir) void ProgressDialog::scanDirectories() { - TQString ftsLocationsFile = locateLocal("data", "kdevdocumentation/search/locations.txt"); + TQString ftsLocationsFile = locateLocal("data", "tdevdocumentation/search/locations.txt"); TQFile f(ftsLocationsFile); if (!f.open(IO_ReadOnly)) @@ -214,15 +214,15 @@ bool ProgressDialog::createConfig() if (language == "C") language = "en"; - TQString wrapper = locate("data", TQString("kdevdocumentation/%1/wrapper.html").arg(language)); + TQString wrapper = locate("data", TQString("tdevdocumentation/%1/wrapper.html").arg(language)); if (wrapper.isEmpty()) - wrapper = locate("data", TQString("kdevdocumentation/en/wrapper.html")); + wrapper = locate("data", TQString("tdevdocumentation/en/wrapper.html")); if (wrapper.isEmpty()) return false; wrapper = wrapper.left(wrapper.length()-12); // locate the image dir - TQString images = locate("data", "kdevdocumentation/pics/star.png"); + TQString images = locate("data", "tdevdocumentation/pics/star.png"); if (images.isEmpty()) return false; images = images.left(images.length()-8); @@ -300,7 +300,7 @@ bool ProgressDialog::generateIndex() setState(1); procdone = false; // run htdig - TDEConfig config("kdevdocumentation", true); + TDEConfig config("tdevdocumentation", true); config.setGroup("htdig"); exe = config.readPathEntry("htdigbin", kapp->dirs()->findExe("htdig")); if (exe.isEmpty()) @@ -365,7 +365,7 @@ void ProgressDialog::htdigExited(TDEProcess *proc) setFilesDigged(filesToDig); setState(2); - TDEConfig config("kdevdocumentation", true); + TDEConfig config("tdevdocumentation", true); config.setGroup("htdig"); // run htmerge ----------------------------------------------------- exe = config.readPathEntry("htmergebin", kapp->dirs()->findExe("htmerge")); -- cgit v1.2.3