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