dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
iversioncontrol.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef IVERSIONCONTROL_H
29 #define IVERSIONCONTROL_H
30 
31 #include "core_global.h"
32 
33 #include <QtCore/QObject>
34 #include <QtCore/QString>
35 
36 namespace Core {
37 
38 class CORE_EXPORT IVersionControl : public QObject
39 {
40  Q_OBJECT
41 public:
42  enum Operation { AddOperation, DeleteOperation, OpenOperation };
43 
44  IVersionControl(QObject *parent = 0)
45  : QObject(parent)
46  {
47  }
48  virtual ~IVersionControl() {}
49 
50  virtual QString name() const = 0;
51 
52  virtual bool isEnabled() const = 0;
53 
57  virtual void setEnabled(bool enabled) = 0;
58 
63  virtual bool managesDirectory(const QString &filename) const = 0;
64 
76  virtual QString findTopLevelForDirectory(const QString &directory) const = 0;
77 
81  virtual bool supportsOperation(Operation operation) const = 0;
82 
89  virtual bool vcsOpen(const QString &fileName) = 0;
90 
99  virtual bool vcsAdd(const QString &filename) = 0;
100 
108  virtual bool vcsDelete(const QString &filename) = 0;
109 
110 signals:
111  void repositoryChanged(const QString &repository);
112  void filesChanged(const QStringList &files);
113 
114  // TODO: ADD A WAY TO DETECT WHETHER A FILE IS MANAGED, e.g
115  // virtual bool sccManaged(const QString &filename) = 0;
116 };
117 
118 } // namespace Core
119 
120 #endif // IVERSIONCONTROL_H
IVersionControl(QObject *parent=0)