]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiGraphics.h
On Linux show in crash message box the backtrace
[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 "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 on_angle_textChanged(const QString &);
50
51 private:
52         ///
53         bool isValid();
54         /// Dialog inherited methods
55         //@{
56         void applyView();
57         void updateContents() {}
58         bool initialiseParams(std::string const & data);
59         void clearParams();
60         void dispatchParams();
61         bool isBufferDependent() const { return true; }
62         //@}
63
64         ///
65         void paramsToDialog(InsetGraphicsParams const & params);
66
67         /// get bounding box from file
68         void getBB();
69         /// Browse for a file
70         QString browse(QString const &) const;
71         /// Read the Bounding Box from a eps or ps-file
72         std::string readBoundingBox(std::string const & file);
73         /// test if file exist
74         bool isFileNameValid(std::string const & fname) const;
75
76         /// Control the bb
77         bool bbChanged;
78         /// Store the LaTeX names for the rotation origins.
79         std::vector<std::string> origin_ltx;
80         ///
81         InsetGraphicsParams params_;
82         /// the current graphics group
83         std::string current_group_;
84 };
85
86 } // namespace frontend
87 } // namespace lyx
88
89 #endif // GUIGRAPHICS_H