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 "ButtonPolicies.h"
28 #include "FormInset.h"
31 // Forward declarations for classes we use only as pointers.
34 struct FD_form_graphics;
36 /** This class provides an XForms implementation of the FormGraphics Dialog.
38 * @Author Baruch Even <baruch.even@writeme.com>
40 class FormGraphics : public FormInset {
42 /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
43 FormGraphics(LyXView *, Dialogs *);
48 /// The maximum digits for the image width (cm, inch, percent)
53 /// The maximum digits for the image height (cm, inch, percent)
58 /// The maximum characters in the rotation angle (minus sign and 3 digits)
63 /// The maximum characters in a filename.
66 FILENAME_MAXCHARS = 1024
78 /// Pointer to the actual instantiation of the ButtonController.
79 virtual xformsBC & bc();
83 virtual bool input( FL_OBJECT *, long );
85 virtual void update();
89 /// Disconnect signals. Also perform any necessary housekeeping.
90 virtual void disconnect();
92 /// Save the active inset and show the dialog.
93 void showDialog(InsetGraphics *);
94 /// Verify that the input is correct. If not disable ok/apply buttons.
96 /// Open the file browse dialog to select an image file.
99 /// Pointer to the actual instantiation of the xforms form
100 virtual FL_FORM * form() const;
101 /// Fdesign generated method
102 FD_form_graphics * build_graphics();
104 /// Real GUI implementation.
105 boost::scoped_ptr<FD_form_graphics> dialog_;
106 /** Which Inset do we belong to?
107 Used to set and update data to/from the inset.
109 InsetGraphics * inset_;
110 /// The radio buttons groups
111 RadioButtonGroup widthButtons;
113 RadioButtonGroup heightButtons;
115 RadioButtonGroup displayButtons;
116 /// Last used figure path
117 string last_image_path;
118 /// The ButtonController
119 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
124 xformsBC & FormGraphics::bc()