KDevelop API Documentation

KDevProject Class Reference

#include <kdevproject.h>

Inheritance diagram for KDevProject:

KDevPlugin QObject KXMLGUIClient AdaProjectPart AntProjectPart AutoProjectPart CustomProjectPart GenericProjectPart HaskellProjectPart PascalProjectPart ScriptProjectPart TrollProjectPart List of all members.

Public Types

enum  Options { UsesAutotoolsBuildSystem = 1, UsesQMakeBuildSystem }

Signals

void addedFilesToProject (const QStringList &fileList)
 Emitted when a new list of files has been added to the project.

void removedFilesFromProject (const QStringList &fileList)
 Emitted when a list of files has been removed from the project.

void changedFilesInProject (const QStringList &fileList)
 Emitted when a list of files has changed in the project.

void projectCompiled ()
 Emitted when one compile related command (make, make install, make ...) ends sucessfuly.


Public Member Functions

 KDevProject (const QString &pluginName, const QString &icon, QObject *parent=0, const char *name=0)
virtual ~KDevProject ()
virtual void openProject (const QString &dirName, const QString &projectName)
 This method is invoked when the project is opened (i.e.

virtual void closeProject ()=0
 This method is invoked when the project is about to be closed.

virtual Options options () const
virtual QString projectDirectory () const =0
 Returns the canonical toplevel directory of the project.

virtual QString projectName () const =0
 Returns the name of the project.

virtual DomUtil::PairList runEnvironmentVars () const =0
 The environment variables that sould be set before running mainProgram().

virtual QString mainProgram (bool relative=false) const =0
 Returns the absolute path to main binary program of the project.

virtual QString runDirectory () const =0
 Absolute path (directory) from where the mainProgram() should be run.

virtual QString runArguments () const =0
 The command line arguments that the mainProgram() should be run with.

virtual QString activeDirectory () const =0
 Returns the path (relative to the project directory) of the active directory.

virtual QString buildDirectory () const =0
 Returns the canonical build directory of the project.

virtual QStringList allFiles () const =0
 Returns a list of all files in the project.

virtual void addFiles (const QStringList &fileList)=0
 Adds a list of files to the project.

virtual void addFile (const QString &fileName)=0
 Adds a file to the project.

virtual void removeFiles (const QStringList &fileList)=0
 Removes a list of files from the project.

virtual void removeFile (const QString &fileName)=0
 Removes a file from the project.

virtual void changedFiles (const QStringList &fileList)
 Notifies the project of changes to the files.

virtual void changedFile (const QString &fileName)
 Notifies the project of a change to one of the files.

virtual bool isProjectFile (const QString &absFileName)
 Returns true if the file absFileName is part of the project.

virtual QString relativeProjectFile (const QString &absFileName)
 Returns the path (relative to the project directory) of the file absFileName.


Private Slots

void slotBuildFileMap ()

Private Attributes

QMap< QString, QStringm_absToRel

Member Enumeration Documentation

enum KDevProject::Options
 

Enumeration values:
UsesAutotoolsBuildSystem 
UsesQMakeBuildSystem 

Definition at line 43 of file kdevproject.h.

Referenced by options().


Constructor & Destructor Documentation

KDevProject::KDevProject const QString pluginName,
const QString icon,
QObject parent = 0,
const char *  name = 0
 

Definition at line 28 of file kdevproject.cpp.

References addedFilesToProject(), changedFilesInProject(), KDevProject(), removedFilesFromProject(), and slotBuildFileMap().

Referenced by KDevProject().

KDevProject::~KDevProject  )  [virtual]
 

Definition at line 36 of file kdevproject.cpp.


Member Function Documentation

virtual QString KDevProject::activeDirectory  )  const [pure virtual]
 

Returns the path (relative to the project directory) of the active directory.

All newly generated classes are added here.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by ScriptNewFileDialog::accept(), FileCreatePart::createNewFile(), CppNewClassDialog::ClassGenerator::gen_interface(), CppNewClassDialog::ClassGenerator::generate(), MakeWidget::guessFileName(), and ReplaceWidget::showDialog().

