]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiInclude.h
header cleanup
[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 "ui_IncludeUi.h"
19
20 #include "insets/InsetCommandParams.h"
21
22 #include "support/docstring.h"
23
24
25 namespace lyx {
26 namespace frontend {
27
28 class GuiInclude : public GuiCommand, public Ui::IncludeUi
29 {
30         Q_OBJECT
31
32 public:
33         GuiInclude(GuiView & lv);
34
35 private Q_SLOTS:
36         void change_adaptor();
37         /// edit the child document, .lyx file will be opened in lyx
38         /// other formats will be edited by external applications.
39         void edit();
40         /// browse for a file
41         void browse();
42         ///
43         void typeChanged(int v);
44         /// AFAIK, QValidator only works for QLineEdit so
45         /// I have to validate listingsED (QTextEdit) manually.
46         /// This function displays a hint or error message returned by
47         /// validate_listings_params
48         void set_listings_msg();
49
50 private:
51         ///
52         enum Type {
53                 ///
54                 INPUT,
55                 ///
56                 VERBATIM,
57                 ///
58                 INCLUDE,
59                 ///
60                 LISTINGS,
61         };
62         ///
63         void updateLists();
64         /// validate listings parameters and return an error message, if any
65         docstring validate_listings_params();
66         ///
67         void edit(std::string const & file);
68         ///
69         bool isValid();
70         /// Apply changes
71         void applyView();
72         /// update
73         void updateContents();
74         ///
75         bool isBufferDependent() const { return true; }
76         /// Browse for a file
77         docstring browse(docstring const &, Type) const;
78 };
79
80 } // namespace frontend
81 } // namespace lyx
82
83 #endif // GUIINCLUDE_H