]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlGraphics.h
rename getExtFromContents() to getFormatFromContents()
[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 namespace lyx {
27 namespace frontend {
28
29 /** A controller for Graphics dialogs.
30  */
31 class ControlGraphics : public Dialog::Controller {
32 public:
33         ///
34         ControlGraphics(Dialog &);
35         ///
36         virtual bool initialiseParams(std::string const & data);
37         /// clean-up on hide.
38         virtual void clearParams();
39         /// clean-up on hide.
40         virtual void dispatchParams();
41         ///
42         virtual bool isBufferDependent() const { return true; }
43         ///
44         InsetGraphicsParams & params() { return *params_.get(); }
45         ///
46         InsetGraphicsParams const & params() const { return *params_.get(); }
47
48         /// Browse for a file
49         std::string const browse(std::string const &) const;
50         /// Read the Bounding Box from a eps or ps-file
51         std::string const readBB(std::string const & file);
52         /// Control the bb
53         bool bbChanged;
54         /// test if file exist
55         bool isFilenameValid(std::string const & fname) const;
56         /// edit file
57         void editGraphics();
58
59 private:
60         ///
61         boost::scoped_ptr<InsetGraphicsParams> params_;
62 };
63
64
65 /// get the units for the bounding box
66 std::vector<std::string> const getBBUnits();
67
68 /// The (tranlated) GUI std::string and it's LaTeX equivalent.
69 typedef std::pair<std::string, std::string> RotationOriginPair;
70 ///
71 std::vector<RotationOriginPair> getRotationOriginData();
72
73 } // namespace frontend
74 } // namespace lyx
75
76 #endif // CONTROLGRAPHICS_H