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

#include "visitor.h"
#include <qptrlist.h>

class AttributeListViewItem;
class QListView;
class QString;
class Transformable;
class Stylable;
class Gradient;
/**
Creates PropertyItems of an element's attributes for the AttributeListView
 
@author Hans Oischinger
*/
class VPropertyItemCreator : public Visitor
{
public:
  VPropertyItemCreator( QListView *parent );
  ~VPropertyItemCreator();

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

protected:
  bool visitAbstractAnimateElement( AnimateElement& element );
  bool visitAbstractGradient( Gradient& element );
  bool visitAbstractTransformable( Transformable &element );
  bool visitAbstractStylable( Stylable &element );

  void appendPropItem( QString name, AttributeListViewItem* item );

protected:
  QPtrList<AttributeListViewItem> m_propItems;
  QListView* m_propParent;
};

#endif
