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