]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiExternal.h
3a41a1833b1db3c90682353126c9560f85c8c720
[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 namespace frontend {
28
29 class GuiExternal : public GuiDialog, public Ui::ExternalUi
30 {
31         Q_OBJECT
32
33 public:
34         GuiExternal(GuiView & lv);
35
36 private Q_SLOTS:
37         void bbChanged();
38         void browseClicked();
39         void change_adaptor();
40         void editClicked();
41         void extraChanged(const QString &);
42         void formatChanged(const QString &);
43         void getbbClicked();
44         void sizeChanged();
45         void templateChanged();
46         void widthUnitChanged();
47
48 private:
49         ///
50         typedef QHash<QString, QString> MapType;
51
52         ///
53         bool activateAspectratio() const;
54         /// Apply changes
55         void applyView();
56         /// update
57         void updateContents();
58         /// Helper function called when the template is changed.
59         void updateTemplate();
60         /// get bounding box from file
61         void getBB();
62
63         ///
64         MapType extra_;
65         ///
66         bool initialiseParams(std::string const & data);
67         /// clean-up on hide.
68         void clearParams();
69         /// clean-up on hide.
70         void dispatchParams();
71         ///
72         bool isBufferDependent() const { return true; }
73
74         ///
75         void editExternal();
76         ///
77         QString browse(QString const & input_file,
78                                  QString const & template_name) const;
79
80         /// Read the Bounding Box from a eps or ps-file
81         std::string const readBB(std::string const & file);
82         ///
83 private:
84         ///
85         InsetExternalParams params_;
86         ///
87         bool bbChanged_;
88 };
89
90 } // namespace frontend
91 } // namespace lyx
92
93 #endif // GUIEXTERNAL_H