]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCompare.h
Make trunk compile for now.
[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 namespace lyx {
20 namespace frontend {
21
22
23 class GuiCompare : public GuiDialog, public Ui::CompareUi
24 {
25         Q_OBJECT
26
27 public:
28         ///
29         GuiCompare(GuiView & lv);
30         ~GuiCompare();
31
32         void closeEvent(QCloseEvent *);
33                 
34 private Q_SLOTS:
35         ///
36         void slotOK();
37         ///
38         void slotCancel();
39         ///
40         void change_adaptor();
41         ///
42         void select_newfile();
43         ///
44         void select_oldfile();
45
46         ///
47         void finished(bool aborted);
48         ///
49         void nextIt(int);
50         ///
51         void progress_max(int) const;
52
53 private:
54         ///
55         void updateContents();
56         ///
57         bool isValid();
58         ///
59         bool initialiseParams(std::string const &) { return true; }
60         ///
61         bool isBufferDependent() const { return false; }
62         ///
63         void clearParams() {}
64         ///
65         void dispatchParams() {}
66         ///
67         void apply() {}
68
69
70         /// enable or disable all controls and rename the Close/Cancel button
71         void enableControls(bool enable) const;
72         
73         /// browse for a file
74         QString browse(QString const & in_name) const;
75         /// retrieve the buffer from the specified filename
76         Buffer const * bufferFromFileName(std::string const & file) const;
77
78         /// create the compare object and run the comparison
79         int run();
80
81 private:
82         /// the buffer that will contain the result
83         Buffer * dest_buffer_;
84         /// the buffer that will contain the result
85         Buffer const * old_buffer_;
86         /// the buffer that will contain the result
87         Buffer const * new_buffer_;
88
89         /// the window title
90         mutable QString window_title_;
91 };
92
93
94
95 } // namespace frontend
96 } // namespace lyx
97
98 #endif // GUICOMPARE_H