]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiGraphics.h
6879b28889982abf1b7da4d2c7804061e6d15c29
[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_filename_textChanged(const QString &);
49         void on_scaleCB_toggled(bool);
50         void on_WidthCB_toggled(bool);
51         void on_HeightCB_toggled(bool);
52         void on_angle_textChanged(const QString &);
53
54 private:
55         ///
56         bool isValid();
57         /// Apply changes
58         void applyView();
59         /// update
60         void updateContents();
61         /// get bounding box from file
62         void getBB();
63
64         /// Store the LaTeX names for the rotation origins.
65         std::vector<std::string> origin_ltx;
66         ///
67         bool initialiseParams(std::string const & data);
68         /// clean-up on hide.
69         void clearParams();
70         /// clean-up on hide.
71         void dispatchParams();
72         ///
73         bool isBufferDependent() const { return true; }
74
75         /// Browse for a file
76         QString browse(QString const &) const;
77         /// Read the Bounding Box from a eps or ps-file
78         std::string readBoundingBox(std::string const & file);
79         /// Control the bb
80         bool bbChanged;
81         /// test if file exist
82         bool isFileNameValid(std::string const & fname) const;
83
84 private:
85         ///
86         InsetGraphicsParams params_;
87 };
88
89 } // namespace frontend
90 } // namespace lyx
91
92 #endif // GUIGRAPHICS_H