This is the verbatim text of the qvalidator.h include file. It is is provided only for illustration; the copyright remains with Troll Tech


/****************************************************************************
** $Id: qvalidator.h,v 2.9 1997/09/04 16:40:25 agulbra Exp $
**
** Definition of validator classes.
**
** Created : 970610
**
** Copyright (C) 1997 by Troll Tech AS.  All rights reserved.
**
****************************************************************************/

#ifndef QVALIDATOR_H
#define QVALIDATOR_H

#include "qobject.h"
#include "qstring.h"


class QValidator: public QObject
{
    Q_OBJECT
public:
    QValidator( QWidget * parent, const char * name = 0 );
    ~QValidator();

    enum State { Invalid, Valid, Acceptable };

    virtual State validate( QString &, int & ) = 0;
    virtual void fixup( QString & );
};


class QIntValidator: public QValidator
{
    Q_OBJECT
public:
    QIntValidator( QWidget * parent, const char * name = 0 );
    QIntValidator( int bottom, int top,
                   QWidget * parent, const char * name = 0 );
    ~QIntValidator();

    QValidator::State validate( QString &, int & );

    virtual void setRange( int bottom, int top );

    int bottom() const { return b; }
    int top() const { return t; }
    
private:
    int b, t;
};


class QDoubleValidator: public QValidator
{
    Q_OBJECT
public:
    QDoubleValidator( QWidget * parent, const char * name = 0 );
    QDoubleValidator( double bottom, double top, int decimals,
                      QWidget * parent, const char * name = 0 );
    ~QDoubleValidator();

    QValidator::State validate( QString &, int & );

    virtual void setRange( double bottom, double top, int decimals = 0 );

    double bottom() const { return b; }
    double top() const { return t; }
    int decimals() const { return d; }
    
private:
    double b, t;
    int d;
};


#endif // QVALIDATOR_H


Generated at 13:30, 1998/01/15 for Qt version 1.32 by the webmaster at Troll Tech