4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include <boost/scoped_ptr.hpp>
22 namespace support
{ class FileName
; }
27 /** Version Control for LyX.
28 This is the class giving the verison control features to LyX. It is
29 intended to support different kinds of version control, but at this point
30 we will only support RCS. Later CVS is a likely candidate for support.
31 The support in LyX is based loosely upon the version control in GNU Emacs,
32 but is not as extensive as that one. See examples/VC.lyx for a simple
33 tutorial and manual for the use of the version control system in LyX.
35 LyXVC use this algorithm when it searches for VC files:
36 for RCS it searches for <filename>,v and RCS/<filename>,v similar
37 should be done for CVS. By doing this there doesn't need to be any
38 special support for VC in the lyx format, and this is especially good
39 when the lyx format will be a subset of LaTeX.
47 /** Not a good name perhaps. This function should be called whenever
48 LyX loads a file. This function then checks for a master VC file
49 (for RCS this is *,v or RCS/ *,v) if this file is found, the loaded
50 file is assumed to be under controll by VC (only RCS so far), and
51 the appropiate actions is taken. Returns true if the file is under
54 bool file_found_hook(support::FileName
const & fn
);
56 /** This function should be run when a file is requested for loading,
57 but it does not exist. This function will then check for a VC master
58 file with the same name (see above function). If this exists the
59 user should be asked if he/her wants to checkout a version for
60 viewing/editing. Returns true if the file is under control by a VCS
61 and the user wants to view/edit it.
63 static bool file_not_found_hook(support::FileName
const & fn
);
66 void setBuffer(Buffer
*);
68 /// Register the document as an VC file.
71 /// Unlock and commit changes.
74 /// Lock and prepare to edit document.
77 /// Revert to last version
80 /// Undo last check-in.
84 * Generate a log file and return the filename.
85 * It is the caller's responsibility to unlink the
88 const std::string
getLogFile() const;
91 void toggleReadOnly();
93 /// Is the document under administration by RCS?
96 /// Returns the version number.
97 //std::string const & version() const;
98 /// Returns the version number.
99 std::string
const versionString() const;
101 /// Returns the userid of the person who has locked the doc.
102 std::string
const & locker() const;
109 boost::scoped_ptr
<VCS
> vcs
;