]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiInclude.h
move GuiCommand into hedar of its own. InsetCommandParams.h is expensive
[lyx.git] / src / frontends / qt4 / GuiInclude.h
1 // -*- C++ -*-
2 /**
3  * \file GuiInclude.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author Angus Leeming
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUIINCLUDE_H
15 #define GUIINCLUDE_H
16
17 #include "GuiDialog.h"
18 #include "GuiCommand.h"
19 #include "ui_IncludeUi.h"
20
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiInclude : public GuiCommand, public Ui::IncludeUi
26 {
27         Q_OBJECT
28
29 public:
30         GuiInclude(GuiView & lv);
31
32 private Q_SLOTS:
33         void change_adaptor();
34         /// edit the child document, .lyx file will be opened in lyx
35         /// other formats will be edited by external applications.
36         void edit();
37         /// browse for a file
38         void browse();
39         ///
40         void typeChanged(int v);
41         /// AFAIK, QValidator only works for QLineEdit so
42         /// I have to validate listingsED (QTextEdit) manually.
43         /// This function displays a hint or error message returned by
44         /// validate_listings_params
45         void set_listings_msg();
46
47 private:
48         ///
49         enum Type {
50                 ///
51                 INPUT,
52                 ///
53                 VERBATIM,
54                 ///
55                 INCLUDE,
56                 ///
57                 LISTINGS,
58         };
59         ///
60         void updateLists();
61         /// validate listings parameters and return an error message, if any
62         docstring validate_listings_params();
63         ///
64         void edit(std::string const & file);
65         ///
66         bool isValid();
67         /// Apply changes
68         void applyView();
69         /// update
70         void updateContents();
71         ///
72         bool isBufferDependent() const { return true; }
73         /// Browse for a file
74         QString browse(QString const &, Type) const;
75 };
76
77 } // namespace frontend
78 } // namespace lyx
79
80 #endif // GUIINCLUDE_H