File indexing completed on 2024-05-19 04:40:08
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_VCSLOCATIONWIDGET_H 0008 #define KDEVPLATFORM_VCSLOCATIONWIDGET_H 0009 0010 #include <QWidget> 0011 #include <vcs/vcsexport.h> 0012 0013 namespace KDevelop 0014 { 0015 class VcsLocation; 0016 0017 /** 0018 * Provides a widget to be used to ask the user for a VersionControl location. 0019 * 0020 * Every VCS plugin will provide their own to be able to construct VcsLocations 0021 * from the UI in a VCS-dependent fashion. 0022 */ 0023 class KDEVPLATFORMVCS_EXPORT VcsLocationWidget : public QWidget 0024 { 0025 Q_OBJECT 0026 public: 0027 explicit VcsLocationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {}); 0028 0029 /** @returns the VcsLocation specified in the widget. */ 0030 virtual VcsLocation location() const=0; 0031 0032 /** @returns whether we have a correct location in the widget. */ 0033 virtual bool isCorrect() const=0; 0034 0035 /** @returns a proposed project name to be used as a hint for an identifier 0036 * for the VcsLocation. 0037 */ 0038 virtual QString projectName() const=0; 0039 0040 /** Sets the location by a respective URL 0041 * @param remoteLocation the URL used to access a remote repository 0042 * @see IBasicVersionControl::isValidRemoteRepositoryUrl 0043 */ 0044 virtual void setLocation(const QUrl& remoteLocation) = 0; 0045 0046 Q_SIGNALS: 0047 void changed(); 0048 }; 0049 0050 } 0051 #endif 0052 0053