]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiExternal.h
80f272363a4752345b7a377b54cd54a43133d8ea
[lyx.git] / src / frontends / qt4 / GuiExternal.h
1 // -*- C++ -*-
2 /**
3  * \file GuiExternal.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger Alstrup
8  * \author John Levon
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUIEXTERNAL_H
15 #define GUIEXTERNAL_H
16
17 #include "GuiDialog.h"
18 #include "ui_ExternalUi.h"
19
20 #include "support/types.h"
21
22 #include "insets/InsetExternal.h"
23
24 #include <QHash>
25
26 namespace lyx {
27
28 namespace external {
29
30 class Template;
31 class RotationDataType;
32
33 } // namespace external
34
35 namespace frontend {
36
37 class GuiExternal : public GuiDialog, public Ui::ExternalUi
38 {
39         Q_OBJECT
40
41 public:
42         GuiExternal(GuiView & lv);
43
44 private Q_SLOTS:
45         void bbChanged();
46         void browseClicked();
47         void change_adaptor();
48         void editClicked();
49         void extraChanged(const QString &);
50         void formatChanged(const QString &);
51         void getbbClicked();
52         void sizeChanged();
53         void templateChanged();
54         void widthUnitChanged();
55
56 public:
57         ///
58         typedef QHash<QString, QString> MapType;
59
60 private:
61         ///
62         bool activateAspectratio() const;
63         /// Apply changes
64         void applyView();
65         /// update
66         void updateContents();
67         /// Helper function called when the template is changed.
68         void updateTemplate();
69         /// get bounding box from file
70         void getBB();
71
72         ///
73         MapType extra_;
74         ///
75         bool initialiseParams(std::string const & data);
76         /// clean-up on hide.
77         void clearParams();
78         /// clean-up on hide.
79         void dispatchParams();
80         ///
81         bool isBufferDependent() const { return true; }
82
83         ///
84         void editExternal();
85         ///
86         QString browse(QString const & input_file,
87                                  QString const & template_name) const;
88
89         /// Read the Bounding Box from a eps or ps-file
90         std::string const readBB(std::string const & file);
91         ///
92 private:
93         ///
94         InsetExternalParams params_;
95         ///
96         bool bbChanged_;
97 };
98
99 } // namespace frontend
100 } // namespace lyx
101
102 #endif // GUIEXTERNAL_H