]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCompare.h
set eol-styles.
[lyx.git] / src / frontends / qt4 / GuiCompare.h
1 // -*- C++ -*-
2 /**
3  * \file GuiCompare.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Vincent van Ravesteijn
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUICOMPARE_H
13 #define GUICOMPARE_H
14
15 #include "GuiDialog.h"
16 #include "ui_CompareUi.h"
17 #include "qt_helpers.h"
18
19 #include "Compare.h"
20
21 namespace lyx {
22 namespace frontend {
23
24
25 class GuiCompare : public GuiDialog, public Ui::CompareUi
26 {
27         Q_OBJECT
28
29 public:
30         ///
31         GuiCompare(GuiView & lv);
32         ~GuiCompare();
33
34         void closeEvent(QCloseEvent *);
35                 
36 private Q_SLOTS:
37         ///
38         void slotOK();
39         ///
40         void slotCancel();
41         ///
42         void change_adaptor();
43         ///
44         void select_newfile();
45         ///
46         void select_oldfile();
47
48         ///
49         void finished(bool aborted);
50         ///
51         void nextIt(int);
52         ///
53         void progress_max(int) const;
54
55 private:
56         ///
57         void updateContents();
58         ///
59         bool isValid();
60         ///
61         bool initialiseParams(std::string const &) { return true; }
62         ///
63         bool isBufferDependent() const { return false; }
64         ///
65         void clearParams() {}
66         ///
67         void dispatchParams() {}
68         ///
69         void apply() {}
70
71
72         /// enable or disable all controls and rename the Close/Cancel button
73         void enableControls(bool enable) const;
74         
75         /// browse for a file
76         QString browse(QString const & in_name) const;
77         /// retrieve the buffer from the specified filename
78         Buffer const * bufferFromFileName(std::string const & file) const;
79
80         /// create the compare object and run the comparison
81         int run();
82
83 private:
84         /// the object that will do the comparison
85         Compare * compare_;
86
87         /// the buffer that will contain the result
88         Buffer * dest_buffer_;
89         /// the buffer that will contain the result
90         Buffer const * old_buffer_;
91         /// the buffer that will contain the result
92         Buffer const * new_buffer_;
93
94         /// the window title
95         mutable QString window_title_;
96 };
97
98
99
100 } // namespace frontend
101 } // namespace lyx
102
103 #endif // GUICOMPARE_H