/***************************************************************************
                          lines.h  -  description
                             -------------------
    begin                : Son Apr 14 2002
    copyright            : (C) 2002 by Birgit Schulz
    email                : B.Schulz@Superlehrer.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef LINES_H
#define LINES_H

#include "ui_LinesD.h"
#include "ui_LineInputD.h"
//Added by qt3to4:
#include <QPaintEvent>

class QWidget;

class KPlotWidget;

/**
  *@author Birgit Schulz
  */

class Lines : public LinesD
{
    Q_OBJECT

public:
    Lines(QWidget *parent=0, const char *name=0);
    ~Lines();
    enum EFunctions {OnePoint, TwoPoints, AxisSection, Section};

protected:
    EFunctions m_eSelected;
    double Gradient(double x1, double x2, double y1, double y2, bool &bSucess);
    double AxisCut(double m, double x1, double y1);
    void hideInput();

    virtual void paintEvent( QPaintEvent* );

protected slots:
    void slotCalculate();
    void slotClear();
    void slotShowLinesOnePoint();
    void slotShowLinesTwoPoints();
    void slotShowLinesSection();
    void slotShowLinesAxisSection();

    void slotUpdateLines();

private:
    void initObjects();
    KPlotWidget *pw;
    LineInput *li;
};

#endif
