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