]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlInclude.h
prefs/tabular MVC work
[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 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include "ControlInset.h"
22 #include "insets/insetinclude.h" // InsetIncludeParams
23
24 /** A controller for the Include file dialog.
25  */
26 class ControlInclude
27         : public ControlInset<InsetInclude, InsetInclude::Params>
28 {
29 public:
30         ///
31         enum Type {
32                 ///
33                 INPUT,
34                 ///
35                 VERBATIM,
36                 ///
37                 INCLUDE
38         };
39         ///
40         ControlInclude(LyXView &, Dialogs &);
41
42         /// Browse for a file
43         string const Browse(string const &, Type);
44
45         /// load a file
46         void load(string const & file);
47
48         /// test if file exist
49         bool fileExists(string const & file);
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
60         getParams(InsetInclude const & inset) {
61                 return inset.params();
62         }
63 };
64 #endif // CONTROLINCLUDE_H