2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * This file copyright 1999-2000
12 *======================================================*/
14 * FormPreferences Interface Class
17 #ifndef FORMPREFERENCES_H
18 #define FORMPREFERENCES_H
20 #include "DialogBase.h"
21 #include "support/utility.hpp"
29 class PreferencesPolicy;
30 template <class x> class ButtonController;
32 struct FD_form_preferences;
35 struct FD_form_screen_fonts;
36 struct FD_form_interface_fonts;
37 struct FD_form_printer;
40 #ifdef SIGC_CXX_NAMESPACES
41 using SigC::Connection;
44 /** This class provides an XForms implementation of the FormPreferences Dialog.
45 The preferences dialog allows users to set/save their preferences.
47 class FormPreferences : public DialogBase, public noncopyable {
49 /**@name Constructors and Destructors */
51 /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
52 FormPreferences(LyXView *, Dialogs *);
57 /**@name Real per-instance Callback Methods */
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);
68 /**@name Slot Methods */
70 /// Create the dialog if necessary, update it and display it.
74 /// Update the dialog.
78 /**@name Dialog internal methods */
82 /// Filter the inputs -- return true if entries are valid
87 FD_form_preferences * build_preferences();
89 FD_form_bind * build_bind();
91 FD_form_misc * build_misc();
93 FD_form_screen_fonts * build_screen_fonts();
95 FD_form_interface_fonts * build_interface_fonts();
97 FD_form_printer * build_printer();
99 FD_form_paths * build_paths();
102 /**@name Private Data */
104 /// Real GUI implementation.
105 FD_form_preferences * dialog_;
107 FD_form_bind * bind_;
109 FD_form_misc * misc_;
111 FD_form_screen_fonts * screen_fonts_;
113 FD_form_interface_fonts * interface_fonts_;
115 FD_form_printer * printer_;
117 FD_form_paths * paths_;
118 /// Which LyXView do we belong to?
122 /// Update connection.
126 /// Overcome a dumb xforms sizing bug
129 ButtonController<PreferencesPolicy> * bc_;