]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormExternal.h
b6f95f7103fa003c7a1742f4682f6af55d850dca
[lyx.git] / src / frontends / xforms / FormExternal.h
1 /**
2  * \file FormExternal.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author unknown
7  * \author John Levon
8  */
9
10 #ifndef FORMEXTERNAL_H
11 #define FORMEXTERNAL_H
12
13 #include "FormBase.h"
14 #include "insets/insetexternal.h"
15
16 #include "form_external.h"
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 /// The class for editing External insets via a dialog
23 class FormExternal : public FormBaseBD {
24 public:
25         FormExternal(LyXView *, Dialogs *);
26
27         ~FormExternal();
28
29         /// Connect signals. Also perform any necessary initialisation.
30         virtual void connect();
31
32         /// Disconnect signals. Also perform any necessary housekeeping.
33         virtual void disconnect();
34
35         /// Slot launching dialog to an existing inset
36         void showInset(InsetExternal *);
37
38         /// bool indicates if a buffer switch took place
39         virtual void updateSlot(bool);
40
41         /// Callback function for the template drop-down
42         static void templateCB(FL_OBJECT *, long);
43
44         /// Callback function for the browse button
45         static void browseCB(FL_OBJECT *, long);
46
47         /// Callback function for the edit button
48         static void editCB(FL_OBJECT *, long);
49
50         /// Callback function for the view button
51         static void viewCB(FL_OBJECT *, long);
52
53         /// Callback function for the update production button
54         static void updateCB(FL_OBJECT *, long);
55
56         /// Pointer to the actual instantiation of the xform's form
57         virtual FL_FORM * form() const;
58
59 private:
60         /// calculate the string to set the combo box
61         string const getTemplatesComboString() const;
62
63         /// get the position in the combo for a given name
64         int getTemplateComboNumber(string const & name) const;
65
66         /// get a template given its combo position
67         ExternalTemplate getTemplate(int i) const;
68
69         /// change widgets on change of chosen template
70         void updateComboChange();
71  
72         /// build the dialog
73         void build();
74
75         /// the inset we're modifying
76         InsetExternal * inset_;
77
78         /// the parameters
79         InsetExternal::InsetExternalParams params_;
80
81         /// update the dialog
82         void update();
83
84         /// apply changes
85         void apply();
86
87         bool input(FL_OBJECT * obj, long data);
88
89         /// inset::hide connection.
90         Connection ih_;
91
92         /// build the dialog
93         FD_form_external * build_external();
94
95         /// the dialog implementation
96         FD_form_external * dialog_;
97 };
98
99 #endif // FORMEXTERNAL_H