summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/project.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2010-02-08 15:50:06 +0100
committerTobias Hunger <tobias.hunger@nokia.com>2010-02-09 16:57:37 +0100
commitd1bdfcc363970eca53077cdab79de2d3cf24218a (patch)
tree100cc0dc41f660b72277fa018c8a46454d0686b4 /src/plugins/projectexplorer/project.h
parent8ee2521fe53cec55534b079b0d5b21b6b028676f (diff)
downloadqt-creator-d1bdfcc363970eca53077cdab79de2d3cf24218a.tar.gz
Integrate target support
* Ease cross device development by introducing 'targets' which group build- and runsettings that are valid for this one target Most of the kudos for the code review go to dt. Con, thorbjorn, ckandler and others did also review parts of this patch. Reviewed-by: dt
Diffstat (limited to 'src/plugins/projectexplorer/project.h')
-rw-r--r--src/plugins/projectexplorer/project.h84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h
index 3d163912b1..f9b25b9f8b 100644
--- a/src/plugins/projectexplorer/project.h
+++ b/src/plugins/projectexplorer/project.h
@@ -31,14 +31,12 @@
#define PROJECT_H
#include "projectexplorer_export.h"
+#include "target.h"
#include <QtCore/QObject>
+#include <QtCore/QSet>
#include <QtGui/QFileSystemModel>
-QT_BEGIN_NAMESPACE
-class QMenu;
-QT_END_NAMESPACE
-
namespace Core {
class IFile;
}
@@ -46,17 +44,12 @@ class IFile;
namespace ProjectExplorer {
class BuildManager;
-class BuildStep;
class BuildConfigWidget;
class IProjectManager;
-class RunConfiguration;
class EditorConfiguration;
-class Environment;
class ProjectNode;
-class PersistentSettingsWriter;
-class PersistentSettingsReader;
-class BuildConfiguration;
-class IBuildConfigurationFactory;
+class Target;
+class ITargetFactory;
class PROJECTEXPLORER_EXPORT Project
: public QObject
@@ -81,28 +74,29 @@ public:
virtual QList<Project *> dependsOn() = 0; //NBS TODO implement dependsOn
virtual bool isApplication() const = 0;
+ bool hasActiveBuildSettings() const;
- virtual bool hasBuildSettings() const;
-
- // Build configuration
- void addBuildConfiguration(BuildConfiguration *configuration);
- void removeBuildConfiguration(BuildConfiguration *configuration);
+ // EditorConfiguration:
+ EditorConfiguration *editorConfiguration() const;
- QList<BuildConfiguration *> buildConfigurations() const;
- BuildConfiguration *activeBuildConfiguration() const;
- void setActiveBuildConfiguration(BuildConfiguration *configuration);
+ // Target:
- virtual IBuildConfigurationFactory *buildConfigurationFactory() const = 0;
+ // Note: You can only add a specific kind of target (identified by id)
+ // once.
+ QSet<QString> supportedTargetIds() const;
+ QSet<QString> possibleTargetIds() const;
+ bool canAddTarget(const QString &id) const;
- // Running
- QList<RunConfiguration *> runConfigurations() const;
- void addRunConfiguration(RunConfiguration* runConfiguration);
- void removeRunConfiguration(RunConfiguration* runConfiguration);
+ void addTarget(Target *target);
+ void removeTarget(Target *target);
- RunConfiguration* activeRunConfiguration() const;
- void setActiveRunConfiguration(RunConfiguration* runConfiguration);
+ QList<Target *> targets() const;
+ // Note: activeTarget can be 0 (if no targets are defined).
+ Target *activeTarget() const;
+ void setActiveTarget(Target *target);
+ Target *target(const QString &id) const;
- EditorConfiguration *editorConfiguration() const;
+ virtual ITargetFactory *targetFactory() const = 0;
void saveSettings();
bool restoreSettings();
@@ -117,14 +111,14 @@ public:
// TODO: generalize to find source(s) of generated files?
virtual QString generatedUiHeader(const QString &formFile) const;
+ static QString makeUnique(const QString &preferedName, const QStringList &usedNames);
+
// C++ specific
// TODO do a C++ project as a base ?
virtual QByteArray predefinedMacros(const QString &fileName) const;
virtual QStringList includePaths(const QString &fileName) const;
virtual QStringList frameworkPaths(const QString &fileName) const;
- static QString makeUnique(const QString &preferedName, const QStringList &usedNames);
-
// Serialize all data into a QVariantMap. This map is then saved
// in the .user file of the project.
//
@@ -138,17 +132,19 @@ public:
signals:
void fileListChanged();
-// TODO clean up signal names
-// might be better to also have aboutToRemove signals
- void activeBuildConfigurationChanged();
- void activeRunConfigurationChanged();
- void runConfigurationsEnabledStateChanged();
+ // Note: activeTarget can be 0 (if no targets are defined).
+ void activeTargetChanged(ProjectExplorer::Target *target);
+
+ void aboutToRemoveTarget(ProjectExplorer::Target *target);
+ void removedTarget(ProjectExplorer::Target *target);
+ void addedTarget(ProjectExplorer::Target *target);
- void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
- void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc);
+ void supportedTargetIdsChanged();
- void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
- void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
+ /// convenience signal emitted if the activeBuildConfiguration emits environmentChanged
+ /// or if the activeBuildConfiguration changes
+ /// (which theoretically might happen due to the active target changing).
+ void environmentChanged();
protected:
// restore all data from the map.
@@ -156,11 +152,15 @@ protected:
// Note: Do not forget to call your base class' fromMap method!
virtual bool fromMap(const QVariantMap &map);
+ void setSupportedTargetIds(const QSet<QString> &ids);
+
+private slots:
+ void changeEnvironment();
+
private:
- QList<BuildConfiguration *> m_buildConfigurations;
- BuildConfiguration *m_activeBuildConfiguration;
- QList<RunConfiguration *> m_runConfigurations;
- RunConfiguration* m_activeRunConfiguration;
+ QSet<QString> m_supportedTargetIds;
+ QList<Target *> m_targets;
+ Target *m_activeTarget;
EditorConfiguration *m_editorConfiguration;
};