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