]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlInclude.h
5 new lfuns, move all apply code out of ControlDocument and into the core.
[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
22 /** A controller for the Include file dialog.
23  */
24 class ControlInclude : public Dialog::Controller {
25 public:
26         ///
27         enum Type {
28                 ///
29                 INPUT,
30                 ///
31                 VERBATIM,
32                 ///
33                 INCLUDE
34         };
35         ///
36         ControlInclude(Dialog &);
37
38         ///
39         virtual bool initialiseParams(std::string const & data);
40         /// clean-up on hide.
41         virtual void clearParams();
42         /// clean-up on hide.
43         virtual void dispatchParams();
44         ///
45         virtual bool isBufferDependent() const { return true; }
46
47         ///
48         InsetCommandParams const & params() const { return params_; }
49         ///
50         void setParams(InsetCommandParams const &);
51
52         /// Browse for a file
53         std::string const browse(std::string const &, Type) const;
54
55         /// load a file
56         void load(std::string const & file);
57
58         /// test if file exist
59         bool fileExists(std::string const & file);
60 private:
61         ///
62         InsetCommandParams params_;
63 };
64
65 #endif // CONTROLINCLUDE_H