1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
/*
SPDX-FileCopyrightText: 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
SPDX-FileCopyrightText: 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
SPDX-FileCopyrightText: 2002-2003 Roberto Raggi <roberto@kdevelop.org>
SPDX-FileCopyrightText: 2002 Simon Hausmann <hausmann@kde.org>
SPDX-FileCopyrightText: 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
SPDX-FileCopyrightText: 2003 Mario Scalas <mario.scalas@libero.it>
SPDX-FileCopyrightText: 2003-2004 Alexander Dymo <adymo@kdevelop.org>
SPDX-FileCopyrightText: 2006 Matt Rogers <mattr@kde.org>
SPDX-FileCopyrightText: 2007 Andreas Pakulat <apaku@gmx.de>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KDEVPLATFORM_IPROJECT_H
#define KDEVPLATFORM_IPROJECT_H
#include <QObject>
#include <KSharedConfig>
#include "interfacesexport.h"
class KJob;
template<typename T> class QList;
template<typename T> class QSet;
namespace KDevelop
{
class IPlugin;
class IProjectFileManager;
class IBuildSystemManager;
class Path;
class ProjectBaseItem;
class ProjectFileItem;
class ProjectFolderItem;
class IndexedString;
/**
* \brief Object which represents a KDevelop project
*
* Provide better descriptions
*/
class KDEVPLATFORMINTERFACES_EXPORT IProject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString projectName READ name CONSTANT)
public:
/**
* Constructs a project.
*
* @param parent The parent object for the plugin.
*/
explicit IProject(QObject *parent = nullptr);
/// Destructor.
~IProject() override;
/**
* Get the file manager for the project
*
* @return the file manager for the project, if one exists; otherwise null
*/
virtual IProjectFileManager* projectFileManager() const = 0;
/**
* Get the build system manager for the project
*
* @return the build system manager for the project, if one exists; otherwise null
*/
virtual IBuildSystemManager* buildSystemManager() const = 0;
/**
* Get the plugin that manages the project
* This can be used to get other interfaces like IBuildSystemManager
*/
virtual IPlugin* managerPlugin() const = 0;
/**
* Get the version control plugin for this project
* This may return 0 if the project is not under version control
* or version control has been disabled for this project
*/
virtual IPlugin* versionControlPlugin() const = 0;
/**
* With this the top-level project item can be retrieved
*/
virtual ProjectFolderItem* projectItem() const = 0;
/**
* @return all items with the corresponding @p path
*/
virtual QList<ProjectBaseItem*> itemsForPath( const IndexedString& path ) const = 0;
/**
* @return all file items with the corresponding @p file path
*/
virtual QList<ProjectFileItem*> filesForPath( const IndexedString& file ) const = 0;
/**
* @return all folder items with the corresponding @p folder path
*/
virtual QList<ProjectFolderItem*> foldersForPath( const IndexedString& folder ) const = 0;
/**
* @return the path to the project file
*/
virtual Path projectFile() const = 0;
/** Get the url of the project file.*/
virtual KSharedConfigPtr projectConfiguration() const = 0;
virtual void addToFileSet( ProjectFileItem* item ) = 0;
virtual void removeFromFileSet( ProjectFileItem* item ) = 0;
virtual QSet<IndexedString> fileSet() const = 0;
/** Returns whether the project is ready to be used or not.
A project won't be ready for use when it's being reloaded or still loading
*/
virtual bool isReady() const=0;
/**
* @brief Get the project path
* @return The canonical absolute directory of the project.
*/
virtual Path path() const = 0;
/** Returns the name of the project. */
virtual Q_SCRIPTABLE QString name() const = 0;
/**
* @brief Check if the project contains an item with the given @p path.
*
* @param path the path to check
*
* @return true if the path @a path is a part of the project.
*/
virtual bool inProject(const IndexedString &path) const = 0;
/**
* @brief Tells the project what job is reloading it
*
* It's useful so that we can tell whether the project manager is busy or not.
*/
virtual void setReloadJob(KJob* job) = 0;
Q_SIGNALS:
/**
* Gets emitted whenever a file was added to the project.
*/
void fileAddedToSet( KDevelop::ProjectFileItem* item );
/**
* Gets emitted whenever a file was removed from the project.
*/
void fileRemovedFromSet( KDevelop::ProjectFileItem* item );
public Q_SLOTS:
/** Make the model to reload */
virtual void reloadModel() = 0;
/** This method is invoked when the project needs to be closed. */
virtual void close() = 0;
};
}
#endif
|