/***************************************************************************
 *   Copyright (C) 2010 by Juergen Thies                                   *
 *   layout@juergenthies.de                                                *
 *                                                                         *
 *   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.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/ 

#ifndef ICONPROVIDER_H

#define ICONPROVIDER_H
#include <QFileInfo>
#include <QFileIconProvider>

class iconProvider : public QFileIconProvider
{
public:
  iconProvider(){};
  ~iconProvider(){};
  virtual QIcon icon ( const QFileInfo & info ) const {
    QString suf=info.completeSuffix();
    if (suf=="gds") return QIcon(":/icons/layoutfull.png");
    if (suf=="GDS") return QIcon(":/icons/layoutfull.png");
    if (suf=="gds.gz") return QIcon(":/icons/layoutfull.png");
    if (suf=="GDS.gz") return QIcon(":/icons/layoutfull.png");
    if (suf=="oas") return QIcon(":/icons/layoutfull.png");
    if (suf=="OAS") return QIcon(":/icons/layoutfull.png");
    if (suf=="oasis") return QIcon(":/icons/layoutfull.png");
    if (suf=="OASIS") return QIcon(":/icons/layoutfull.png");
    if (suf=="oas.gz") return QIcon(":/icons/layoutfull.png");
    if (suf=="OAS.gz") return QIcon(":/icons/layoutfull.png");
    if (suf=="cif") return QIcon(":/icons/layoutreduced.png");
    if (suf=="CIF") return QIcon(":/icons/layoutreduced.png");
    if (suf=="dxf") return QIcon(":/icons/layoutreduced.png");
    if (suf=="DXF") return QIcon(":/icons/layoutreduced.png");
    if (suf=="les") return QIcon(":/icons/netlisticon.png");
    if (suf=="LES") return QIcon(":/icons/netlisticon.png");
    return QFileIconProvider::icon(info);
  };
  
  /*
  virtual QString type ( const QFileInfo & info ) const {
    return QFileIconProvider::type(info);
  };*/
  
};

#endif
