]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiGraphics.h
3ff72533845369ad21b5cbc5a093864c7dc04bd2
[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  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUIGRAPHICS_H
14 #define GUIGRAPHICS_H
15
16 #include "GuiDialogView.h"
17 #include "ui_GraphicsUi.h"
18 #include "ControlGraphics.h"
19
20 #include <QDialog>
21
22 #include <vector>
23
24 class QString;
25
26 namespace lyx {
27 namespace frontend {
28
29 class GuiGraphics;
30
31 class GuiGraphicsDialog : public QDialog, public Ui::GraphicsUi
32 {
33         Q_OBJECT
34 public:
35         GuiGraphicsDialog(GuiGraphics * form);
36         virtual void setAutoText();
37         virtual void show();
38 protected Q_SLOTS:
39         virtual void change_adaptor();
40         virtual void change_bb();
41         virtual void on_browsePB_clicked();
42         virtual void on_getPB_clicked();
43         virtual void on_editPB_clicked();
44         virtual void on_filename_textChanged(const QString &);
45         virtual void on_scaleCB_toggled(bool);
46         virtual void on_WidthCB_toggled(bool);
47         virtual void on_HeightCB_toggled(bool);
48         virtual void on_angle_textChanged(const QString &);
49 protected:
50         virtual void closeEvent(QCloseEvent * e);
51 private:
52         GuiGraphics * form_;
53 };
54
55
56 class GuiGraphics : public GuiView<GuiGraphicsDialog>
57 {
58 public:
59         ///
60         friend class GuiGraphicsDialog;
61         ///
62         GuiGraphics(Dialog &);
63         /// parent controller
64         ControlGraphics & controller()
65         { return static_cast<ControlGraphics &>(this->getController()); }
66         /// parent controller
67         ControlGraphics const & controller() const
68         { return static_cast<ControlGraphics const &>(this->getController()); }
69 protected:
70         virtual bool isValid();
71 private:
72         /// Apply changes
73         virtual void apply();
74         /// update
75         virtual void update_contents();
76         /// build the dialog
77         virtual void build_dialog();
78         /// get bounding box from file
79         void getBB();
80
81         /// Store the LaTeX names for the rotation origins.
82         std::vector<std::string> origin_ltx;
83
84 };
85
86 } // namespace frontend
87 } // namespace lyx
88
89 #endif // GUIGRAPHICS_H