GuiPrintNomencl.{cpp,h}:
[lyx.git] / src / frontends / qt4 / GuiInclude.h
blobcac8972d8e08a8c01cadf14399832f407c64a0c9
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.
7 * \author Alejandro Aguilar Sierra
8 * \author Angus Leeming
9 * \author John Levon
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUIINCLUDE_H
15 #define GUIINCLUDE_H
17 #include "GuiDialog.h"
18 #include "ui_IncludeUi.h"
20 #include "insets/InsetCommandParams.h"
23 namespace lyx {
24 namespace frontend {
26 class GuiInclude : public GuiDialog, public Ui::IncludeUi
28 Q_OBJECT
30 public:
31 GuiInclude(GuiView & lv);
33 private Q_SLOTS:
34 void change_adaptor();
35 /// edit the child document, .lyx file will be opened in lyx
36 /// other formats will be edited by external applications.
37 void edit();
38 /// browse for a file
39 void browse();
40 ///
41 void typeChanged(int v);
42 /// AFAIK, QValidator only works for QLineEdit so
43 /// I have to validate listingsED (QTextEdit) manually.
44 /// This function displays a hint or error message returned by
45 /// validate_listings_params
46 void set_listings_msg();
48 private:
49 ///
50 bool initialiseParams(std::string const & data);
51 ///
52 void paramsToDialog(InsetCommandParams const & params_);
53 /// clean-up on hide.
54 void clearParams() { params_.clear(); }
55 /// clean-up on hide.
56 void dispatchParams();
57 ///
58 bool isBufferDependent() const { return true; }
60 ///
61 enum Type {
62 ///
63 INPUT,
64 ///
65 VERBATIM,
66 ///
67 INCLUDE,
68 ///
69 LISTINGS,
71 ///
72 void updateLists();
73 /// validate listings parameters and return an error message, if any
74 docstring validate_listings_params();
75 ///
76 bool isValid();
77 /// Apply changes
78 void applyView();
79 /// update
80 void updateContents() {}
81 /// Browse for a file
82 QString browse(QString const &, Type) const;
84 private:
85 ///
86 InsetCommandParams params_;
89 } // namespace frontend
90 } // namespace lyx
92 #endif // GUIINCLUDE_H