/usr/include/kdevplatform/interfaces/iprojectcontroller.h is in kdevelop-dev 4:5.2.1-1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | /* This file is part of KDevelop
Copyright 2006 Adam Treat <treat@kde.org>
Copyright 2007 Andreas Pakulat <apaku@gmx.de>
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
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDEVPLATFORM_IPROJECTCONTROLLER_H
#define KDEVPLATFORM_IPROJECTCONTROLLER_H
#include <QObject>
#include <QList>
#include <QUrl>
#include "interfacesexport.h"
namespace KDevelop
{
class IProject;
class ProjectBuildSetModel;
class ProjectModel;
class ProjectBaseItem;
class ProjectChangesModel;
/**
* @class IProjectController
*/
class KDEVPLATFORMINTERFACES_EXPORT IProjectController : public QObject
{
Q_OBJECT
public:
explicit IProjectController( QObject *parent = nullptr );
~IProjectController() override;
Q_INVOKABLE virtual KDevelop::IProject* projectAt( int ) const = 0;
Q_INVOKABLE virtual int projectCount() const = 0;
Q_INVOKABLE virtual QList<IProject*> projects() const = 0;
/**
* Provides access to the model representing the open projects
* @returns the model containing the projects and their items
*/
virtual ProjectModel* projectModel() = 0;
/**
* @returns an instance to the model that keeps track of the state
* of the files per project.
*/
virtual ProjectChangesModel* changesModel() = 0;
virtual ProjectBuildSetModel* buildSetModel() = 0;
/**
* Find an open project using the name of the project
* @param name the name of the project to be found
* @returns the project or null if no project with that name is open
*/
virtual KDevelop::IProject* findProjectByName( const QString& name ) = 0;
/**
* Finding an open project for a given file or folder in the project
* @param url the url of a file/folder belonging to an open project
* @returns the first open project containing the url or null if no such
* project can be found
*/
virtual IProject* findProjectForUrl( const QUrl& url ) const = 0;
/**
* Checks whether the given project name is used already or not. The project
* controller supports only 1 project with a given name to be open at any time
* @param name the name of the project to be opened or created
* @returns whether the name is already used for an open project
*/
virtual bool isProjectNameUsed( const QString& name ) const = 0;
virtual QUrl projectsBaseDirectory() const = 0;
enum FormattingOptions {
FormatHtml,
FormatPlain
};
/**
* Returns a pretty short representation of the base path of the url, considering the currently loaded projects:
* When the file is part of a currently loaded project, that projects name is shown as prefix instead of the
* the full file path.
* The returned path always has a training slash.
* @param format formatting used for the string
*/
virtual QString prettyFilePath(const QUrl& url, FormattingOptions format = FormatHtml) const = 0;
/**
* Returns a pretty short representation of the given url, considering the currently loaded projects:
* When the file is part of a currently loaded project, that projects name is shown as prefix instead of the
* the full file path.
* @param format formatting used for the string
*/
virtual QString prettyFileName(const QUrl& url, FormattingOptions format = FormatHtml) const = 0;
/**
* @returns whether project files should be parsed or not
*/
static bool parseAllProjectSources();
public Q_SLOTS:
/**
* Tries finding a project-file for the given source-url and opens it.
* If no .kdev4 project file is found, the user is asked to import a project.
*/
virtual void openProjectForUrl( const QUrl &sourceUrl ) = 0;
/**
* open the project from the given kdev4 project file. This only reads
* the file and starts creating the project model from it. The opening process
* is finished once @ref projectOpened signal is emitted.
* @param url a kdev4 project file top open
*/
virtual void openProject( const QUrl & url = QUrl() ) = 0;
/**
* close the given project. Closing the project is done in steps and
* the @ref projectClosing and @ref projectClosed signals are emitted. Only when
* the latter signal is emitted it is guaranteed that the project has been closed.
* The @ref IProject object will be deleted after the closing has finished.
*/
virtual void closeProject( IProject* ) = 0;
/**
* Close all projects
*
* This usually calls closeProject() on all controlled projects
* @sa closeProject()
*/
virtual void closeAllProjects() = 0;
virtual void configureProject( IProject* ) = 0;
/// Schedules all files of the @p project for reparsing by @see BackgroundParser
virtual void reparseProject( IProject* project, bool ForceUpdate = false ) = 0;
// virtual void changeCurrentProject( KDevelop::ProjectBaseItem* ) = 0;
Q_SIGNALS:
/**
* Emitted right before a project is started to be loaded.
*
* At this point all sanity checks have been done, so the project
* is really going to be loaded. Will be followed by @ref projectOpened signal
* when loading completes or by @ref projectOpeningAborted if there are errors during loading
* or it is aborted.
*
* @param project the project that is about to be opened.
*/
void projectAboutToBeOpened( KDevelop::IProject* project );
/**
* emitted after a project is completely opened and the project model
* has been populated.
* @param project the project that has been opened.
*/
void projectOpened( KDevelop::IProject* project );
/**
* emitted when starting to close a project that has been completely loaded before
* (the @ref projectOpened signal has been emitted).
* @param project the project that is going to be closed.
*/
void projectClosing( KDevelop::IProject* project );
/**
* emitted when a project has been closed completely.
* The project object is still valid, the deletion will be done
* delayed during the next run of the event loop.
* @param project the project that has been closed.
*/
void projectClosed( KDevelop::IProject* project );
/**
* emitted when a project could not be loaded correctly or loading was aborted.
* @p project contents may not be initialized properly.
* @param project the project which loading has been aborted.
*/
void projectOpeningAborted( KDevelop::IProject* project );
/**
* emitted whenever the project configuration dialog accepted
* changes
* @param project the project whose configuration has changed
*/
void projectConfigurationChanged( KDevelop::IProject* project );
};
}
#endif
|