• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Extension Interfaces Library
 

KDevelop Extension Interfaces Library

  • lib
  • interfaces
  • extensions
kdevversioncontrol.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
3 Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
4 Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
5 Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
6 Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.org>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22*/
23#ifndef KDEVVERSIONCONTROL_H
24#define KDEVVERSIONCONTROL_H
25
26#include <tqobject.h>
27#include <tqstring.h>
28#include <tqwidget.h>
29#include <tqmap.h>
30#include <tqvaluelist.h>
31
32#include <kdevplugin.h>
33
44struct VCSFileInfo
45{
47 enum FileState {
48 Unknown ,
49 Added ,
50 Uptodate ,
51 Modified ,
52 Conflict ,
53 Sticky ,
54 NeedsPatch ,
55 NeedsCheckout ,
56 Directory ,
57 Deleted ,
58 Replaced
59 };
60
62 VCSFileInfo() {}
68 VCSFileInfo( TQString fn, TQString workRev, TQString repoRev, FileState aState )
69 : fileName(fn), workRevision(workRev), repoRevision(repoRev), state(aState) {}
70
72 TQString fileName; // Yeah, _just_ the file name ;-)
74 TQString workRevision;
76 TQString repoRevision;
78 FileState state;
79
81 TQString toString() const
82 {
83 return "(" + fileName + ", " + workRevision + ", " + repoRevision + ", " + state2String( state ) + ")";
84 }
85
87 static TQString state2String( FileState state )
88 {
89 switch (state)
90 {
91 case Added: return "added";
92 case Uptodate: return "up-to-date";
93 case Modified: return "modified";
94 case Conflict: return "conflict";
95 case Sticky: return "sticky";
96 case NeedsPatch: return "needs patch";
97 case NeedsCheckout: return "needs check-out";
98 case Directory: return "directory";
99 case Deleted: return "deleted";
100 case Replaced: return "replaced";
101 case Unknown:
102 default:
103 return "unknown";
104 }
105 }
106
107};
108
113typedef TQMap<TQString,VCSFileInfo> VCSFileInfoMap;
114
115class KDevVCSFileInfoProvider;
116
117
135class KDevVersionControl: public KDevPlugin
136{
137 TQ_OBJECT
138
139
140public:
150 KDevVersionControl(const KDevPluginInfo *info, TQObject *parent, const char *name )
151 :KDevPlugin(info, parent, name ) {}
152
157 virtual void createNewProject(const TQString& dir) = 0;
158
161 virtual bool fetchFromRepository() = 0;
162
164 virtual KDevVCSFileInfoProvider *fileInfoProvider() const = 0;
165
171 virtual bool isValidDirectory(const TQString &dirPath) const = 0;
172
173
174signals:
178 void finishedFetching(TQString destinationDir);
179
180};
181
185class KDevVCSFileInfoProvider: public TQObject
186{
187 TQ_OBJECT
188
189public:
193 KDevVCSFileInfoProvider(KDevVersionControl *parent, const char *name)
194 : TQObject( parent, name ), m_owner(parent) {}
195
202 virtual const VCSFileInfoMap *status(const TQString &dirPath) = 0;
203
217 virtual bool requestStatus( const TQString &dirPath, void *callerData, bool recursive = true, bool checkRepos = true ) = 0;
218
219signals:
225 void statusReady(const VCSFileInfoMap &fileInfoMap, void *callerData);
226
227protected:
229 KDevVersionControl *owner() const { return m_owner; }
230
231private:
232 KDevVersionControl *m_owner;
233
234private:
235 KDevVCSFileInfoProvider( const KDevVCSFileInfoProvider & );
236 KDevVCSFileInfoProvider &operator=( const KDevVCSFileInfoProvider & );
237};
238
239#endif
KDevVCSFileInfoProvider
Basic interface for providing info on file registered in a version control repository repository.
Definition kdevversioncontrol.h:186
KDevVCSFileInfoProvider::KDevVCSFileInfoProvider
KDevVCSFileInfoProvider(KDevVersionControl *parent, const char *name)
Constructor.
Definition kdevversioncontrol.h:193
KDevVCSFileInfoProvider::owner
KDevVersionControl * owner() const
Definition kdevversioncontrol.h:229
KDevVCSFileInfoProvider::status
virtual const VCSFileInfoMap * status(const TQString &dirPath)=0
Gets the status for local files in the specified directory: the info are collected locally so they ar...
KDevVCSFileInfoProvider::requestStatus
virtual bool requestStatus(const TQString &dirPath, void *callerData, bool recursive=true, bool checkRepos=true)=0
Starts a request for directory status to the remote repository.
KDevVCSFileInfoProvider::statusReady
void statusReady(const VCSFileInfoMap &fileInfoMap, void *callerData)
Emitted when the status request to remote repository has finished.
KDevVersionControl
KDevelop version control system interface.
Definition kdevversioncontrol.h:136
KDevVersionControl::fileInfoProvider
virtual KDevVCSFileInfoProvider * fileInfoProvider() const =0
KDevVersionControl::fetchFromRepository
virtual bool fetchFromRepository()=0
Fetches a module from remote repository, so it can be used for importing.
KDevVersionControl::KDevVersionControl
KDevVersionControl(const KDevPluginInfo *info, TQObject *parent, const char *name)
Constructs a VCS plugin.
Definition kdevversioncontrol.h:150
KDevVersionControl::createNewProject
virtual void createNewProject(const TQString &dir)=0
Creates a new project in the passed path dir.
KDevVersionControl::isValidDirectory
virtual bool isValidDirectory(const TQString &dirPath) const =0
Checks if the directory is valid for this version control (for example CVS may check for the presence...
KDevVersionControl::finishedFetching
void finishedFetching(TQString destinationDir)
Emitted when the Version Control has finished importing a module from remote repository.
VCSFileInfo
Info about file state in VCS.
Definition kdevversioncontrol.h:45
VCSFileInfo::fileName
TQString fileName
The file name.
Definition kdevversioncontrol.h:72
VCSFileInfo::state
FileState state
The state of a file.
Definition kdevversioncontrol.h:78
VCSFileInfo::workRevision
TQString workRevision
The working revision number.
Definition kdevversioncontrol.h:74
VCSFileInfo::repoRevision
TQString repoRevision
The repository revision number.
Definition kdevversioncontrol.h:76
VCSFileInfo::state2String
static TQString state2String(FileState state)
Definition kdevversioncontrol.h:87
VCSFileInfo::VCSFileInfo
VCSFileInfo(TQString fn, TQString workRev, TQString repoRev, FileState aState)
Constructor.
Definition kdevversioncontrol.h:68
VCSFileInfo::FileState
FileState
State of the file.
Definition kdevversioncontrol.h:47
VCSFileInfo::NeedsCheckout
@ NeedsCheckout
File needs to be checkout again.
Definition kdevversioncontrol.h:55
VCSFileInfo::Unknown
@ Unknown
No VCS information about a file is known.
Definition kdevversioncontrol.h:48
VCSFileInfo::Sticky
@ Sticky
File is sticky.
Definition kdevversioncontrol.h:53
VCSFileInfo::Modified
@ Modified
File was modified locally.
Definition kdevversioncontrol.h:51
VCSFileInfo::NeedsPatch
@ NeedsPatch
File needs a patch.
Definition kdevversioncontrol.h:54
VCSFileInfo::Replaced
@ Replaced
File was scheduled for deletion, and then a new file with the same name was scheduled for addition in...
Definition kdevversioncontrol.h:58
VCSFileInfo::Directory
@ Directory
This is a directory.
Definition kdevversioncontrol.h:56
VCSFileInfo::Uptodate
@ Uptodate
File was updated or it is already at up to date version.
Definition kdevversioncontrol.h:50
VCSFileInfo::Deleted
@ Deleted
File or Directory is scheduled to be deleted.
Definition kdevversioncontrol.h:57
VCSFileInfo::Added
@ Added
File was added to the repository but not commited.
Definition kdevversioncontrol.h:49
VCSFileInfo::Conflict
@ Conflict
Local version conflicts with the one in a repository.
Definition kdevversioncontrol.h:52
VCSFileInfo::VCSFileInfo
VCSFileInfo()
Constructor.
Definition kdevversioncontrol.h:62
VCSFileInfo::toString
TQString toString() const
Definition kdevversioncontrol.h:81

KDevelop Extension Interfaces Library

Skip menu "KDevelop Extension Interfaces Library"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop Extension Interfaces Library

Skip menu "KDevelop Extension Interfaces Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Extension Interfaces Library by doxygen 1.9.8
This website is maintained by Timothy Pearson.