/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __DBSDKICONLOADER_H
#define __DBSDKICONLOADER_H

#include <dbsdiconloader.h>

#include <qpixmap.h>
#include <qstring.h>

#include <kiconloader.h>

static const  int  KIconSizes[] = {
	KIcon::SizeSmall,
	KIcon::SizeSmallMedium,
	KIcon::SizeMedium,
	KIcon::SizeLarge,
	KIcon::SizeHuge,
	KIcon::SizeEnormous
};

class DBSDKIconLoader : public DBSDIconLoader {
public:
	virtual QPixmap  loadIcon(QString  name) {
		return  loadIcon(name,  Size16x16);
	}

	virtual QPixmap  loadIcon(QString  name,  Size  size) {
		if(size < 0 || size > sizeof(KIconSizes) / sizeof(KIconSizes[0]))
			return  QPixmap();

		int  kIconSize = KIconSizes[size];
		return  KGlobal::iconLoader()->loadIcon(name,  KIcon::Desktop,  kIconSize);
	}
};

#endif
