]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlExternal.h
fix crash due to invalidated iterator
[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
19 #include "support/types.h"
20
21 #include <boost/scoped_ptr.hpp>
22
23 #include <string>
24 #include <vector>
25
26
27 class InsetExternalParams;
28
29 namespace lyx {
30
31 namespace external {
32
33 class Template;
34 class RotationDataType;
35
36 } // namespace external
37
38
39 namespace frontend {
40
41 class ControlExternal : public Dialog::Controller {
42 public:
43         ///
44         ControlExternal(Dialog &);
45         ///
46         virtual bool initialiseParams(std::string const & data);
47         /// clean-up on hide.
48         virtual void clearParams();
49         /// clean-up on hide.
50         virtual void dispatchParams();
51         ///
52         virtual bool isBufferDependent() const { return true; }
53
54         ///
55         InsetExternalParams const & params() const;
56         ///
57         void setParams(InsetExternalParams const &);
58
59         ///
60         void editExternal();
61         ///
62         std::vector<std::string> const getTemplates() const;
63         ///
64         int getTemplateNumber(std::string const &) const;
65         ///
66         external::Template getTemplate(int) const;
67         ///
68         std::string const browse(std::string const & input_file,
69                                  std::string const & tempalate_name) const;
70
71         /// Read the Bounding Box from a eps or ps-file
72         std::string const readBB(std::string const & file);
73         ///
74         void bbChanged(bool val) { bb_changed_ = val; }
75         bool bbChanged() const { return bb_changed_; }
76 private:
77         ///
78         boost::scoped_ptr<InsetExternalParams> params_;
79         bool bb_changed_;
80 };
81
82 } // namespace frontend
83
84
85 namespace external {
86
87 std::vector<RotationDataType> const & all_origins();
88 std::string const origin_gui_str(size_type i);
89
90 } // namespace external
91 } // namespace lyx
92
93 #endif // CONTROLEXTERNAL_H