]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlInclude.h
* Give Dialog::Controller::initialiseParams a bool return type.
[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/insetinclude.h" // InsetIncludeParams
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(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         InsetInclude::Params const & params() const
49                 { return inset_->params(); }
50         ///
51         void setParams(InsetInclude::Params const &);
52
53         /// Browse for a file
54         string const Browse(string const &, Type);
55
56         /// load a file
57         void load(string const & file);
58
59         /// test if file exist
60         bool fileExists(string const & file);
61 private:
62         ///
63         boost::scoped_ptr<InsetInclude> inset_;
64 };
65
66 #endif // CONTROLINCLUDE_H