]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlInclude.h
Really dull and boring header shit
[lyx.git] / src / frontends / controllers / ControlInclude.h
1 // -*- C++ -*-
2 /**
3  * \file ControlInclude.h
4  * See the file COPYING
5  *
6  * \author Alejandro Aguilar Sierra
7  * \author John Levon
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #ifndef CONTROLINCLUDE_H
14 #define CONTROLINCLUDE_H
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "ControlInset.h"
21 #include "insets/insetinclude.h" // InsetIncludeParams
22
23 /** A controller for the Include file dialog.
24  */
25 class ControlInclude
26         : public ControlInset<InsetInclude, InsetInclude::Params>
27 {
28 public:
29         ///
30         enum Type {
31                 ///
32                 INPUT,
33                 ///
34                 VERBATIM,
35                 ///
36                 INCLUDE
37         };
38         ///
39         ControlInclude(LyXView &, Dialogs &);
40
41         /// Browse for a file
42         string const Browse(string const &, Type);
43
44         /// load a file
45         void load(string const & file);
46
47         /// test if file exist
48         bool fileExists(string const & file);
49
50 private:
51         /// Dispatch the changed parameters to the kernel.
52         virtual void applyParamsToInset();
53         /// Should be used but currently isn't
54         virtual void applyParamsNoInset() {}
55         /// get the parameters from the string passed to createInset.
56         virtual InsetInclude::Params const getParams(string const &)
57                 { return InsetInclude::Params(); }
58         /// get the parameters from the inset passed to showInset.
59         virtual InsetInclude::Params const getParams(InsetInclude const & inset)
60                 { return inset.params(); }
61 };
62 #endif // CONTROLINCLUDE_H