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