void KDevProject::addedFilesToProject const QStringList fileList  )  [signal]
 

Emitted when a new list of files has been added to the project.

Provided for convenience when many files were added. The file names are relative to the project directory.

Referenced by TrollProjectWidget::emitAddedFile(), AutoProjectWidget::emitAddedFile(), AutoProjectWidget::emitAddedFiles(), KDevProject(), and TrollProjectWidget::slotDetailsContextMenu().

virtual void KDevProject::addFile const QString fileName  )  [pure virtual]
 

Adds a file to the project.

The given file name must be relative to the project directory.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by FileCreatePart::createNewFile(), and CppSupportPart::slotExtractInterface().

virtual void KDevProject::addFiles const QStringList fileList  )  [pure virtual]
 

Adds a list of files to the project.

Provided for convenience when adding many files. The given file names must be relative to the project directory.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by CppNewClassDialog::ClassGenerator::gen_interface().

virtual QStringList KDevProject::allFiles  )  const [pure virtual]
 

Returns a list of all files in the project.

The files are relative to the project directory.

Todo:
This is currently a bit broken because the autoproject part doesn't return header files here.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by CppSupportPart::addedFilesToProject(), ReplaceWidget::allProjectFiles(), CustomProjectPart::contextMenu(), AntProjectPart::contextMenu(), CTagsPart::createTagsFile(), PartController::findURLInProject(), ValgrindPart::getActiveFiles(), MakeWidget::guessFileName(), PythonSupportPart::initialParse(), PHPSupportPart::initialParse(), PerlSupportPart::initialParse(), PascalSupportPart::initialParse(), FortranSupportPart::initialParse(), AdaSupportPart::initialParse(), JavaSupportPart::modifiedFileList(), FileTreeWidget::openDirectory(), BashSupportPart::parse(), PascalSupportPart::projectOpened(), HaskellSupportPart::projectOpened(), CppSupportPart::projectOpened(), QuickOpenDialog::QuickOpenDialog(), FileGroupsWidget::refresh(), CppSupportPart::removedFilesFromProject(), SQLSupportPart::savedFile(), PythonSupportPart::savedFile(), PHPSupportPart::savedFile(), PerlSupportPart::savedFile(), JavaSupportPart::savedFile(), FortranSupportPart::savedFile(), BashSupportPart::savedFile(), AdaSupportPart::savedFile(), KDevDriver::setupProject(), slotBuildFileMap(), FortranSupportPart::slotFtnchek(), and PHPSupportPart::slotTextChanged().

virtual QString KDevProject::buildDirectory  )  const [pure virtual]
 

Returns the canonical build directory of the project.

If the separate build directory is not supported, this should return the same as projectDiretory().

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by GDBDebugger::DebuggerConfigWidget::DebuggerConfigWidget(), MakeWidget::guessFileName(), and GDBDebugger::DebuggerPart::startDebugger().

void KDevProject::changedFile const QString fileName  )  [virtual]
 

Notifies the project of a change to one of the files.

The given file name must be relative to the project directory.

Reimplemented in AdaProjectPart, HaskellProjectPart, and PascalProjectPart.

Definition at line 40 of file kdevproject.cpp.

References changedFile(), and changedFilesInProject().

Referenced by changedFile().

void KDevProject::changedFiles const QStringList fileList  )  [virtual]
 

Notifies the project of changes to the files.

Provided for convenience when changing many files. The given file names must be relative to the project directory.

Reimplemented in AdaProjectPart, HaskellProjectPart, and PascalProjectPart.

Definition at line 49 of file kdevproject.cpp.

References changedFiles(), and changedFilesInProject().

Referenced by changedFiles(), and ReplaceWidget::makeReplacements().

void KDevProject::changedFilesInProject const QStringList fileList  )  [signal]
 

Emitted when a list of files has changed in the project.

The file names are relative to the project directory.

Referenced by changedFile(), changedFiles(), and KDevProject().

virtual void KDevProject::closeProject  )  [pure virtual]
 

This method is invoked when the project is about to be closed.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by ProjectManager::unloadProjectPart().

