summaryrefslogtreecommitdiffstats
path: root/vcs/subversion/subversion_core.h
blob: d06e9bc90be6341e7e44fb062932e7c564c12579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**

  	 Copyright (C) 2003-2005 Mickael Marchand <marchand@kde.org>

	 This program is free software; you can redistribute it and/or
	 modify it under the terms of the GNU General Public
	 License as published by the Free Software Foundation; either
	 version 2 of the License, or (at your option) any later version.

	 This program is distributed in the hope that it will be useful,
	 but WITHOUT ANY WARRANTY; without even the implied warranty of
	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	 General Public License for more details.

	 You should have received a copy of the GNU General Public License
	 along with this program; see the file COPYING.  If not, write to
	 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
	 Boston, MA 02110-1301, USA.
	 */

#ifndef __SUBVERSION_CORE_H__
#define __SUBVERSION_CORE_H__

#include <tqobject.h>
#include <tqwidget.h>
#include <kio/job.h>
#include <kurl.h>
#include <ktempdir.h>
#include "subversion_fileinfo.h"
#include "subversion_global.h"

class KDevProject;
class subversionPart;
class subversionWidget;
class KApplication;
class SvnBlameHolder;
class SvnLogHolder;
class SvnLogViewWidget;

// class subversionCore : public TQObject, public DCOPObject
class subversionCore : public TQObject {
  Q_OBJECT
  TQ_OBJECT
//   K_DCOP

public:

  subversionCore(subversionPart *part);
  ~subversionCore();
	subversionWidget *processWidget() const;
// 	SvnLogViewWidget *processWidget() const;
	void update( const KURL::List&);
	void commit( const KURL::List&, bool recurse, bool keeplocks );
	void svnLog( const KURL::List& list,
			int revstart, TQString revKindStart, int revend, TQString revKindEnd, 
			bool discorverChangedPath, bool strictNodeHistory );
	void blame( const KURL &url, SvnGlobal::UrlMode mode, int revstart, TQString revKindStart, int revend, TQString revKindEnd );
	void add( const KURL::List&);
	void del( const KURL::List&);
	void diff( const KURL::List&, const TQString& where);
	void diffAsync( const KURL &pathOrUrl1, const KURL &pathOrUrl2,
					int rev1, TQString revKind1, int rev2, TQString revKind2,
					bool recurse, bool pegdiff = false );
	void revert( const KURL::List&);
	void resolve( const KURL::List&);
	void checkout();
	void switchTree( const KURL &path, const KURL &repositUrl,
					 int revNum, const TQString &revKind, bool recurse );
	void switchRelocate( const KURL &path, const KURL &currentUrl, const KURL &newUrl, bool recurse );
	void svnCopy( const KURL &src, int srcRev, const TQString &srcRevKind, const KURL &dest );
	void merge( const KURL &src1, int rev1, TQString revKind1, const KURL &src2, int rev2, TQString revKind2, const KURL &wc_path,
				   bool recurse, bool ignore_ancestry, bool force, bool dry_run );
    // This is blocking function. But the GUI is not blocked.
    // Information will be pulled solely from the working copy.Thus no network connections will be made.
    // Parameter holderMap is the map to be filled out by this method. Callers should preallocate this object.
    // Return true on success. Otherwise return false.
    bool clientInfo( KURL path_or_url, bool recurse, TQMap< KURL, SvnGlobal::SvnInfoHolder> &holderMap );
	void createNewProject( const TQString& dirName, const KURL& importURL, bool init );
    KDevVCSFileInfoProvider *fileInfoProvider() const;
	
	void initProcessDlg( KIO::Job *job, const TQString &src, const TQString &dest );
// k_dcop:
// 	void notification( const TQString&, int,int, const TQString&, int,int ,long int, const TQString& );

private slots:
	void slotEndCheckout( KIO::Job * job );
	void slotResult( KIO::Job * job );
	void slotLogResult( KIO::Job * job );
	void slotBlameResult( KIO::Job * job );
	void slotDiffResult( KIO::Job * job );

signals:
	void checkoutFinished( TQString dir );

private:
	TQGuardedPtr<subversionWidget> m_widget;
	subversionPart *m_part;
	TQString wcPath;
	SVNFileInfoProvider *m_fileInfoProvider;
	TQStringList diffresult; //for diff commands ;)
	// be nice about tmp diff files: delete all of them when exiting.
	KTempDir* diffTmpDir;

};

#endif