]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreferences.h
allow derived classes to manipulate signal connections
[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         /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
50         FormPreferences(LyXView *, Dialogs *);
51         ///
52         ~FormPreferences();
53
54         ///
55         static  int WMHideCB(FL_FORM *, void *);
56         ///
57         static void OKCB(FL_OBJECT *, long);
58         ///
59         static void ApplyCB(FL_OBJECT *, long);
60         ///
61         static void CancelCB(FL_OBJECT *, long);
62         ///
63         static void InputCB(FL_OBJECT *, long);
64         ///
65         static void RestoreCB(FL_OBJECT *, long);
66 private:
67         /// Create the dialog if necessary, update it and display it.
68         void show();
69         /// Hide the dialog.
70         void hide();
71         /// Update the dialog.
72         void update();
73
74         /// Apply from dialog
75         void apply();
76         /// Filter the inputs -- return true if entries are valid
77         bool input();
78         /// Build the dialog
79         void build();
80         ///
81         FD_form_preferences * build_preferences();
82         ///
83         FD_form_bind * build_bind();
84         ///
85         FD_form_misc * build_misc();
86         ///
87         FD_form_screen_fonts * build_screen_fonts();
88         ///
89         FD_form_interface_fonts * build_interface_fonts();
90         ///
91         FD_form_printer * build_printer();
92         ///
93         FD_form_paths * build_paths();
94
95         /// Real GUI implementation.
96         FD_form_preferences * dialog_;
97         ///
98         FD_form_bind * bind_;
99         ///
100         FD_form_misc * misc_;
101         ///
102         FD_form_screen_fonts * screen_fonts_;
103         ///
104         FD_form_interface_fonts * interface_fonts_;
105         ///
106         FD_form_printer * printer_;
107         ///
108         FD_form_paths * paths_;
109         /// Which LyXView do we belong to?
110         LyXView * lv_;
111         ///
112         Dialogs * d_;
113         /// Update connection.
114         Connection u_;
115         /// Hide connection.
116         Connection h_;
117         /// Overcome a dumb xforms sizing bug
118         int minw_;
119         ///
120         int minh_;
121         ///
122         ButtonController<PreferencesPolicy> * bc_;
123 };
124
125 #endif