/***************************************************************************
 *   Copyright (C) 2004 by Hans Oischinger                                 *
 *   hans.oischinger@kdemail.net                                           *
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.             *
 ***************************************************************************/
#ifndef COLORATTRIBUTE_H
#define COLORATTRIBUTE_H

#include "attribute.h"
#include <qstring.h>

class QColor;
/**
@author Hans Oischinger
*/
class ColorAttribute : public Attribute
{
public:
  enum ColorType { COLORT_UNSPECIFIED,
                   COLORT_NONE,
                   COLORT_NAME,
                   COLORT_RGB };

  ColorAttribute();
  ColorAttribute( int r, int g, int b );
  ColorAttribute( const QString& color);
  ColorAttribute( const QColor &color );
  ColorAttribute( const ColorAttribute & );
  ~ColorAttribute();

  ColorAttribute &operator=(const ColorAttribute &);
  virtual Attribute* clone();

  bool operator==(const ColorAttribute &);
  bool operator!=(const ColorAttribute &);

  virtual void accept( AVisitor& );

  //QColor& qColor() const { return *m_qColor; }
  QColor& qColor() const { return *m_qColor; }
  void setColor( const QColor &color );

  unsigned int colorType() const { return m_type; }

private:
  QColor *m_qColor;
  unsigned int m_type;
};

#endif
