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