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 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef KDEVPLATFORM_IBROWSABLEVERSIONCONTROL_H
0009 #define KDEVPLATFORM_IBROWSABLEVERSIONCONTROL_H
0010 
0011 #include <QObject>
0012 #include "../vcsrevision.h"
0013 
0014 class QString;
0015 
0016 namespace KDevelop
0017 {
0018 
0019 class VcsJob;
0020 
0021 class IBrowsableVersionControl
0022 {
0023 public:
0024     virtual ~IBrowsableVersionControl() {}
0025 
0026     /**
0027      * retrieve the last revision in which the repository location was changed
0028      */
0029     virtual VcsJob* repositoryRevision( const QString& repoLocation,
0030                                         VcsRevision::RevisionType ) = 0;
0031 
0032     /**
0033      * Retrieve the history of the repository location
0034      *
0035      * @param rev List @p rev and earlier. The default is HEAD.
0036      * @param limit Restrict to the most recent @p limit entries. Note that the
0037      * limit is @e advisory and may be ignored.
0038      */
0039     virtual VcsJob* log( const QString& repoLocation,
0040                          const VcsRevision& rev,
0041                          unsigned int limit ) = 0;
0042 
0043     /**
0044      * Retrieve the history of a given local url
0045      *
0046      * @param rev List @p rev and earlier. The default is HEAD.
0047      * @param limit Do not show entries earlier than @p limit. Note that the
0048      * limit is @e advisory and may be ignored.
0049      */
0050     virtual VcsJob* log( const QUrl& localLocation,
0051                          const VcsRevision& rev,
0052                          const VcsRevision& limit ) = 0;
0053 
0054     /**
0055      * Get the changes made by a particular revision
0056      *
0057      * @param rev Show information about the revision @p rev.
0058      * @param repoLocation Any repository path that specifies what VCS server
0059      * is to be queried. For VCS's that support global versioning, the actual
0060      * path is unimportant (and ignored), as long as it contains the repository
0061      * root. Otherwise look up the change associated with the requested path.
0062      *
0063      * @note VcsRevision objects with type VcsRevision::FileNumber may store the
0064      * associated path internally, in which case @p repoLocation may be ignored.
0065      */
0066     virtual VcsJob* change( const VcsRevision& rev,
0067                             const QString& repoLocation ) = 0;
0068 
0069     /**
0070      * Retrieve a list of entries in the given repository location
0071      */
0072     virtual VcsJob* ls( const QString& repoLocation, const VcsRevision& rev ) = 0;
0073 
0074     /**
0075      * Retrieve a file from the repository without checking it out
0076      */
0077     virtual VcsJob* cat( const QString& repoLocation, const VcsRevision& rev ) = 0;
0078 
0079 
0080 };
0081 
0082 }
0083 
0084 Q_DECLARE_INTERFACE( KDevelop::IBrowsableVersionControl, "org.kdevelop.IBrowsableVersionControl" )
0085 
0086 #endif
0087