Fix no newlines warnings. Patch by Peter Oberndorfer
[kdevelopdvcssupport.git] / shell / project.h
blobe27549cd555faeac8daebbb839e7c17e7a0667cf
1 /* This file is part of the KDE project
2 Copyright 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
3 Copyright 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
4 Copyright 2002-2003 Roberto Raggi <roberto@kdevelop.org>
5 Copyright 2002 Simon Hausmann <hausmann@kde.org>
6 Copyright 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
7 Copyright 2003 Mario Scalas <mario.scalas@libero.it>
8 Copyright 2003-2004 Alexander Dymo <adymo@kdevelop.org>
9 Copyright 2006 Matt Rogers <mattr@kde.org>
10 Copyright 2007 Andreas Pakulat <apaku@gmx.de>
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License as published by the Free Software Foundation; either
15 version 2 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Library General Public License for more details.
22 You should have received a copy of the GNU Library General Public License
23 along with this library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA.
27 #ifndef KDEVPROJECT_H
28 #define KDEVPROJECT_H
30 #include <kurl.h>
32 #include <interfaces/iproject.h>
34 #include "shellexport.h"
36 template<typename T> class QList;
38 class KJob;
40 namespace KDevelop
43 class IProjectFileManager;
44 class IBuildSystemManager;
45 class ProjectFileItem;
46 class PersistentHash;
48 /**
49 * \brief Object which represents a KDevelop project
51 * Provide better descriptions
53 class KDEVPLATFORMSHELL_EXPORT Project : public IProject
55 Q_OBJECT
56 public:
57 /**
58 * Constructs a project.
60 * @param parent The parent object for the plugin.
62 Project(QObject *parent = 0);
64 /// Destructor.
65 virtual ~Project();
67 /** Get a list of all files in the project */
68 virtual int fileCount() const;
69 virtual ProjectFileItem* fileAt( int i ) const;
71 virtual QList<ProjectFileItem*> files() const;
73 virtual QList<ProjectFileItem*> filesForUrl( const KUrl& ) const;
74 virtual QList<ProjectFolderItem*> foldersForUrl(const KUrl& ) const;
76 QString projectTempFile() const;
77 QString developerTempFile() const;
78 KUrl developerFileUrl() const;
79 virtual void reloadModel();
80 virtual KUrl projectFileUrl() const;
81 virtual KSharedConfig::Ptr projectConfiguration() const;
83 virtual void addToFileSet( const IndexedString& );
84 virtual void removeFromFileSet( const IndexedString& );
85 virtual QSet<IndexedString> fileSet() const;
86 public Q_SLOTS:
87 /**
88 * @brief Open a project
89 * This method opens a project and starts the process of loading the
90 * data for the project from disk.
91 * @param projectFileUrl The url pointing to the location of the project
92 * file to load
93 * The project name is taken from the Name key in the project file in
94 * the 'General' group
96 virtual Q_SCRIPTABLE bool open(const KUrl &projectFileUrl);
98 /** This method is invoked when the project needs to be closed. */
99 virtual Q_SCRIPTABLE void close();
102 * @brief Get the project folder
103 * @return The canonical absolute directory of the project.
105 virtual Q_SCRIPTABLE const KUrl folder() const;
107 /** Returns the name of the project. */
108 virtual Q_SCRIPTABLE QString name() const;
111 * Get the file manager for the project
113 * @return the file manager for the project, if one exists; otherwise null
115 IProjectFileManager* projectFileManager() const;
118 * Get the build system manager for the project
120 * @return the build system manager for the project, if one exists; otherwise null
122 IBuildSystemManager* buildSystemManager() const;
124 IPlugin* versionControlPlugin() const;
127 * Get the plugin that manages the project
128 * This can be used to get other interfaces like IBuildSystemManager
130 IPlugin* managerPlugin() const;
133 * Set the manager plugin for the project.
135 void setManagerPlugin( IPlugin* manager );
138 * With this the top-level project item can be retrieved
140 ProjectFolderItem* projectItem() const;
143 * Find the url relative to the project directory equivalent to @a absoluteUrl.
144 * This function does not check to see if the file is contained within the
145 * project; for that, use inProject().
147 * @param absoluteUrl Absolute url to convert
148 * @deprecated use KUrl::relativeUrl instead
149 * @returns absoluteUrl relative to projectDirectory()
151 KUrl relativeUrl(const KUrl& absoluteUrl) const;
154 * Returns the absolute url corresponding to the given \a relativeUrl and
155 * the project directory.
157 * @param relativeUrl Relative url to convert
159 * @returns the absolute URL relative to projectDirectory()
161 KUrl urlRelativeToProject(const KUrl& relativeUrl) const;
164 * Check if the url specified by @a url is part of the project.
165 * @a url can be either a relative url (to the project directory) or
166 * an absolute url.
168 * @param url the url to check
170 * @return true if the url @a url is a part of the project.
172 bool inProject(const KUrl &url) const;
175 * The persistent AST storage for this project.
177 // PersistentHash *persistentHash() const;
179 private:
180 Q_PRIVATE_SLOT(d, void importDone(KJob*))
182 class ProjectPrivate* const d;
186 #endif