/****************************************************************************
** Form interface generated from reading ui file '/Linux/Programming/kdsl/src/statusDlg.ui'
**
** Created: Sat Aug 21 23:09:56 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.2   edited Nov 24 13:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#ifndef KDSLSTATS_H
#define KDSLSTATS_H

#include <qvariant.h>
#include <qwidget.h>
#include <qtimer.h>
#include <qpixmap.h>
#include <qlabel.h>
#include <qdialog.h>
#include <qgroupbox.h>
#include <qevent.h>

class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class QFrame;
class QLabel;
class DockWidget;

const int MAX_GRAPH_WIDTH    = 600;
const int GRAPH_UPDATE_TIME = 1000;

class PPPStats;
class Configuration;

class kdslStats : public QWidget
{
    Q_OBJECT

public:
    kdslStats( QWidget* parent, const char* name,QWidget *main, PPPStats* st );
    ~kdslStats();

    QFrame* frame16;
    QLabel* textLabel6;
    QLabel* timeLabel;
    QLabel* textLabel2;
    QLabel* localIPLabel;
    QLabel* textLabel1;
    QLabel* connectionLabel;
    QLabel* receivedLabel;
    QLabel* sentLabel;
    QLabel* textLabel3;
    QLabel* remoteIPLabel;
    QFrame* graph;
    QWidget *main;
    DockWidget* dock_widget;           
    void startClock();

public slots:
    void updateGraph();
    void take_stats();
    void stop_stats();
    void paintGraph();
    void interfaceDown();
            
protected:
    QGridLayout* kdslStatsLayout;
    QGridLayout* frame16Layout;
    QGridLayout* layout40;
    QGridLayout* layout39;
    QHBoxLayout* layout34;
    QHBoxLayout* layout33;
    QHBoxLayout* layout35;
    QHBoxLayout* layout38;
    QHBoxLayout* layout32;
//  void closeEvent( QCloseEvent *e );
  void paintEvent (QPaintEvent *e) ;
  bool event( QEvent *e );
  
protected slots:
    virtual void languageChange();

private:
    QColor bg, text, in, out;
    int ibytes_last;
    int obytes_last;
    bool need_to_paint;
    PPPStats *stats;
    int bin[MAX_GRAPH_WIDTH];
    int bout[MAX_GRAPH_WIDTH];
    int bin_last;
    int bout_last;
    int ringIdx;
    int max;
    QTimer *graphTimer;

};

#endif // KDSLSTATS_H
