]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlInclude.h
Move the external dialog to the new scheme.
[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 "ControlInset.h"
19 #include "insets/insetinclude.h" // InsetIncludeParams
20
21 /** A controller for the Include file dialog.
22  */
23 class ControlInclude
24         : public ControlInset<InsetInclude, InsetInclude::Params>
25 {
26 public:
27         ///
28         enum Type {
29                 ///
30                 INPUT,
31                 ///
32                 VERBATIM,
33                 ///
34                 INCLUDE
35         };
36         ///
37         ControlInclude(LyXView &, Dialogs &);
38
39         /// Browse for a file
40         string const Browse(string const &, Type);
41
42         /// load a file
43         void load(string const & file);
44
45         /// test if file exist
46         bool fileExists(string const & file);
47 private:
48         /// Dispatch the changed parameters to the kernel.
49         virtual void applyParamsToInset();
50         /// Should be used but currently isn't
51         virtual void applyParamsNoInset() {}
52         /// get the parameters from the string passed to createInset.
53         virtual InsetInclude::Params const getParams(string const &)
54                 { return InsetInclude::Params(); }
55         /// get the parameters from the inset passed to showInset.
56         virtual InsetInclude::Params const
57         getParams(InsetInclude const & inset) {
58                 return inset.params();
59         }
60 };
61 #endif // CONTROLINCLUDE_H