]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormGraphics.h
* Baruch's GuiBC template.
[lyx.git] / src / frontends / xforms / FormGraphics.h
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2000-2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file FormGraphics.h
11  * \author Baruch Even, baruch.even@writeme.com
12  */
13
14 #ifndef FORMGRAPHICS_H
15 #define FORMGRAPHICS_H
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif 
20
21 #include "FormBase.h"
22 #include "RadioButtonGroup.h"
23
24 class ControlGraphics;
25 struct FD_form_graphics;
26
27 /** This class provides an XForms implementation of the Graphics Dialog.
28  */
29 class FormGraphics : public FormCB<ControlGraphics, FormDB<FD_form_graphics> > {
30 public:
31         ///
32         FormGraphics(ControlGraphics &);
33
34 private:
35         /// Set the Params variable for the Controller.
36         virtual void apply();
37         /// Build the dialog.
38         virtual void build();
39         /// Hide the dialog.
40         virtual void hide();
41         /// Update dialog before/whilst showing it.
42         virtual void update();
43         /// Filter the inputs on callback from xforms
44         virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
45
46         /// The maximum digits for the image width (cm, inch, percent)
47         enum {
48             ///
49             WIDTH_MAXDIGITS = 3
50         };
51         /// The maximum digits for the image height (cm, inch, percent)
52         enum {
53             ///
54             HEIGHT_MAXDIGITS = 3
55         };
56         /// The maximum characters in the rotation angle (minus sign and 3 digits)
57         enum {
58             ///
59             ROTATE_MAXCHARS = 4
60         };
61         /// The maximum characters in a filename.
62         enum {
63             ///
64             FILENAME_MAXCHARS = 1024
65         };
66         ///
67         enum State {
68                 ///
69                 CHECKINPUT,
70                 ///
71                 BROWSE,
72                 ///
73                 ADVANCEDINPUT
74         };
75
76         /// Verify that the input is correct. If not disable ok/apply buttons.
77         ButtonPolicy::SMInput checkInput();
78
79         /// Fdesign generated method
80         FD_form_graphics * build_graphics();
81
82         /// The radio buttons groups
83         RadioButtonGroup widthButtons;
84         ///
85         RadioButtonGroup heightButtons;
86         ///
87         RadioButtonGroup displayButtons;
88         /// Last used figure path
89         string last_image_path;
90 };
91
92
93 #endif  // FORMGRAPHICS_H