]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlExternal.h
next one
[lyx.git] / src / frontends / controllers / ControlExternal.h
1 // -*- C++ -*-
2 /**
3  * \file ControlExternal.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger Alstrup
8  * \author John Levon
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef CONTROLEXTERNAL_H
15 #define CONTROLEXTERNAL_H
16
17 #include "Dialog.h"
18 #include "support/types.h"
19 #include "insets/InsetExternal.h"
20
21 #include <string>
22 #include <vector>
23
24 namespace lyx {
25 namespace external {
26
27 class Template;
28 class RotationDataType;
29
30 } // namespace external
31
32
33 namespace frontend {
34
35 class ControlExternal : public Controller {
36 public:
37         ///
38         ControlExternal(Dialog &);
39         ///
40         virtual bool initialiseParams(std::string const & data);
41         /// clean-up on hide.
42         virtual void clearParams();
43         /// clean-up on hide.
44         virtual void dispatchParams();
45         ///
46         virtual bool isBufferDependent() const { return true; }
47
48         ///
49         InsetExternalParams const & params() const;
50         ///
51         void setParams(InsetExternalParams const &);
52
53         ///
54         void editExternal();
55         ///
56         std::vector<std::string> const getTemplates() const;
57         ///
58         int getTemplateNumber(std::string const &) const;
59         ///
60         external::Template getTemplate(int) const;
61         ///
62         std::string const
63         getTemplateFilters(std::string const & template_name) const;
64         ///
65         docstring const browse(docstring const & input_file,
66                                  docstring const & template_name) const;
67
68         /// Read the Bounding Box from a eps or ps-file
69         std::string const readBB(std::string const & file);
70         ///
71         void bbChanged(bool val) { bb_changed_ = val; }
72         bool bbChanged() const { return bb_changed_; }
73 private:
74         ///
75         InsetExternalParams params_;
76         bool bb_changed_;
77 };
78
79 } // namespace frontend
80
81
82 namespace external {
83
84 std::vector<RotationDataType> const & all_origins();
85 docstring const origin_gui_str(size_type i);
86
87 } // namespace external
88 } // namespace lyx
89
90 #endif // CONTROLEXTERNAL_H