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