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