File indexing completed on 2024-05-12 04:38:53
0001 /* 0002 SPDX-FileCopyrightText: 2007 Andreas Pakulat <apaku@gmx.de> 0003 SPDX-FileCopyrightText: 2007 Matthew Woehlke <mw_triad@users.sourceforge.net> 0004 SPDX-FileCopyrightText: 2008 Evgeniy Ivanov <powerfox@kde.ru> 0005 0006 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #ifndef KDEVPLATFORM_ICENTRALIZEDVERSIONCONTROL_H 0010 #define KDEVPLATFORM_ICENTRALIZEDVERSIONCONTROL_H 0011 0012 #include "ibasicversioncontrol.h" 0013 0014 namespace KDevelop 0015 { 0016 0017 /** 0018 * This is the interface that all Centralized Version Control plugins need to implement. 0019 * None of the methods in this interface are optional. 0020 * 0021 * This only works on a local checkout from the repository, if your plugin should 0022 * offer functionality that works solely on the server see the 0023 * IRepositoryVersionControl interface 0024 * 0025 */ 0026 class ICentralizedVersionControl : public KDevelop::IBasicVersionControl 0027 { 0028 public: 0029 ~ICentralizedVersionControl() override = default; 0030 0031 /** 0032 * this is for files only, it makes a file editable, this may be a no-op 0033 */ 0034 virtual VcsJob* edit( const QUrl& localLocation ) = 0; 0035 0036 /** 0037 * this is for files only, it makes a file un-editable, this may be a no-op 0038 * This is different from revert because it doesn't change the content of the 0039 * file (it may fail if the file has changed). 0040 */ 0041 virtual VcsJob* unedit( const QUrl& localLocation ) = 0; 0042 0043 /** 0044 * retrieves status information for a file or dir recursive is only 0045 * active for directories 0046 */ 0047 0048 /** 0049 * gives the revision of file/dir, that is the revision to which this files 0050 * was updated when update() was run the last time 0051 */ 0052 virtual VcsJob* localRevision( const QUrl& localLocation, 0053 VcsRevision::RevisionType ) = 0; 0054 0055 /** 0056 * The following two methods are part of the basic interface so other plugins 0057 * can depend on them, for example the appwizard. These two don't need a 0058 * valid VCS-dir, in fact they should be invoked with a local directory that 0059 * is either empty or contains a non-VCed project 0060 */ 0061 0062 /** 0063 * take a mapping of local to repository locations and import that into the repository 0064 */ 0065 virtual VcsJob* import(const QString & commitMessage, const QUrl & sourceDirectory, const VcsLocation & destinationRepository) = 0; 0066 }; 0067 0068 } 0069 0070 Q_DECLARE_INTERFACE( KDevelop::ICentralizedVersionControl, "org.kdevelop.ICentralizedVersionControl" ) 0071 0072 #endif