]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiGraphics.h
Make GuiRef and GuiInclude subclasses of GuiCommand.
[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 LyXView;
36
37 class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
38 {
39         Q_OBJECT
40
41 public:
42         GuiGraphics(LyXView & lv);
43         void setAutoText();
44
45 private Q_SLOTS:
46         void change_adaptor();
47         void change_bb();
48         void on_browsePB_clicked();
49         void on_getPB_clicked();
50         void on_editPB_clicked();
51         void on_filename_textChanged(const QString &);
52         void on_scaleCB_toggled(bool);
53         void on_WidthCB_toggled(bool);
54         void on_HeightCB_toggled(bool);
55         void on_angle_textChanged(const QString &);
56
57 private:
58         void closeEvent(QCloseEvent * e);
59         bool isValid();
60         /// Apply changes
61         void applyView();
62         /// update
63         void updateContents();
64         /// get bounding box from file
65         void getBB();
66
67         /// Store the LaTeX names for the rotation origins.
68         std::vector<std::string> origin_ltx;
69         ///
70         bool initialiseParams(std::string const & data);
71         /// clean-up on hide.
72         void clearParams();
73         /// clean-up on hide.
74         void dispatchParams();
75         ///
76         bool isBufferDependent() const { return true; }
77
78         /// Browse for a file
79         docstring const browse(docstring const &) const;
80         /// Read the Bounding Box from a eps or ps-file
81         std::string const readBB(std::string const & file);
82         /// Control the bb
83         bool bbChanged;
84         /// test if file exist
85         bool isFilenameValid(std::string const & fname) const;
86         /// edit file
87         void editGraphics();
88
89 private:
90         ///
91         InsetGraphicsParams params_;
92 };
93
94
95 /// get the units for the bounding box
96 std::vector<std::string> const getBBUnits();
97
98 } // namespace frontend
99 } // namespace lyx
100
101 #endif // GUIGRAPHICS_H