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