3 * FormGraphics Interface Class
6 * ======================================================
8 * LyX, The Document Processor
10 * Copyright 1995 Matthias Ettrich
11 * Copyright 1995-2000 The LyX Team.
13 * This file Copyright 2000
15 * ======================================================
18 #ifndef FORMGRAPHICS_H
19 #define FORMGRAPHICS_H
22 #include "frontends/DialogBase.h"
23 #include "RadioButtonGroup.h"
24 #include "support/utility.hpp"
31 // same arguement as in Dialogs.h s/LyX/UI/
35 struct FD_form_graphics;
37 /** This class provides an XForms implementation of the FormGraphics Dialog.
39 class FormGraphics: public DialogBase, public noncopyable {
41 /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
42 FormGraphics(LyXView *, Dialogs *);
46 static int WMHideCB(FL_FORM *, void *);
48 static void OKCB(FL_OBJECT *, long);
50 static void ApplyCB(FL_OBJECT *, long);
52 static void CancelCB(FL_OBJECT *, long);
54 static void BrowseCB(FL_OBJECT *, long);
56 static void AdvancedOptionsCB(FL_OBJECT *, long);
58 static void InputCB(FL_OBJECT *, long);
61 /// The maximum digits for the image width (cm, inch, percent)
66 /// The maximum digits for the image height (cm, inch, percent)
71 /// The maximum characters in the rotation angle (minus sign and 3 digits)
76 /// The maximum characters in a filename.
79 FILENAME_MAXCHARS = 1024
82 /// Save the active inset and show the dialog.
83 void showDialog(InsetGraphics * inset);
84 /// Create the dialog if necessary, update it and display it.
91 /// Apply the changes to the inset.
93 /// Verify that the input is correct. If not disable ok/apply buttons.
95 /// Open the file browse dialog to select an image file.
101 FD_form_graphics * build_graphics();
102 /// Explicitly free the dialog.
104 /// Display a file browser dialog and return the file chosen.
105 string browseFile(string const & filename);
107 /// Real GUI implementation.
108 FD_form_graphics * dialog_;
109 /** Which LyXFunc do we use?
110 We could modify Dialogs to have a visible LyXFunc* instead and
111 save a couple of bytes per dialog.
114 /** Which Dialogs do we belong to?
115 Used so we can get at the signals we have to connect to.
118 /** Which Inset do we belong to?
119 Used to set and update data to/from the inset.
121 InsetGraphics * inset_;
122 /// The radio buttons groups
123 RadioButtonGroup widthButtons;
125 RadioButtonGroup heightButtons;
127 RadioButtonGroup displayButtons;
129 /// Inset Hide connection, connected to the calling inset hide signal.
133 /// Update connection.
135 /// Last used figure path
136 string last_image_path;