]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiExternal.h
basic context menu for InsetExternal.
[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 "insets/InsetExternal.h"
21
22 #include <QHash>
23
24 namespace lyx {
25 namespace frontend {
26
27 class GuiExternal : public GuiDialog, public Ui::ExternalUi
28 {
29         Q_OBJECT
30
31 public:
32         GuiExternal(GuiView & lv);
33
34 private Q_SLOTS:
35         void bbChanged();
36         void browseClicked();
37         void change_adaptor();
38         void extraChanged(const QString &);
39         void formatChanged(const QString &);
40         void getbbClicked();
41         void sizeChanged();
42         void templateChanged();
43         void widthUnitChanged();
44
45 private:
46         ///
47         typedef QHash<QString, QString> MapType;
48
49         ///
50         bool activateAspectratio() const;
51         /// Apply changes
52         void applyView();
53         /// update
54         void updateContents();
55         /// Helper function called when the template is changed.
56         void updateTemplate();
57
58         ///
59         bool initialiseParams(std::string const & data);
60         /// clean-up on hide.
61         void clearParams();
62         /// clean-up on hide.
63         void dispatchParams();
64         ///
65         bool isBufferDependent() const { return true; }
66
67         ///
68         QString browse(QString const & input_file,
69                                  QString const & template_name) const;
70
71         ///
72         MapType extra_;
73         ///
74         InsetExternalParams params_;
75         ///
76         bool bbChanged_;
77 };
78
79 } // namespace frontend
80 } // namespace lyx
81
82 #endif // GUIEXTERNAL_H