]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlGraphics.h
Collapse all those LFUN_XYZ_APPLY to a single LFUN_INSET_APPLY.
[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 Voss
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 "ControlInset.h"
19
20 // needed to instatiate inset->hideDialog in ControlInset
21 #include "insets/insetgraphics.h"
22
23 #include <utility>
24 #include <vector>
25
26 class InsetGraphics;
27 class InsetGraphicsParams;
28 class LyXView;
29
30 /** A controller for Graphics dialogs.
31  */
32
33 class ControlGraphics
34         : public ControlInset<InsetGraphics, InsetGraphicsParams> {
35 public:
36         ///
37         ControlGraphics(LyXView &, Dialogs &);
38
39         /// Browse for a file
40         string const Browse(string const &);
41         /// Read the Bounding Box from a eps or ps-file
42         string const readBB(string const & file);
43         /// Control the bb
44         bool bbChanged;
45         /// test if file exist
46         bool isFilenameValid(string const & fname) const;
47
48 private:
49         /// Dispatch the changed parameters to the kernel.
50         virtual void applyParamsToInset();
51         ///
52         virtual void applyParamsNoInset();
53         /// get the parameters from the string passed to createInset.
54         virtual InsetGraphicsParams const getParams(string const &);
55         /// get the parameters from the inset passed to showInset.
56         virtual InsetGraphicsParams const getParams(InsetGraphics const &);
57 };
58
59 namespace frnt {
60
61 /// get the units for the bounding box
62 std::vector<string> const getBBUnits();
63
64 /// The (tranlated) GUI string and it's LaTeX equivalent.
65 typedef std::pair<string, string> RotationOriginPair;
66 ///
67 std::vector<RotationOriginPair> getRotationOriginData();
68
69 } // namespace frnt
70
71 #endif // CONTROLGRAPHICS_H