File indexing completed on 2024-04-28 04:36:30

0001 /*
0002     SPDX-FileCopyrightText: 2010 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_IPROJECTPROVIDER_H
0008 #define KDEVPLATFORM_IPROJECTPROVIDER_H
0009 
0010 #include <QWidget>
0011 #include "interfacesexport.h"
0012 
0013 class QUrl;
0014 
0015 namespace KDevelop
0016 {
0017 
0018 class VcsJob;
0019 
0020 class KDEVPLATFORMINTERFACES_EXPORT IProjectProviderWidget : public QWidget
0021 {
0022     Q_OBJECT
0023     public:
0024         explicit IProjectProviderWidget(QWidget* parent = nullptr);
0025 
0026         /**
0027          * @returns a job that will create a working copy given the current state of the widget.
0028          *
0029          * @param destinationDirectory where the project will be downloaded.
0030          */
0031         virtual VcsJob* createWorkingCopy(const QUrl & destinationDirectory) = 0;
0032 
0033         /** @returns whether we have a correct location in the widget. */
0034         virtual bool isCorrect() const = 0;
0035 
0036     Q_SIGNALS:
0037         void changed(const QString& name);
0038 };
0039 
0040 class KDEVPLATFORMINTERFACES_EXPORT IProjectProvider
0041 {
0042     public:
0043         virtual ~IProjectProvider();
0044 
0045         virtual QString name() const = 0;
0046 
0047         virtual IProjectProviderWidget* providerWidget(QWidget* parent) = 0;
0048 };
0049 
0050 }
0051 Q_DECLARE_INTERFACE( KDevelop::IProjectProvider, "org.kdevelop.IProjectProvider" )
0052 
0053 #endif