]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlInclude.h
Convert most of the bibtex machinery to docstring.
[lyx.git] / src / frontends / controllers / ControlInclude.h
1 // -*- C++ -*-
2 /**
3  * \file ControlInclude.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 John Levon
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef CONTROLINCLUDE_H
15 #define CONTROLINCLUDE_H
16
17
18 #include "Dialog.h"
19 #include "insets/insetcommandparams.h"
20
21 #include "support/docstring.h"
22
23 namespace lyx {
24 namespace frontend {
25
26 /** A controller for the Include file dialog.
27  */
28 class ControlInclude : public Dialog::Controller {
29 public:
30         ///
31         enum Type {
32                 ///
33                 INPUT,
34                 ///
35                 VERBATIM,
36                 ///
37                 INCLUDE
38         };
39         ///
40         ControlInclude(Dialog &);
41
42         ///
43         virtual bool initialiseParams(std::string const & data);
44         /// clean-up on hide.
45         virtual void clearParams();
46         /// clean-up on hide.
47         virtual void dispatchParams();
48         ///
49         virtual bool isBufferDependent() const { return true; }
50
51         ///
52         InsetCommandParams const & params() const { return params_; }
53         ///
54         void setParams(InsetCommandParams const &);
55
56         /// Browse for a file
57         docstring const browse(docstring const &, Type) const;
58
59         /// load a file
60         void load(std::string const & file);
61
62         /// test if file exist
63         bool fileExists(std::string const & file);
64 private:
65         ///
66         InsetCommandParams params_;
67 };
68
69 } // namespace frontend
70 } // namespace lyx
71
72 #endif // CONTROLINCLUDE_H