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