]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiGraphics.h
GuiGraphics: check more carefully whether we have a changed BB
[lyx.git] / src / frontends / qt / 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 "insets/InsetGraphicsParams.h"
22
23 #include <vector>
24
25 class QString;
26
27 namespace lyx {
28
29 namespace frontend {
30
31 class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
32 {
33         Q_OBJECT
34
35 public:
36         GuiGraphics(GuiView & lv);
37         void setAutoText();
38
39 private Q_SLOTS:
40         void change_adaptor();
41         void changeGroup(int);
42         void changeBB();
43         void on_newGroupPB_clicked();
44         void on_browsePB_clicked();
45         void on_getPB_clicked();
46         void on_scaleCB_toggled(bool);
47         void on_WidthCB_toggled(bool);
48         void on_HeightCB_toggled(bool);
49         void updateAspectRatioStatus();
50         void on_aspectratio_toggled(bool);
51         void on_angle_textChanged(const QString &);
52
53 private:
54         ///
55         bool isValid() override;
56         /// Dialog inherited methods
57         //@{
58         void applyView() override;
59         void updateContents() override {}
60         bool initialiseParams(std::string const & data) override;
61         void clearParams() override;
62         void dispatchParams() override;
63         bool isBufferDependent() const override { return true; }
64         //@}
65
66         ///
67         void paramsToDialog(InsetGraphicsParams const & params);
68
69         /// get bounding box from file
70         void getBB();
71         /// does the bounding box differ from the file?
72         bool isChangedBB();
73         /// Browse for a file
74         QString browse(QString const &) const;
75         /// Read the Bounding Box from a eps or ps-file
76         std::string readBoundingBox(std::string const & file);
77         /// test if file exist
78         bool isFileNameValid(std::string const & fname) const;
79
80         /// Control the bb
81         bool bbChanged;
82         /// Store the LaTeX names for the rotation origins.
83         std::vector<std::string> origin_ltx;
84         ///
85         InsetGraphicsParams params_;
86         /// the current graphics group
87         std::string current_group_;
88 };
89
90 } // namespace frontend
91 } // namespace lyx
92
93 #endif // GUIGRAPHICS_H