File indexing completed on 2024-04-28 04:37:18

0001 /*
0002     SPDX-FileCopyrightText: 2009 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_LAUNCHCONFIGURATION_H
0008 #define KDEVPLATFORM_LAUNCHCONFIGURATION_H
0009 
0010 #include <interfaces/ilaunchconfiguration.h>
0011 
0012 #include "shellexport.h"
0013 
0014 #include <KConfigGroup>
0015 
0016 class QString;
0017 
0018 namespace KDevelop
0019 {
0020 
0021 class LaunchConfigurationType;
0022 class IProject;
0023 class LaunchConfigurationPrivate;
0024 
0025 /**
0026  * @copydoc KDevelop::ILaunchConfiguration
0027  */
0028 class KDEVPLATFORMSHELL_EXPORT LaunchConfiguration : public QObject, public ILaunchConfiguration
0029 {
0030 Q_OBJECT
0031 public:
0032     explicit LaunchConfiguration( const KConfigGroup&, IProject* = nullptr, QObject* = nullptr );
0033     ~LaunchConfiguration() override;
0034 
0035     static QString LaunchConfigurationNameEntry();
0036     static QString LaunchConfigurationTypeEntry();
0037 
0038     /**
0039      * Change the name of this launch configuration
0040      * @param name the new name for the launch configuration
0041      */
0042     void setName( const QString& name );
0043     
0044     /**
0045      * Changes the type of this launch configuration. Note that
0046      * this removes all existing config values from this configuration
0047      * @param typeId the id of the new type
0048      */
0049     void setType( const QString& typeId );
0050 
0051     /**
0052      * @copydoc KDevelop::ILaunchConfiguration::config()
0053      */
0054     const KConfigGroup config() const override;
0055     
0056     /**
0057      * @copydoc KDevelop::ILaunchConfiguration::type()
0058      */
0059     LaunchConfigurationType* type() const override;
0060     
0061     /**
0062      * @copydoc KDevelop::ILaunchConfiguration::name()
0063      */
0064     QString name() const override;
0065     
0066     /**
0067      * @copydoc KDevelop::ILaunchConfiguration::project()
0068      */
0069     IProject* project() const override;
0070     void save();
0071     
0072     QString configGroupName() const;
0073     
0074     QString launcherForMode( const QString& mode ) const;
0075     void setLauncherForMode( const QString& mode, const QString& id );
0076     
0077     KConfigGroup config() override;
0078     
0079 Q_SIGNALS:
0080     void nameChanged( LaunchConfiguration* );
0081     void typeChanged( LaunchConfigurationType* );
0082 
0083 private:
0084     const QScopedPointer<class LaunchConfigurationPrivate> d_ptr;
0085     Q_DECLARE_PRIVATE(LaunchConfiguration)
0086 };
0087 
0088 }
0089 
0090 #endif
0091