diff options
Diffstat (limited to 'src/plugins/projectexplorer/target.h')
-rw-r--r-- | src/plugins/projectexplorer/target.h | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 1b05c9c07b..69e4fb4459 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -43,12 +43,12 @@ namespace Utils { class Environment; } namespace ProjectExplorer { class RunConfiguration; -class ToolChain; class BuildConfiguration; class DeployConfiguration; class IBuildConfigurationFactory; class DeployConfigurationFactory; class IRunConfigurationFactory; +class Profile; class Project; class BuildConfigWidget; @@ -59,11 +59,14 @@ class PROJECTEXPLORER_EXPORT Target : public ProjectConfiguration Q_OBJECT public: - virtual ~Target(); + Target(Project *parent, Profile *p); + ~Target(); - virtual BuildConfigWidget *createConfigWidget() = 0; Project *project() const; + // Profile: + Profile *profile() const; + // Build configuration void addBuildConfiguration(BuildConfiguration *configuration); bool removeBuildConfiguration(BuildConfiguration *configuration); @@ -72,8 +75,6 @@ public: BuildConfiguration *activeBuildConfiguration() const; void setActiveBuildConfiguration(BuildConfiguration *configuration); - virtual IBuildConfigurationFactory *buildConfigurationFactory() const = 0; - // DeployConfiguration void addDeployConfiguration(DeployConfiguration *dc); bool removeDeployConfiguration(DeployConfiguration *dc); @@ -82,10 +83,6 @@ public: DeployConfiguration *activeDeployConfiguration() const; void setActiveDeployConfiguration(DeployConfiguration *configuration); - QList<Core::Id> availableDeployConfigurationIds(); - QString displayNameForDeployConfigurationId(Core::Id &id); - DeployConfiguration *createDeployConfiguration(Core::Id id); - // Running QList<RunConfiguration *> runConfigurations() const; void addRunConfiguration(RunConfiguration *runConfiguration); @@ -108,10 +105,12 @@ public: QString toolTip() const; void setToolTip(const QString &text); - virtual QList<ToolChain *> possibleToolChains(BuildConfiguration *) const; - virtual ToolChain *preferredToolChain(BuildConfiguration *) const; + QVariantMap toMap() const; - virtual QVariantMap toMap() const; + void createDefaultSetup(); + void updateDefaultBuildConfigurations(); + void updateDefaultDeployConfigurations(); + void updateDefaultRunConfigurations(); signals: void targetEnabled(bool); @@ -119,6 +118,8 @@ signals: void overlayIconChanged(); void toolTipChanged(); + void profileChanged(); + // TODO clean up signal names // might be better to also have aboutToRemove signals void removedRunConfiguration(ProjectExplorer::RunConfiguration *); @@ -143,14 +144,23 @@ signals: void deployConfigurationEnabledChanged(); void runConfigurationEnabledChanged(); -protected: - Target(Project *parent, const Core::Id id); + /// Emitted whenever the project should (re-)evaluate the build system + void requestBuildSystemEvaluation(); + /// Emitted whenever the current build configuration has finished to initialize its build directory. + void buildDirectoryInitialized(); + /// Emitted whenever the current build configuartion changed or the build directory of the current + /// build configuration was changed. + void buildDirectoryChanged(); - virtual ProjectExplorer::IDevice::ConstPtr currentDevice() const; +public slots: + void onRequestBuildSystemEvaluation(); + void onBuildDirectoryInitialized(); + void onBuildDirectoryChanged(); +protected: void setEnabled(bool); - virtual bool fromMap(const QVariantMap &map); + bool fromMap(const QVariantMap &map); protected slots: void updateDeviceState(); @@ -161,31 +171,13 @@ private slots: void changeDeployConfigurationEnabled(); void changeRunConfigurationEnabled(); + void handleProfileUpdates(ProjectExplorer::Profile *p); + void handleProfileRemoval(ProjectExplorer::Profile *p); + private: TargetPrivate *d; -}; -class PROJECTEXPLORER_EXPORT ITargetFactory : - public QObject -{ - Q_OBJECT - -public: - explicit ITargetFactory(QObject *parent = 0); - - virtual QList<Core::Id> supportedTargetIds() const = 0; - virtual bool supportsTargetId(const Core::Id id) const = 0; - - // used to translate the types to names to display to the user - virtual QString displayNameForId(const Core::Id id) const = 0; - - virtual bool canCreate(Project *parent, const Core::Id id) const = 0; - virtual Target *create(Project *parent, const Core::Id id) = 0; - virtual bool canRestore(Project *parent, const QVariantMap &map) const = 0; - virtual Target *restore(Project *parent, const QVariantMap &map) = 0; - -signals: - void canCreateTargetIdsChanged(); + friend class Project; }; } // namespace ProjectExplorer |