3 * \file xforms/checkedwidgets.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
12 #ifndef CHECKEDWIDGETS_H
13 #define CHECKEDWIDGETS_H
16 #include "forms_fwd.h"
21 class CheckedLyXLength;
22 class CheckedGlueLength;
28 addCheckedLyXLength(BCView & bcview, FL_OBJECT * input, FL_OBJECT * label = 0);
31 addCheckedGlueLength(BCView & bcview, FL_OBJECT * input, FL_OBJECT * label = 0);
34 addCheckedPath(BCView & bcview, bool acceptable_if_empty,
35 FL_OBJECT * input, FL_OBJECT * label = 0);
38 class CheckedLyXLength : public CheckedWidget {
40 /** The label widget's label will be turned red if input
41 * does not make a valid LyXLength.
42 * If label == 0, then the label of input will be used.
44 CheckedLyXLength(FL_OBJECT * input, FL_OBJECT * label = 0);
48 virtual bool check() const;
56 class CheckedGlueLength : public CheckedWidget {
58 /** The label widget's label will be turned red if input
59 * does not make a valid LyXGlueLength.
60 * If label == 0, then the label of input will be used.
62 CheckedGlueLength(FL_OBJECT * input, FL_OBJECT * label = 0);
66 virtual bool check() const;
73 } // namespace frontend
77 // Forward declarations
86 class CheckedPath : public CheckedWidget {
88 /** The label widget's label will be turned red if input
89 * does not make a valid file path.
90 * If label == 0, then the label of input will be used.
91 * If @c acceptable_if_empty is @c true then an empty path
92 * is regarded as acceptable.
94 CheckedPath(bool acceptable_if_empty,
95 FL_OBJECT * input, FL_OBJECT * label = 0);
97 /** Define now to perform the check.
98 * @param doc_type checks are activated only for @c LATEX docs.
99 * @param lyxrc contains a @c tex_allows_spaces member that
100 * is used to define what is legal.
102 void setChecker(lyx::frontend::KernelDocType const & doc_type,
103 LyXRC const & lyxrc);
107 virtual bool check() const;
113 bool acceptable_if_empty_;
115 bool tex_allows_spaces_;
118 } // namespace frontend
121 #endif // CHECKEDWIDGETS_H