#ifndef CCOLORWIDGET_H
#define CCOLORWIDGET_H

#include <qwidget.h>

class QGridLayout;
class QDoubleValidator;
class QSpinBox;
class QSlider;
class QLineEdit;
class QLabel;
class QColor;

class CColorWidget : public QWidget
{
  Q_OBJECT

  QGridLayout       *m_layout;
  QDoubleValidator  *m_doublevalidator;
  QSpinBox          *m_spinboxes[4];
  QSlider           *m_sliders[4];
  QLineEdit         *m_floatedit[4];
  QLabel            *m_labels[4];
  

  // Value of each component for each subwidget
  int m_ValueSlider[4];
  int m_ValueSpinbox[4];
  QString m_ValueFloat[4];

 public:
  CColorWidget( QWidget *parent = NULL, const char *name = NULL);
  ~CColorWidget();

  QColor getQtColor() const;
  void getFloatColor(float color[4]) const;
  void setColor(const float color[4]);

 private slots:
  void UpdateLine0();
  void UpdateLine1();
  void UpdateLine2();
  void UpdateLine3();

 signals:
  void Changed();
};

#endif // CCOLORWIDGET_H
