]> git.lyx.org Git - features.git/blob - src/frontends/qt2/lengthvalidator.h
ea457211549860287f5f3228ccab3979852b629f
[features.git] / src / frontends / qt2 / lengthvalidator.h
1 // -*- C++ -*-
2 /**
3  * \file lengthvalidator.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LENGTHVALIDATOR_H
13 #define LENGTHVALIDATOR_H
14
15 #include "lyxlength.h"
16 #include "lyxgluelength.h"
17 #include <qvalidator.h>
18
19 class QWidget;
20
21
22 class Q_EXPORT LengthValidator : public QValidator
23 {
24         Q_OBJECT
25 public:
26         LengthValidator(QWidget * parent, const char *name = 0);
27
28         QValidator::State validate(QString &, int &) const;
29
30         void setBottom(LyXLength const &);
31         void setBottom(LyXGlueLength const &);
32         LyXLength bottom() const { return b_; }
33
34 private:
35 #if defined(Q_DISABLE_COPY)
36         LengthValidator( const LengthValidator & );
37         LengthValidator& operator=( const LengthValidator & );
38 #endif
39
40         LyXLength b_;
41         LyXGlueLength g_;
42         bool no_bottom_;
43         bool glue_length_;
44 };
45
46 # endif // NOT LENGTHVALIDATOR_H