]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QExternal.h
* src/frontends/qt4/ui/TextLayoutUi.ui:
[lyx.git] / src / frontends / qt4 / QExternal.h
1 // -*- C++ -*-
2 /**
3  * \file QExternal.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QEXTERNAL_H
13 #define QEXTERNAL_H
14
15 #include "QDialogView.h"
16
17 #include "ui/ExternalUi.h"
18
19 #include <QCloseEvent>
20 #include <QDialog>
21
22 #include <map>
23
24 namespace lyx {
25 namespace frontend {
26
27 class QExternal;
28
29 class QExternalDialog : public QDialog, public Ui::QExternalUi {
30         Q_OBJECT
31 public:
32         QExternalDialog(QExternal * form);
33
34         virtual void show();
35 protected Q_SLOTS:
36         virtual void bbChanged();
37         virtual void browseClicked();
38         virtual void change_adaptor();
39         virtual void editClicked();
40         virtual void extraChanged(const QString&);
41         virtual void formatChanged(const QString&);
42         virtual void getbbClicked();
43         virtual void sizeChanged();
44         virtual void templateChanged();
45         virtual void widthUnitChanged();
46
47 protected:
48         virtual void closeEvent(QCloseEvent * e);
49 private:
50         bool activateAspectratio() const;
51         QExternal * form_;
52 };
53
54
55 class ControlExternal;
56
57 class QExternal
58         : public QController<ControlExternal, QView<QExternalDialog> >
59 {
60 public:
61         friend class QExternalDialog;
62
63         QExternal(Dialog &);
64
65         typedef std::map<std::string, QString> MapType;
66
67 private:
68         /// Apply changes
69         virtual void apply();
70         /// update
71         virtual void update_contents();
72         /// build the dialog
73         virtual void build_dialog();
74
75         /// Helper function called when the template is changed.
76         void updateTemplate();
77         /// get bounding box from file
78         void getBB();
79
80         MapType extra_;
81 };
82
83 } // namespace frontend
84 } // namespace lyx
85
86 #endif // QEXTERNAL_H