]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlExternal.h
5 new lfuns, move all apply code out of ControlDocument and into the core.
[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 namespace external {
31 class Template;
32 class RotationDataType;
33 } // namespace external
34 } // namespace lyx
35
36
37 class ControlExternal : public Dialog::Controller {
38 public:
39         ///
40         ControlExternal(Dialog &);
41         ///
42         virtual bool initialiseParams(std::string const & data);
43         /// clean-up on hide.
44         virtual void clearParams();
45         /// clean-up on hide.
46         virtual void dispatchParams();
47         ///
48         virtual bool isBufferDependent() const { return true; }
49
50         ///
51         InsetExternalParams const & params() const;
52         ///
53         void setParams(InsetExternalParams const &);
54
55         ///
56         void editExternal();
57         ///
58         std::vector<std::string> const getTemplates() const;
59         ///
60         int getTemplateNumber(std::string const &) const;
61         ///
62         lyx::external::Template getTemplate(int) const;
63         ///
64         std::string const browse(std::string const & input_file,
65                                  std::string const & tempalate_name) const;
66
67         /// Read the Bounding Box from a eps or ps-file
68         std::string const readBB(std::string const & file);
69         ///
70         void bbChanged(bool val) { bb_changed_ = val; }
71         bool bbChanged() const { return bb_changed_; }
72 private:
73         ///
74         boost::scoped_ptr<InsetExternalParams> params_;
75         bool bb_changed_;
76 };
77
78
79 namespace lyx {
80 namespace external {
81
82 std::vector<RotationDataType> const & all_origins();
83 std::string const origin_gui_str(lyx::size_type i);
84
85 } // namespace external
86 } // namespace lyx
87
88 #endif // CONTROLEXTERNAL_H