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

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

class AnimatedColor;
class AnimatedNumber;
class URIReference;
class ElementNode;
/**
@author Hans Oischinger
*/
class FillAttribute : public Attribute
{
public:
  enum FillType { FILL_UNSPECIFIED,
                  FILL_NONE,
                  FILL_SOLID,
                  FILL_REF,
                  //                   FILL_GRADIENT,
                  //                   FILL_PATTERN,
                  FILL_UNKNOWN };

  FillAttribute( ElementNode* parent );
  ~FillAttribute();

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

  virtual void accept( AVisitor& );

  unsigned int fillType() const { return m_fillType; }
  const QString readableFillType() const;
  void setFillType( unsigned int t );

  AnimatedColor& color() const { return *m_color; }
  AnimatedNumber& fillOpacity() const { return *m_fillOpacity; }
  URIReference& ref() const { return *m_ref; }

protected:
  void init();

private:
  ElementNode* m_parentElement; // The Element that owns us
  unsigned int m_fillType;
  AnimatedColor *m_color;
  AnimatedNumber* m_fillOpacity;
  URIReference* m_ref;
};
#endif
