KDevelop API Documentation

DoxygenPart Class Reference

Integrates Doxygen - http://www.doxygen.org into KDevelop. More...

#include <doxygenpart.h>

Inheritance diagram for DoxygenPart:

Inheritance graph
[legend]
Collaboration diagram for DoxygenPart:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DoxygenPart (QObject *parent, const char *name, const QStringList &)
 ~DoxygenPart ()

Private Slots

void insertConfigWidget (const KDialogBase *dlg, QWidget *page, unsigned int)
 Configuration dialog under "Project Options..." that alows to specify doxygen configuration options and store them to a configuration file.
void slotDoxygen ()
 run doxygen to generate API documentation
void slotDoxClean ()
 clean the html API docs (delete the generated html files)
void slotPreviewProcessExited ()
 Gets called, when the Doxygen process for previewing is finished and shows its output then.
void slotRunPreview ()
 If the current part is KTextEditor::Document, run Doxygen over it.
void slotActivePartChanged (KParts::Part *)
 Gets called when the currently active part changed.
void slotDocumentFunction ()
 Inserts a documentation template above a function declaration/definition.

Private Member Functions

void adjustDoxyfile ()
 If a Doxygen configuration file doesn't exist, create one.

Private Attributes

DoxygenDialog * m_dialog
ConfigWidgetProxy_configProxy
KProcess m_process
QString m_file
KTempDir m_tmpDir
KActionm_action
KActionm_actionDocumentFunction
KActionm_actionPreview
KTextEditor::EditInterfacem_activeEditor
KTextEditor::ViewCursorInterfacem_cursor

Detailed Description

Integrates Doxygen - http://www.doxygen.org into KDevelop.

It allows you to call the Doxygen executable from a KDevelop menu. It integrates a GUI into the "KDevelop Project Configuration dialog" to configure Doxygen (it reads and writes Doxygen Compatible configuration files).

To update to a newer doxygen version:

  1. Merge over the config.h and config.cpp files from the addon/doxywizard/ directory in the doxygen sources. You'll need:
    • GNU bison v1.34 or better
    • GNU flex v2.5.4 or better
    • Kompare from KDEsdk
    You'll have to issue:
    $ ./configure --with-doxywizard && make
    to get the config.h and config.cpp files on this directory. You should also copy config.l if you'd like to do some debugging.
    1. To do the merge on config.cpp you should use:
      $ kompare doxygen-location/addon/doxywizard/config.cpp kdevelop-location/parts/doxygen/config.cpp
      • Be careful because doxygen uses the deprecated QList class while KDevelop uses the new QPtrList so you should not merge certain lines of code!!!
      • Be careful because doxygen uses the deprecated QRegExp::match() method while KDevelop uses the new QRegExp::search() and QRegExp::matchedLength() mehtods instead so you should not merge certain lines of code!!!
      • Be careful because KDevlop uses the QFile::encodeName() function and the original doxygen code doesn't. So do NOT delete the QFile::encodeName() calls.

    2. To do the merge on config.h you should use:
      $ kompare doxygen-location/addon/doxywizard/config.h kdevelop-location/parts/doxygen/config.h
      • Again, be careful because doxygen uses the deprecated QList class while KDevelop uses the new QPtrList so you should not merge certain lines of code!!!

  2. Copy over the file lang_cfg.h from the src/ directory in the doxygen sources.
  3. Add the new i18n strings to messages.cpp. To do so, run KDevelop and go to Project-> Project Options... -> Doxygen. Take a look at KDevelop' console output, it will warn you about the missing messages. Add them to messages.cpp file.
  4. Update version.cpp
  5. Add anything else you needed to do, to get it to compile, to the parts/doxygen/README.dox file.

Everything else we can customize for our look & feel.

Author(s):
Dimitri van Heesch

Maintainer(s):
Bernd Gehrmann

Amilcar Lucas

Feature(s):
Call Doxygen executable from a KDevelop menu.

Configure Doxygen inside KDevelop.

Create a configuration file with correct ProjectName, Author, Version and location of source files whenever a new KDevelop project is created.

Automaticaly generate a Doxygen search database whenever the "search engine" option in Doxygen configuration is activated and you "Run Doxygen".

Requirement(s):
You need to install the Doxygen binaries in your machine. This part supports all versions up to the version stated on the version.cpp file. As usual it is recomended to use the latest version or at least >= 1.3.4.

It is recomended that you also install dot >= 1.8.7 (tool to generate graphical dependencies).

Bug:
doesn't resize the configuration GUI properly.

F.A.Q.:
Do I need to install Doxygen? Yes

Definition at line 40 of file doxygenpart.h.


Constructor & Destructor Documentation

DoxygenPart::DoxygenPart QObject parent,
const char *  name,
const QStringList
 

DoxygenPart::~DoxygenPart  ) 
 

Definition at line 106 of file doxygenpart.cpp.


Member Function Documentation

void DoxygenPart::adjustDoxyfile  )  [private]
 

If a Doxygen configuration file doesn't exist, create one.

And copy some of the project settings to it.

Definition at line 125 of file doxygenpart.cpp.

References ConfigList::addValue(), Config::check(), Config::get(), KMessageBox::information(), ConfigList::init(), ConfigString::init(), Config::init(), Config::instance(), main(), KDevPlugin::mainWindow(), KDevPlugin::project(), KDevProject::projectDirectory(), KDevPlugin::projectDom(), ConfigString::setDefaultValue(), ConfigBool::setValueString(), and Config::writeTemplate().

