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