4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Vincent van Ravesteijn
9 * Full author contact details are available in file CREDITS.
17 #include "support/FileName.h"
23 #include <QWaitCondition>
29 * The options that are used by the Comparison algorithm
30 * and are set in the GuiCompare Dialog.
32 class CompareOptions
{
36 : settings_from_new(0)
39 /// Copy the settings from the new or old document
40 bool settings_from_new
;
44 * A threaded object that does the Comparison between two documents
45 * and creates a new document with the differences marked with track
48 class Compare
: public QThread
54 Compare(Buffer
const * const old_buf
, Buffer
const * const new_buf
,
55 Buffer
* const dest_buf
, CompareOptions
const & options
);
63 /// The thread has finished due to an error.
66 /// The thread has finished. If the thread is cancelled
67 /// by the user \c aborted is true.
68 void finished(bool aborted
) const;
70 /// Adds \c progress to the value of the progress bar in the dialog
71 void progress(int progress
) const ;
73 /// Sets the maximum value of the progress bar in the dialog.
74 void progressMax(int max
) const;
77 /// QThread inherited methods
86 /// Starts the comparison algorithm
89 /// The new document's buffer
90 Buffer
const * const new_buffer
;
91 /// The old document's buffer
92 Buffer
const * const old_buffer
;
93 /// The buffer with the differences marked with track changes
94 Buffer
* const dest_buffer
;
96 /// The options that are set in the GuiCompare dialog
97 CompareOptions options_
;
100 QWaitCondition condition_
;
102 /// Use the Pimpl idiom to hide the internals.