3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
10 #ifndef FORMEXTERNAL_H
11 #define FORMEXTERNAL_H
13 #include <boost/smart_ptr.hpp>
19 #include "FormBaseDeprecated.h"
20 #include "insets/insetexternal.h"
23 struct FD_form_external;
25 /// The class for editing External insets via a dialog
26 class FormExternal : public FormBaseBD {
29 FormExternal(LyXView *, Dialogs *);
31 /// Connect signals. Also perform any necessary initialisation.
32 virtual void connect();
34 /// Disconnect signals. Also perform any necessary housekeeping.
35 virtual void disconnect();
37 /// Slot launching dialog to an existing inset
38 void showInset(InsetExternal *);
40 /// bool indicates if a buffer switch took place
41 virtual void updateSlot(bool);
43 /// Callback function for the template drop-down
44 static void templateCB(FL_OBJECT *, long);
46 /// Callback function for the browse button
47 static void browseCB(FL_OBJECT *, long);
49 /// Callback function for the edit button
50 static void editCB(FL_OBJECT *, long);
52 /// Callback function for the view button
53 static void viewCB(FL_OBJECT *, long);
55 /// Callback function for the update production button
56 static void updateCB(FL_OBJECT *, long);
58 /// Pointer to the actual instantiation of the xform's form
59 virtual FL_FORM * form() const;
62 /// calculate the string to set the combo box
63 string const getTemplatesComboString() const;
65 /// get the position in the combo for a given name
66 int getTemplateComboNumber(string const & name) const;
68 /// get a template given its combo position
69 ExternalTemplate getTemplate(int i) const;
71 /// change widgets on change of chosen template
72 void updateComboChange();
77 /// the inset we're modifying
78 InsetExternal * inset_;
81 InsetExternal::InsetExternalParams params_;
89 bool input(FL_OBJECT * obj, long data);
91 /// inset::hide connection.
95 FD_form_external * build_external();
97 /// Pointer to the actual instantiation of the ButtonController.
98 virtual xformsBC & bc();
100 /// the dialog implementation
101 boost::scoped_ptr<FD_form_external> dialog_;
103 /// The ButtonController
104 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
109 xformsBC & FormExternal::bc()
114 #endif // FORMEXTERNAL_H