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

#include "visitor.h"

class Gradient;
/**
Visitor that sets all Element's animValues according to the current point of time
and calls setDirty() if a animVal has changed
@author Hans Oischinger
*/
class VSetAnimValues : public Visitor
{
public:
  VSetAnimValues();
  virtual ~VSetAnimValues();

  virtual bool visit( DocumentElement& element );
  virtual bool visit( VectorElement& element );
  virtual bool visit( AnimateTransformElement& element );
  virtual bool visit( AnimateLengthElement& element );
  virtual bool visit( AnimateNumberElement& element );
  virtual bool visit( GroupElement& element );
  virtual bool visit( DefsElement& element );
  virtual bool visit( UseElement& element );
  virtual bool visit( LinearGradient& element );
  virtual bool visit( RadialGradient& element );
  virtual bool visit( StopElement& element );

protected:
  virtual bool processGradient( Gradient& element );

protected:
  static double getAnimationTime( AnimateElement& element );
};

#endif
