3 * FormGraphics Interface Class
6 * ======================================================
8 * LyX, The Document Processor
10 * Copyright 1995 Matthias Ettrich
11 * Copyright 1995-2000 The LyX Team.
13 * ======================================================
16 #ifndef FORMGRAPHICS_H
17 #define FORMGRAPHICS_H
19 #include <boost/smart_ptr.hpp>
26 #include "RadioButtonGroup.h"
27 #include "FormInset.h"
29 // Forward declarations for classes we use only as pointers.
32 struct FD_form_graphics;
34 /** This class provides an XForms implementation of the FormGraphics Dialog.
36 * @Author Baruch Even <baruch.even@writeme.com>
38 class FormGraphics : public FormInset {
40 /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
41 FormGraphics(LyXView *, Dialogs *);
46 /// The maximum digits for the image width (cm, inch, percent)
51 /// The maximum digits for the image height (cm, inch, percent)
56 /// The maximum characters in the rotation angle (minus sign and 3 digits)
61 /// The maximum characters in a filename.
64 FILENAME_MAXCHARS = 1024
76 /// Pointer to the actual instantiation of the ButtonController.
77 virtual xformsBC & bc();
81 virtual bool input( FL_OBJECT *, long );
83 virtual void update();
87 /// Disconnect signals. Also perform any necessary housekeeping.
88 virtual void disconnect();
90 /// Save the active inset and show the dialog.
91 void showDialog(InsetGraphics *);
92 /// Verify that the input is correct. If not disable ok/apply buttons.
94 /// Open the file browse dialog to select an image file.
97 /// Pointer to the actual instantiation of the xforms form
98 virtual FL_FORM * form() const;
99 /// Fdesign generated method
100 FD_form_graphics * build_graphics();
102 /// Real GUI implementation.
103 boost::scoped_ptr<FD_form_graphics> dialog_;
104 /** Which Inset do we belong to?
105 Used to set and update data to/from the inset.
107 InsetGraphics * inset_;
108 /// The radio buttons groups
109 RadioButtonGroup widthButtons;
111 RadioButtonGroup heightButtons;
113 RadioButtonGroup displayButtons;
114 /// Last used figure path
115 string last_image_path;
116 /// The ButtonController
117 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
122 xformsBC & FormGraphics::bc()