]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiGraphics.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiGraphics.h
1 // -*- C++ -*-
2 /**
3  * \file GuiGraphics.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Herbert Voß
9  * \author Baruch Even
10  * \author Angus Leeming
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef GUIGRAPHICS_H
16 #define GUIGRAPHICS_H
17
18 #include "GuiDialog.h"
19 #include "ui_GraphicsUi.h"
20
21 #include "support/docstring.h"
22 #include "insets/InsetGraphics.h"
23
24 #include <vector>
25
26 class QString;
27
28 namespace lyx {
29
30 class InsetGraphics;
31 class InsetGraphicsParams;
32
33 namespace frontend {
34
35 class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
36 {
37         Q_OBJECT
38
39 public:
40         GuiGraphics(GuiView & lv);
41         void setAutoText();
42
43 private Q_SLOTS:
44         void change_adaptor();
45         void change_bb();
46         void on_browsePB_clicked();
47         void on_getPB_clicked();
48         void on_scaleCB_toggled(bool);
49         void on_WidthCB_toggled(bool);
50         void on_HeightCB_toggled(bool);
51         void on_angle_textChanged(const QString &);
52
53 private:
54         ///
55         bool isValid();
56         /// Apply changes
57         void applyView();
58         /// update
59         void updateContents();
60         /// get bounding box from file
61         void getBB();
62
63         /// Store the LaTeX names for the rotation origins.
64         std::vector<std::string> origin_ltx;
65         ///
66         bool initialiseParams(std::string const & data);
67         /// clean-up on hide.
68         void clearParams();
69         /// clean-up on hide.
70         void dispatchParams();
71         ///
72         bool isBufferDependent() const { return true; }
73
74         /// Browse for a file
75         QString browse(QString const &) const;
76         /// Read the Bounding Box from a eps or ps-file
77         std::string readBoundingBox(std::string const & file);
78         /// Control the bb
79         bool bbChanged;
80         /// test if file exist
81         bool isFileNameValid(std::string const & fname) const;
82
83 private:
84         ///
85         InsetGraphicsParams params_;
86 };
87
88 } // namespace frontend
89 } // namespace lyx
90
91 #endif // GUIGRAPHICS_H