/***************************************************************************
 *   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 STROKEATTRIBUTE_H
#define STROKEATTRIBUTE_H

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

class AnimatedColor;
class AnimatedNumber;
class URIReference;
class ElementNode;
/**
@author Hans Oischinger
*/
class StrokeAttribute : public Attribute
{
public:

  enum StrokeType { STROKE_UNSPECIFIED,
                    STROKE_NONE,
                    STROKE_SOLID,
                    STROKE_REF,
/*                    STROKE_GRADIENT,
                    STROKE_PATTERN,*/
                    STROKE_UNKNOWN };

  //   enum LineCap
  //   {
  //     LINECAP_BUTT,
  //     LINECAP_ROUND,
  //     LINECAP_SQUARE
  //   };
  //
  //   enum LineJoin
  //   {
  //     LINEJOIN_MITER,
  //     LINEJOIN_ROUND,
  //     LINEJOIN_BEVEL
  //   };

  StrokeAttribute( ElementNode* parent );
  StrokeAttribute( const StrokeAttribute& );
  ~StrokeAttribute();

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

  virtual void accept( AVisitor& );

  unsigned int strokeType() const { return m_strokeType; }
  const QString readableStrokeType() const;
  void setStrokeType( unsigned int t );

  AnimatedColor& color() const { return *m_color; }
  AnimatedNumber& strokeOpacity() const { return *m_strokeOpacity; }
  AnimatedNumber& strokeWidth() const { return *m_strokeWidth; }
  URIReference& ref() const { return *m_ref; }

protected:
  void init();

private:
  ElementNode* m_parentElement; // The Element that owns us
  unsigned int m_strokeType;
  AnimatedColor *m_color;
  AnimatedNumber* m_strokeOpacity;
  AnimatedNumber* m_strokeWidth;
  URIReference* m_ref;
};

#endif
