#define VALIDATOR_H
#include "Length.h"
-#include "Dialog.h"
+#include "Dialog.h" // KernelDocType
#include <QValidator>
namespace lyx {
+class LyXRC;
+
+namespace frontend {
+
/** A class to ascertain whether the data passed to the @c validate()
* member function can be interpretted as a GlueLength.
*/
//@}
private:
-#if defined(Q_DISABLE_COPY)
- LengthValidator( const LengthValidator & );
- LengthValidator& operator=( const LengthValidator & );
-#endif
-
Length b_;
GlueLength g_;
bool no_bottom_;
class LengthAutoValidator : public LengthValidator
{
Q_OBJECT
- public:
+public:
/// Define a validator for widget @c parent.
- LengthAutoValidator(QWidget * parent);
+ LengthAutoValidator(QWidget * parent);
/** @returns QValidator::Acceptable if @c data is a GlueLength
* or is "auto". If not, returns QValidator::Intermediate.
*/
- QValidator::State validate(QString & data, int &) const;
+ QValidator::State validate(QString & data, int &) const;
};
/// @returns a new @c LengthAutoValidator that does not accept negative lengths.
LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit *);
+
//FIXME As above, this should really take a text argument.
/**
* A class to determine whether the passed is a double
* or is "auto".
*
*/
-class DoubleAutoValidator : public QDoubleValidator {
+class DoubleAutoValidator : public QDoubleValidator
+{
Q_OBJECT
- public:
- DoubleAutoValidator(QWidget * parent);
- DoubleAutoValidator(double bottom, double top, int decimals,
- QObject * parent);
- QValidator::State validate(QString & input, int & pos) const;
+public:
+ DoubleAutoValidator(QWidget * parent);
+ DoubleAutoValidator(double bottom, double top, int decimals,
+ QObject * parent);
+ QValidator::State validate(QString & input, int & pos) const;
};
-// Forward declarations
-class LyXRC;
/** A class to ascertain whether the data passed to the @c validate()
* member function is a valid file path.
* @param lyxrc contains a @c tex_allows_spaces member that
* is used to define what is legal.
*/
- void setChecker(frontend::KernelDocType const & doc_type,
- LyXRC const & lyxrc);
+ void setChecker(KernelDocType const & doc_type, LyXRC const & lyxrc);
private:
-#if defined(Q_DISABLE_COPY)
- PathValidator(const PathValidator &);
- PathValidator & operator=(const PathValidator &);
-#endif
-
bool acceptable_if_empty_;
bool latex_doc_;
bool tex_allows_spaces_;
/// @returns the PathValidator attached to the widget, or 0.
PathValidator * getPathValidator(QLineEdit *);
+} // namespace frontend
} // namespace lyx
# endif // NOT VALIDATOR_H