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