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