/****************************************************************************
**
** Copyright (C) 1992-2004 Trolltech AS. All rights reserved.
**
** This file is part of the core module of the Qt Toolkit.
**
** Licensees holding valid Qt Preview licenses may use this file in
** accordance with the Qt Preview License Agreement provided with the
** Software.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/

#ifndef QTIMER_H
#define QTIMER_H

#include "qbasictimer.h" // conceptual inheritance
#include "qobject.h"


class Q_CORE_EXPORT QTimer : public QObject
{
    Q_OBJECT

public:
    QTimer(QObject *parent = 0);
#ifdef QT_COMPAT
    QT_COMPAT_CONSTRUCTOR QTimer(QObject *parent, const char *name);
#endif
    ~QTimer();

    static void singleShot(int msec, QObject *receiver, const char *member);

    inline bool isActive() const { return id >= 0; }
    int timerId() const { return id; }

public slots:
    int                start(int msec, bool sshot = false);
    void        changeInterval(int msec);
    void        stop();

signals:
    void        timeout();

protected:
    bool        event(QEvent *);

private:
    Q_DISABLE_COPY(QTimer)

    int id;
    uint single : 1;
    uint nulltimer : 1;
};

#endif // QTIMER_H
