]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCompare.h
* fix spelling in comments to please John.
[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 changeAdaptor();
43         ///
44         void selectNewFile();
45         ///
46         void selectOldFile();
47
48         ///
49         void error();
50         ///
51         void finished(bool aborted);
52         ///
53         void progress(int);
54         ///
55         void progressMax(int) const;
56         ///
57         void setStatusMessage(QString);
58
59 private:
60         ///
61         void updateContents();
62         ///
63         bool isValid();
64         ///
65         bool initialiseParams(std::string const &) { return true; }
66         ///
67         bool isBufferDependent() const { return false; }
68         ///
69         void clearParams() {}
70         ///
71         void dispatchParams() {}
72         ///
73         void apply() {}
74
75
76         /// enable or disable all controls and rename the Close/Cancel button
77         void enableControls(bool enable);
78         
79         /// browse for a file
80         QString browse(QString const & in_name) const;
81         /// retrieve the buffer from the specified filename
82         Buffer const * bufferFromFileName(std::string const & file) const;
83
84         /// create the compare object and run the comparison
85         int run();
86
87 private:
88         /// the object that will do the comparison
89         Compare * compare_;
90
91         /// the buffer that will contain the result
92         Buffer * dest_buffer_;
93         /// the buffer that will contain the result
94         Buffer const * old_buffer_;
95         /// the buffer that will contain the result
96         Buffer const * new_buffer_;
97 };
98
99
100
101 } // namespace frontend
102 } // namespace lyx
103
104 #endif // GUICOMPARE_H