bool KDevProject::isProjectFile const QString absFileName  )  [virtual]
 

Returns true if the file absFileName is part of the project.

Definition at line 59 of file kdevproject.cpp.

References isProjectFile(), and m_absToRel.

Referenced by ClassViewPart::addFile(), ClassViewWidget::insertFile(), isProjectFile(), CppSupportPart::isValidSource(), relativeProjectFile(), ClassViewWidget::removeFile(), and ClassViewPart::removeFile().

virtual QString KDevProject::mainProgram bool  relative = false  )  const [pure virtual]
 

Returns the absolute path to main binary program of the project.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by GDBDebugger::DebuggerPart::slotDCOPApplicationRegistered(), PythonSupportPart::slotExecute(), PerlSupportPart::slotExecute(), and GDBDebugger::DebuggerPart::startDebugger().

void KDevProject::openProject const QString dirName,
const QString projectName
[virtual]
 

This method is invoked when the project is opened (i.e.

actually just after this class has been instantiated). The first parameter is the project directory, which should afterwards be returned by the projectDirectory() method. The second parameter is the project name, which is equivalent with the project file name without the .kdevelop suffix.

Reimplemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Definition at line 82 of file kdevproject.cpp.

References openProject(), and slotBuildFileMap().

Referenced by ProjectManager::loadProjectPart(), and openProject().

KDevProject::Options KDevProject::options  )  const [virtual]
 

Reimplemented in AutoProjectPart.

Definition at line 54 of file kdevproject.cpp.

References Options.

Referenced by SubclassingDlg::accept(), and CppNewClassDialog::ClassGenerator::gen_implementation().

void KDevProject::projectCompiled  )  [signal]
 

Emitted when one compile related command (make, make install, make ...) ends sucessfuly.

Used to reparse the files after a sucessful compilation

Referenced by TrollProjectPart::slotCommandFinished(), CustomProjectPart::slotCommandFinished(), and AutoProjectPart::slotCommandFinished().

virtual QString KDevProject::projectDirectory  )  const [pure virtual]
 

Returns the canonical toplevel directory of the project.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by ScriptNewFileDialog::accept(), AddFileDialog::accept(), KonsoleViewWidget::activePartChanged(), PythonSupportPart::addedFilesToProject(), PascalSupportPart::addedFilesToProject(), AdaSupportPart::addedFilesToProject(), FileGroupsWidget::addFile(), DoxygenPart::adjustDoxyfile(), FileGroupsWidget::allFilesRecursively(), AdaSupportPart::changedFilesInProject(), CvsServicePartImpl::checkFileListAgainstCVS(), CppSupportPart::createIgnorePCSFile(), FCConfigWidget::edit_template_content_button_clicked(), FCConfigWidget::edit_type_content_button_clicked(), PartController::editDocument(), FCConfigWidget::FCConfigWidget(), PartController::findURLInProject(), FileTemplate::fullPathForName(), ReplaceWidget::fullProjectPath(), CppNewClassDialog::ClassGenerator::generate(), ValgrindPart::getActiveFiles(), MakeWidget::guessFileName(), PythonSupportPart::initialParse(), PascalSupportPart::initialParse(), AdaSupportPart::initialParse(), CvsOptions::load(), FCConfigWidget::loadProjectTemplates(), DistpartDialog::loadSettings(), packageBase::packageBase(), BashSupportPart::parse(), CppSupportPart::parseProject(), GrepViewWidget::projectChanged(), CvsServicePartImpl::projectDirectory(), CVSFileInfoProvider::projectDirectory(), FileTreeWidget::projectDirectory(), FileTreeViewWidgetImpl::projectDirectory(), DocTreeProjectConfigWidget::readConfig(), FileGroupsWidget::refresh(), ReplaceWidget::relativeProjectPath(), PythonSupportPart::removedFilesFromProject(), PerlSupportPart::removedFilesFromProject(), PascalSupportPart::removedFilesFromProject(), BashSupportPart::removedFilesFromProject(), AdaSupportPart::removedFilesFromProject(), FileTreeWidget::removeProjectFiles(), FCConfigWidget::removetemplate_button_clicked(), CvsOptions::save(), FCConfigWidget::saveConfiguration(), FCConfigWidget::saveProjectConfig(), CppSupportPart::saveProjectSourceInfo(), AutoProjectWidget::saveSession(), ReplaceWidget::showDialog(), PartWidget::showProjectFiles(), slotBuildFileMap(), FileGroupsWidget::slotContextMenu(), DoxygenPart::slotDoxClean(), DoxygenPart::slotDoxygen(), GDBDebugger::DebuggerPart::slotExamineCore(), QuickOpenDialog::slotExecuted(), SpecSupport::slotexportSPECPushButtonPressed(), FortranSupportPart::slotFtnchek(), FileGroupsWidget::slotItemExecuted(), ClassViewWidget::slotProjectOpened(), CTagsDialog::slotResultClicked(), QuickOpenDialog::slotReturnPressed(), ToolsPart::startCommand(), and DocTreeProjectConfigWidget::storeConfig().

