]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormExternal.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormExternal.h
1 // -*- C++ -*-
2 /**
3  * \file FormExternal.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 Nielsen
8  * \author John Levon
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef FORMEXTERNAL_H
15 #define FORMEXTERNAL_H
16
17
18 #include "FormDialogView.h"
19 #include <map>
20
21 class ControlExternal;
22 struct FD_external;
23 struct FD_external_file;
24 struct FD_external_lyxview;
25 struct FD_external_rotate;
26 struct FD_external_scale;
27 struct FD_external_crop;
28 struct FD_external_options;
29
30 /// The class for editing External insets via a dialog
31 class FormExternal
32         : public FormController<ControlExternal, FormView<FD_external> > {
33 public:
34         ///
35         FormExternal(Dialog &);
36
37         typedef std::map<std::string, std::string> MapType;
38
39         enum Tabs {
40                 FILETAB,
41                 LYXVIEWTAB,
42                 ROTATETAB,
43                 SCALETAB,
44                 CROPTAB,
45                 OPTIONSTAB
46         };
47
48         typedef std::map<Tabs, FL_OBJECT *> TabMap;
49
50 private:
51         /// apply changes
52         virtual void apply();
53
54         /// build the dialog
55         virtual void build();
56
57         /// update the dialog
58         virtual void update();
59
60         /// Filter the inputs on callback from xforms
61         virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
62
63         bool activateAspectratio() const;
64         void getBB();
65         void updateComboChange();
66         void widthUnitChanged();
67
68         MapType extra_;
69
70         TabMap tabmap_;
71
72         /// Real GUI implementation.
73         boost::scoped_ptr<FD_external_file>    file_;
74         boost::scoped_ptr<FD_external_lyxview> lyxview_;
75         boost::scoped_ptr<FD_external_rotate>  rotate_;
76         boost::scoped_ptr<FD_external_scale>   scale_;
77         boost::scoped_ptr<FD_external_crop>    crop_;
78         boost::scoped_ptr<FD_external_options> options_;
79 };
80
81 #endif // FORMEXTERNAL_H