]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreferences.h
major GUII cleanup + Baruchs patch + Angus's patch + removed a couple of generated...
[lyx.git] / src / frontends / xforms / FormPreferences.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995 Matthias Ettrich
8  *          Copyright 1995-2000 The LyX Team.
9  *
10  *          This file copyright 1999-2000
11  *          Allan Rae
12  *======================================================*/
13 /* FormPreferences.h
14  * FormPreferences Interface Class
15  */
16
17 #ifndef FORMPREFERENCES_H
18 #define FORMPREFERENCES_H
19
20 #include "DialogBase.h"
21 #include "support/utility.hpp"
22
23 #ifdef __GNUG_
24 #pragma interface
25 #endif
26
27 class LyXView;
28 class Dialogs;
29 class PreferencesPolicy;
30 template <class x> class ButtonController;
31
32 struct FD_form_preferences;
33 struct FD_form_bind;
34 struct FD_form_misc;
35 struct FD_form_screen_fonts;
36 struct FD_form_interface_fonts;
37 struct FD_form_printer;
38 struct FD_form_paths;
39
40 #ifdef SIGC_CXX_NAMESPACES
41 using SigC::Connection;
42 #endif
43
44 /** This class provides an XForms implementation of the FormPreferences Dialog.
45     The preferences dialog allows users to set/save their preferences.
46  */
47 class FormPreferences : public DialogBase, public noncopyable {
48 public:
49         /**@name Constructors and Destructors */
50         //@{
51         /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
52         FormPreferences(LyXView *, Dialogs *);
53         ///
54         ~FormPreferences();
55         //@}
56
57         /**@name Real per-instance Callback Methods */
58         //@{
59         static  int WMHideCB(FL_FORM *, void *);
60         static void OKCB(FL_OBJECT *, long);
61         static void ApplyCB(FL_OBJECT *, long);
62         static void CancelCB(FL_OBJECT *, long);
63         static void InputCB(FL_OBJECT *, long);
64         static void RestoreCB(FL_OBJECT *, long);
65         //@}
66
67 private:
68         /**@name Slot Methods */
69         //@{
70         /// Create the dialog if necessary, update it and display it.
71         void show();
72         /// Hide the dialog.
73         void hide();
74         /// Update the dialog.
75         void update();
76         //@}
77
78         /**@name Dialog internal methods */
79         //@{
80         /// Apply from dialog
81         void apply();
82         /// Filter the inputs -- return true if entries are valid
83         bool input();
84         /// Build the dialog
85         void build();
86         ///
87         FD_form_preferences * build_preferences();
88         ///
89         FD_form_bind * build_bind();
90         ///
91         FD_form_misc * build_misc();
92         ///
93         FD_form_screen_fonts * build_screen_fonts();
94         ///
95         FD_form_interface_fonts * build_interface_fonts();
96         ///
97         FD_form_printer * build_printer();
98         ///
99         FD_form_paths * build_paths();
100         //@}
101
102         /**@name Private Data */
103         //@{
104         /// Real GUI implementation.
105         FD_form_preferences * dialog_;
106         ///
107         FD_form_bind * bind_;
108         ///
109         FD_form_misc * misc_;
110         ///
111         FD_form_screen_fonts * screen_fonts_;
112         ///
113         FD_form_interface_fonts * interface_fonts_;
114         ///
115         FD_form_printer * printer_;
116         ///
117         FD_form_paths * paths_;
118         /// Which LyXView do we belong to?
119         LyXView * lv_;
120         ///
121         Dialogs * d_;
122         /// Update connection.
123         Connection u_;
124         /// Hide connection.
125         Connection h_;
126         /// Overcome a dumb xforms sizing bug
127         int minw_, minh_;
128         ///
129         ButtonController<PreferencesPolicy> * bc_;
130         //@}
131 };
132
133 #endif