virtual QString KDevProject::projectName  )  const [pure virtual]
 

Returns the name of the project.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by CppSupportPart::createIgnorePCSFile(), CppSupportPart::parseProject(), DocTreeProjectFolder::refresh(), ClassViewWidget::refresh(), CppSupportPart::saveProjectSourceInfo(), MainWindow::setCaption(), SpecSupport::slotbuildAllPushButtonPressed(), SpecSupport::slotexportSPECPushButtonPressed(), ClassViewWidget::slotProjectOpened(), and SpecSupport::slotsrcPackagePushButtonPressed().

QString KDevProject::relativeProjectFile const QString absFileName  )  [virtual]
 

Returns the path (relative to the project directory) of the file absFileName.

Definition at line 64 of file kdevproject.cpp.

References isProjectFile(), m_absToRel, and relativeProjectFile().

Referenced by ClassViewWidget::insertFile(), relativeProjectFile(), and ClassViewWidget::removeFile().

void KDevProject::removedFilesFromProject const QStringList fileList  )  [signal]
 

Emitted when a list of files has been removed from the project.

Provided for convenience when many files were removed. The file names are relative to the project directory.

Referenced by TrollProjectWidget::emitRemovedFile(), AutoProjectWidget::emitRemovedFile(), AutoProjectWidget::emitRemovedFiles(), and KDevProject().

virtual void KDevProject::removeFile const QString fileName  )  [pure virtual]
 

Removes a file from the project.

The given file name must be relative to the project directory.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

virtual void KDevProject::removeFiles const QStringList fileList  )  [pure virtual]
 

Removes a list of files from the project.

Provided for convenience when removing many files. The given file names must be relative to the project directory.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

virtual QString KDevProject::runArguments  )  const [pure virtual]
 

The command line arguments that the mainProgram() should be run with.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by GDBDebugger::DebuggerPart::startDebugger().

virtual QString KDevProject::runDirectory  )  const [pure virtual]
 

Absolute path (directory) from where the mainProgram() should be run.

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by GDBDebugger::DebuggerPart::startDebugger().

virtual DomUtil::PairList KDevProject::runEnvironmentVars  )  const [pure virtual]
 

The environment variables that sould be set before running mainProgram().

Implemented in AdaProjectPart, AntProjectPart, AutoProjectPart, CustomProjectPart, GenericProjectPart, HaskellProjectPart, PascalProjectPart, TrollProjectPart, and ScriptProjectPart.

Referenced by GDBDebugger::DebuggerPart::startDebugger().

void KDevProject::slotBuildFileMap  )  [private, slot]
 

Definition at line 71 of file kdevproject.cpp.

References allFiles(), URLUtil::canonicalPath(), m_absToRel, and projectDirectory().

Referenced by KDevProject(), and openProject().


Member Data Documentation

QMap<QString, QString> KDevProject::m_absToRel [private]
 

Definition at line 183 of file kdevproject.h.

Referenced by isProjectFile(), relativeProjectFile(), and slotBuildFileMap().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:23 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003