You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
220 lines
9.3 KiB
220 lines
9.3 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||
11 years ago
|
Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
|
||
|
Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
|
||
15 years ago
|
Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
|
||
|
Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
|
||
|
Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
|
||
11 years ago
|
Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.org>
|
||
15 years ago
|
|
||
|
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
|
||
15 years ago
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
15 years ago
|
*/
|
||
11 years ago
|
#ifndef TDEVPROJECT_H
|
||
|
#define TDEVPROJECT_H
|
||
15 years ago
|
|
||
11 years ago
|
#include "tdevplugin.h"
|
||
15 years ago
|
#include "domutil.h"
|
||
|
|
||
15 years ago
|
#include <tqstringlist.h>
|
||
|
#include <tqmap.h>
|
||
15 years ago
|
|
||
|
/**
|
||
11 years ago
|
@file tdevproject.h
|
||
15 years ago
|
KDevelop project interface.
|
||
|
*/
|
||
|
|
||
15 years ago
|
class TQTimer;
|
||
15 years ago
|
|
||
|
/**
|
||
|
KDevelop project interface.
|
||
11 years ago
|
Plugins implementing the TDevProject interfaces are used to manage projects.
|
||
15 years ago
|
|
||
|
Project can be considered as a way of grouping files (in text editors) or
|
||
13 years ago
|
as a way of providing support for a build system (like it is done in TDevelop IDE buildtools).
|
||
15 years ago
|
*/
|
||
11 years ago
|
class TDevProject: public TDevPlugin
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
/**Constructs a project plugin.
|
||
|
@param info Important information about the plugin - plugin internal and generic
|
||
|
(GUI) name, description, a list of authors, etc. That information is used to show
|
||
|
plugin information in various places like "about application" dialog, plugin selector
|
||
|
dialog, etc. Plugin does not take ownership on info object, also its lifetime should
|
||
|
be equal to the lifetime of the plugin.
|
||
11 years ago
|
@param parent The parent object for the plugin. Parent object must implement @ref TDevApi
|
||
15 years ago
|
interface. Otherwise the plugin will not be constructed.
|
||
|
@param name The internal name which identifies the plugin.*/
|
||
11 years ago
|
TDevProject(const TDevPluginInfo *info, TQObject *parent=0, const char *name=0);
|
||
15 years ago
|
/**Destructor.*/
|
||
11 years ago
|
virtual ~TDevProject();
|
||
15 years ago
|
|
||
|
/**Options of the project plugin.*/
|
||
|
enum Options {
|
||
|
UsesOtherBuildSystem = 0 /**<Project uses unknown or unspecified build system or build system is not used at all.*/,
|
||
|
UsesAutotoolsBuildSystem = 1 /**<Project uses autotools for building.*/,
|
||
14 years ago
|
UsesTQMakeBuildSystem =2 /**<Project uses qmake for building.*/
|
||
15 years ago
|
};
|
||
|
|
||
|
/**This method is invoked when the project is opened
|
||
|
(i.e. actually just after this class has been
|
||
|
instantiated).
|
||
|
@param dirName The project directory, which should afterwards be returned by
|
||
|
the projectDirectory() method.
|
||
|
@param projectName The project name, which is equivalent
|
||
|
to the project file name without the suffix.*/
|
||
15 years ago
|
virtual void openProject(const TQString &dirName, const TQString &projectName);
|
||
15 years ago
|
|
||
|
/**This method is invoked when the project is about to be closed.*/
|
||
|
virtual void closeProject() = 0;
|
||
|
|
||
|
/**Reimplement this method to set project plugin options. Default implementation
|
||
11 years ago
|
returns TDevProject::UsesOtherBuildSystem.*/
|
||
15 years ago
|
virtual Options options() const;
|
||
|
|
||
|
/**@return The canonical absolute directory of the project. Canonical means that
|
||
|
a path does not contain symbolic links or redundant "." or ".." elements.*/
|
||
15 years ago
|
virtual TQString projectDirectory() const = 0;
|
||
15 years ago
|
|
||
|
/**Returns the name of the project.*/
|
||
15 years ago
|
virtual TQString projectName() const = 0;
|
||
15 years ago
|
|
||
|
/**@return The environment variables that sould be set before running mainProgram().*/
|
||
|
virtual DomUtil::PairList runEnvironmentVars() const = 0;
|
||
|
|
||
|
/**@return The path to main binary program of the project.
|
||
|
@param relative if true then the path returned is relative to the project directory.*/
|
||
15 years ago
|
virtual TQString mainProgram() const = 0;
|
||
15 years ago
|
|
||
|
/**Absolute path (directory) from where the mainProgram() should be run.*/
|
||
15 years ago
|
virtual TQString runDirectory() const = 0;
|
||
15 years ago
|
|
||
|
/**The command line arguments that the mainProgram() should be run with.*/
|
||
15 years ago
|
virtual TQString runArguments() const = 0;
|
||
15 years ago
|
|
||
|
/**The command line arguments that the mainProgram() should be debugged with.*/
|
||
15 years ago
|
virtual TQString debugArguments() const = 0;
|
||
15 years ago
|
|
||
|
/**Returns the path (relative to the project directory)
|
||
|
of the active directory. All newly automatically generated
|
||
|
classes and files are usually added here.*/
|
||
15 years ago
|
virtual TQString activeDirectory() const = 0;
|
||
15 years ago
|
|
||
|
/**@return The canonical build directory of the project.
|
||
|
If the separate build directory is not supported, this should
|
||
|
return the same as projectDiretory(). Canonical means that
|
||
|
a path does not contain symbolic links or redundant "." or ".." elements.*/
|
||
15 years ago
|
virtual TQString buildDirectory() const = 0;
|
||
15 years ago
|
|
||
|
/**@return The list of all files in the project. The names are relative to
|
||
|
the project directory.*/
|
||
15 years ago
|
virtual TQStringList allFiles() const = 0;
|
||
15 years ago
|
|
||
|
/**@return The list of files that are part of the distribution but not under
|
||
|
project control. Used mainly to package and publish extra files among with the project.*/
|
||
15 years ago
|
virtual TQStringList distFiles() const = 0;
|
||
15 years ago
|
|
||
|
/**Adds a list of files to the project. Provided for convenience when adding many files.
|
||
|
@param fileList The list of file names relative to the project directory.*/
|
||
15 years ago
|
virtual void addFiles(const TQStringList &fileList) = 0;
|
||
15 years ago
|
|
||
|
/**Adds a file to the project.
|
||
|
@param fileName The file name relative to the project directory.*/
|
||
15 years ago
|
virtual void addFile(const TQString &fileName)= 0;
|
||
15 years ago
|
|
||
|
/**Removes a list of files from the project. Provided for convenience when removing many files.
|
||
|
@param fileList The list of file names relative to the project directory.*/
|
||
15 years ago
|
virtual void removeFiles(const TQStringList& fileList)= 0;
|
||
15 years ago
|
|
||
|
/**Removes a file from the project.
|
||
|
@param fileName The file name relative to the project directory.*/
|
||
15 years ago
|
virtual void removeFile(const TQString &fileName) = 0;
|
||
15 years ago
|
|
||
|
/**Notifies the project about changes to the files. Provided for
|
||
|
convenience when changing many files.
|
||
|
@param fileList The list of file names relative to the project directory..*/
|
||
15 years ago
|
virtual void changedFiles(const TQStringList &fileList);
|
||
15 years ago
|
|
||
|
/**Notifies the project of a change to one of the files.
|
||
|
@param fileName The file name relative to the project directory.*/
|
||
15 years ago
|
virtual void changedFile(const TQString &fileName);
|
||
15 years ago
|
|
||
|
/**@return true if the file @p absFileName is a part of the project.
|
||
|
@param absFileName Absolute name of a file to check.*/
|
||
15 years ago
|
virtual bool isProjectFile(const TQString &absFileName);
|
||
15 years ago
|
|
||
|
/**@return The path (relative to the project directory) of the file @p absFileName.
|
||
|
@param absFileName Absolute name of a file.*/
|
||
15 years ago
|
virtual TQString relativeProjectFile(const TQString &absFileName);
|
||
15 years ago
|
|
||
|
/**@return The list of files known to the project through symlinks.*/
|
||
15 years ago
|
virtual TQStringList symlinkProjectFiles();
|
||
15 years ago
|
|
||
|
protected:
|
||
|
|
||
|
/** Default implementation of runDirectory method.
|
||
|
* Uses 'projectPluginName' to obtain configuration from
|
||
|
* project DOM and returns:
|
||
|
*
|
||
|
* if /<projectPluginName>/run/directoryradio == executable
|
||
|
* The directory where the executable is.
|
||
|
* if /<projectPluginName>/run/directoryradio == build
|
||
|
* The build directory.
|
||
|
* if /kdevautoproject/run/directoryradio == custom
|
||
|
* The custom directory absolute path.
|
||
|
* Derived classes are supposed to explicitly call this implementation
|
||
|
*/
|
||
15 years ago
|
TQString defaultRunDirectory(const TQString& projectPluginName) const;
|
||
15 years ago
|
|
||
|
private slots:
|
||
|
void buildFileMap();
|
||
|
void slotBuildFileMap();
|
||
15 years ago
|
void slotAddFilesToFileMap(const TQStringList & fileList );
|
||
|
void slotRemoveFilesFromFileMap(const TQStringList & fileList );
|
||
15 years ago
|
|
||
|
signals:
|
||
|
/**Emitted when a new list of files has been added to the
|
||
|
project. Provided for convenience when many files were added.
|
||
|
@param fileList The file names relative to the project directory.*/
|
||
15 years ago
|
void addedFilesToProject(const TQStringList& fileList);
|
||
15 years ago
|
|
||
|
/**Emitted when a list of files has been removed from the project.
|
||
|
Provided for convenience when many files were removed.
|
||
|
@param fileList The file names relative to the project directory.*/
|
||
15 years ago
|
void removedFilesFromProject(const TQStringList& fileList);
|
||
15 years ago
|
|
||
|
/**Emitted when a list of files has changed in the project.
|
||
|
@param fileList The file names relative to the project directory.*/
|
||
15 years ago
|
void changedFilesInProject(const TQStringList& fileList);
|
||
15 years ago
|
|
||
|
/**Emitted when one compile related command (make, make install, make ...) ends sucessfuly.
|
||
|
Used to reparse the files after a sucessful compilation.*/
|
||
|
void projectCompiled();
|
||
|
|
||
|
/**Emitted when the active directory of the project changes
|
||
|
* @param olddir The old active directory
|
||
|
* @param newdir The new active directory
|
||
|
*/
|
||
15 years ago
|
void activeDirectoryChanged( const TQString& olddir, const TQString& newdir );
|
||
15 years ago
|
|
||
|
private:
|
||
|
class Private;
|
||
|
Private *d;
|
||
|
};
|
||
|
|
||
|
#endif
|