]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormExternal.h
merge booktabs branch
[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 #include "FormDialogView.h"
18 #include <map>
19
20 namespace lyx {
21 namespace frontend {
22
23 class CheckedPath;
24 class ControlExternal;
25 struct FD_external;
26 struct FD_external_file;
27 struct FD_external_lyxview;
28 struct FD_external_rotate;
29 struct FD_external_scale;
30 struct FD_external_crop;
31 struct FD_external_options;
32
33 /// The class for editing External insets via a dialog
34 class FormExternal
35         : public FormController<ControlExternal, FormView<FD_external> > {
36 public:
37         ///
38         FormExternal(Dialog &);
39
40         typedef std::map<std::string, std::string> MapType;
41
42         enum Tabs {
43                 FILETAB,
44                 LYXVIEWTAB,
45                 ROTATETAB,
46                 SCALETAB,
47                 CROPTAB,
48                 OPTIONSTAB
49         };
50
51         typedef std::map<Tabs, FL_OBJECT *> TabMap;
52
53 private:
54         /// apply changes
55         virtual void apply();
56
57         /// build the dialog
58         virtual void build();
59
60         /// update the dialog
61         virtual void update();
62
63         /// Filter the inputs on callback from xforms
64         virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
65
66         bool activateAspectratio() const;
67         void getBB();
68         void updateComboChange();
69         void widthUnitChanged();
70
71         // Accessor to checker owned by the button controller.
72         CheckedPath * file_checker_;
73
74         MapType extra_;
75
76         TabMap tabmap_;
77
78         /// Real GUI implementation.
79         boost::scoped_ptr<FD_external_file>    file_;
80         boost::scoped_ptr<FD_external_lyxview> lyxview_;
81         boost::scoped_ptr<FD_external_rotate>  rotate_;
82         boost::scoped_ptr<FD_external_scale>   scale_;
83         boost::scoped_ptr<FD_external_crop>    crop_;
84         boost::scoped_ptr<FD_external_options> options_;
85 };
86
87 } // namespace frontend
88 } // namespace lyx
89
90 #endif // FORMEXTERNAL_H