KDevelop API Documentation

docchmplugin.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Alexander Dymo                                  *
00003  *   cloudtemple@mksat.net                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #include "docchmplugin.h"
00021 
00022 #include <kurl.h>
00023 #include <kaboutdata.h>
00024 #include <kconfig.h>
00025 #include <klocale.h>
00026 #include <klistview.h>
00027 
00028 #include <kdevgenericfactory.h>
00029 
00030 #include "../../../../config.h"
00031 
00032 static const KAboutData data("docchmplugin", I18N_NOOP("CHM documentation plugin"), "1.0");
00033 typedef KDevGenericFactory<DocCHMPlugin> DocCHMPluginFactory;
00034 K_EXPORT_COMPONENT_FACTORY( libdocchmplugin, DocCHMPluginFactory(&data) )
00035 
00036 DocCHMPlugin::DocCHMPlugin(QObject* parent, const char* name, QStringList args)
00037     :DocumentationPlugin(DocCHMPluginFactory::instance()->config(), parent, name)
00038 {
00039     setCapabilities(CustomDocumentationTitles);
00040     autoSetup();
00041 }
00042 
00043 DocCHMPlugin::~DocCHMPlugin()
00044 {
00045 }
00046 
00047 DocumentationCatalogItem* DocCHMPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
00048 {
00049     DocumentationCatalogItem *item = new DocumentationCatalogItem(this, contents, title);
00050     item->setURL(KURL(url));
00051     return item;
00052 }
00053 
00054 QPair<KFile::Mode, QString> DocCHMPlugin::catalogLocatorProps()
00055 {
00056     return QPair<KFile::Mode, QString>(KFile::File, "*.chm");
00057 }
00058 
00059 QString DocCHMPlugin::catalogTitle(const QString& url)
00060 {
00061     return QString::null;
00062 }
00063 
00064 QString DocCHMPlugin::pluginName() const
00065 {
00066     return i18n("CHM Documentation Collection");
00067 }
00068 
00069 QStringList DocCHMPlugin::fullTextSearchLocations()
00070 {
00071     return QStringList();
00072 }
00073 
00074 bool DocCHMPlugin::needRefreshIndex(DocumentationCatalogItem* item)
00075 {
00076     return false;
00077 }
00078 
00079 void DocCHMPlugin::autoSetupPlugin()
00080 {
00081     return;
00082 }
00083 
00084 void DocCHMPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* item)
00085 {
00086     return;
00087 }
00088 
00089 void DocCHMPlugin::createTOC(DocumentationCatalogItem* item)
00090 {
00091     return;
00092 }
00093 
00094 void DocCHMPlugin::setCatalogURL(DocumentationCatalogItem* item)
00095 {
00096     KURL chmURL = item->url();
00097     chmURL.setProtocol("ms-its");
00098     chmURL.addPath("/");
00099     item->setURL(chmURL);
00100 }
00101 
00102 #include "docchmplugin.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:56 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003