]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlGraphics.h
Georg's add an editor to Formats / safe external_templates patch.
[lyx.git] / src / frontends / controllers / ControlGraphics.h
1 // -*- C++ -*-
2 /**
3  * \file ControlGraphics.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Baruch Even
8  * \author Angus Leeming
9  * \author Herbert Voß
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef CONTROLGRAPHICS_H
15 #define CONTROLGRAPHICS_H
16
17
18 #include "Dialog.h"
19 #include <utility>
20 #include <vector>
21
22 class InsetGraphics;
23 class InsetGraphicsParams;
24 class LyXView;
25
26 /** A controller for Graphics dialogs.
27  */
28
29 class ControlGraphics : public Dialog::Controller {
30 public:
31         ///
32         ControlGraphics(Dialog &);
33         ///
34         virtual bool initialiseParams(std::string const & data);
35         /// clean-up on hide.
36         virtual void clearParams();
37         /// clean-up on hide.
38         virtual void dispatchParams();
39         ///
40         virtual bool isBufferDependent() const { return true; }
41         ///
42         InsetGraphicsParams & params() { return *params_.get(); }
43         ///
44         InsetGraphicsParams const & params() const { return *params_.get(); }
45
46         /// Browse for a file
47         std::string const browse(std::string const &) const;
48         /// Read the Bounding Box from a eps or ps-file
49         std::string const readBB(std::string const & file);
50         /// Control the bb
51         bool bbChanged;
52         /// test if file exist
53         bool isFilenameValid(std::string const & fname) const;
54         /// edit file
55         void editGraphics();
56
57 private:
58         ///
59         boost::scoped_ptr<InsetGraphicsParams> params_;
60 };
61
62 namespace frnt {
63
64 /// get the units for the bounding box
65 std::vector<std::string> const getBBUnits();
66
67 /// The (tranlated) GUI std::string and it's LaTeX equivalent.
68 typedef std::pair<std::string, std::string> RotationOriginPair;
69 ///
70 std::vector<RotationOriginPair> getRotationOriginData();
71
72 } // namespace frnt
73
74 #endif // CONTROLGRAPHICS_H