Referenced by insertConfigWidget(), and slotDoxygen().

void DoxygenPart::insertConfigWidget const KDialogBase dlg,
QWidget page,
unsigned  int
[private, slot]
 

Configuration dialog under "Project Options..." that alows to specify doxygen configuration options and store them to a configuration file.

The file name is "Doxyfile" and it's stored in the project root.

Definition at line 111 of file doxygenpart.cpp.

References adjustDoxyfile(), and KDevPlugin::project().

void DoxygenPart::slotActivePartChanged KParts::Part  )  [private, slot]
 

Gets called when the currently active part changed.

When the new part is a KTextEditor::Document the filepath gets internally stored and gets processed if slotRunPreview() is called.

See also:
KTextEditor::Document

Definition at line 468 of file doxygenpart.cpp.

References m_activeEditor, m_cursor, m_file, KURL::path(), KParts::ReadOnlyPart::url(), and KParts::Part::widget().

void DoxygenPart::slotDocumentFunction  )  [private, slot]
 

Inserts a documentation template above a function declaration/definition.

Definition at line 481 of file doxygenpart.cpp.

References CodeModelUtils::allFunctionDefinitionsDetailed(), CodeModelUtils::allFunctions(), KDevPlugin::codeModel(), KTextEditor::ViewCursorInterface::cursorPosition(), file, CodeModel::fileByName(), FileDom, FunctionDefinitionDom, FunctionDefinitionList, FunctionDom, FunctionList, CodeModel::hasFile(), KTextEditor::EditInterface::insertText(), length(), m_activeEditor, m_cursor, m_file, KTextEditor::ViewCursorInterface::setCursorPosition(), text(), and KTextEditor::EditInterface::textLine().

void DoxygenPart::slotDoxClean  )  [private, slot]
 

clean the html API docs (delete the generated html files)

Definition at line 274 of file doxygenpart.cpp.

References Config_getBool, Config_getString, kdDebug(), KDevPlugin::makeFrontend(), KDevPlugin::project(), KDevProject::projectDirectory(), KDevMakeFrontend::queueCommand(), and KShellProcess::quote().

void DoxygenPart::slotDoxygen  )  [private, slot]
 

run doxygen to generate API documentation

Definition at line 214 of file doxygenpart.cpp.

References adjustDoxyfile(), Config_getBool, Config_getString, Config::convertStrToVal(), Config::get(), Config::init(), Config::instance(), kdDebug(), KDevPlugin::makeFrontend(), Config::parse(), KDevPlugin::project(), KDevProject::projectDirectory(), KDevMakeFrontend::queueCommand(), and KShellProcess::quote().

void DoxygenPart::slotPreviewProcessExited  )  [private, slot]
 

Gets called, when the Doxygen process for previewing is finished and shows its output then.

Definition at line 344 of file doxygenpart.cpp.

References m_tmpDir, KTempDir::name(), KDevPlugin::partController(), and KDevPartController::showDocument().

void DoxygenPart::slotRunPreview  )  [private, slot]
 

If the current part is KTextEditor::Document, run Doxygen over it.

When the process exited slotPreviewProcessExited gets called.

Definition at line 349 of file doxygenpart.cpp.

References Config::addList(), KProcess::clearArguments(), KMessageBox::error(), file, Config::get(), Config::instance(), KProcess::isRunning(), KProcess::kill(), m_file, m_process, m_tmpDir, main(), KDevPlugin::mainWindow(), KTempDir::name(), KDevPlugin::project(), KDevProject::projectDirectory(), KTempDir::setAutoDelete(), KProcess::start(), KTempDir::unlink(), ConfigList::valueRef(), ConfigString::valueRef(), KMessageBox::warningYesNo(), and Config::writeTemplate().


Member Data Documentation

ConfigWidgetProxy* DoxygenPart::_configProxy [private]
 

Definition at line 99 of file doxygenpart.h.

KAction* DoxygenPart::m_action [private]
 

Definition at line 105 of file doxygenpart.h.

KAction* DoxygenPart::m_actionDocumentFunction [private]
 

Definition at line 108 of file doxygenpart.h.

KAction* DoxygenPart::m_actionPreview [private]
 

Definition at line 109 of file doxygenpart.h.

KTextEditor::EditInterface* DoxygenPart::m_activeEditor [private]
 

Definition at line 110 of file doxygenpart.h.

Referenced by slotActivePartChanged(), and slotDocumentFunction().

KTextEditor::ViewCursorInterface* DoxygenPart::m_cursor [private]
 

Definition at line 111 of file doxygenpart.h.

Referenced by slotActivePartChanged(), and slotDocumentFunction().

DoxygenDialog* DoxygenPart::m_dialog [private]
 

Definition at line 98 of file doxygenpart.h.

QString DoxygenPart::m_file [private]
 

Definition at line 103 of file doxygenpart.h.

Referenced by slotActivePartChanged(), slotDocumentFunction(), and slotRunPreview().

KProcess DoxygenPart::m_process [private]
 

Definition at line 102 of file doxygenpart.h.

Referenced by slotRunPreview().

KTempDir DoxygenPart::m_tmpDir [private]
 

Definition at line 104 of file doxygenpart.h.

Referenced by slotPreviewProcessExited(), and slotRunPreview().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:41:34 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003