File indexing completed on 2024-04-21 15:07:55

0001 /*
0002  * Copyright 1999 by Martin R. Jones <mjones@kde.org>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License
0015  * along with this program; if not, write to the Free Software
0016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0017  */
0018 #ifndef AMORPIXMAPMANAGER_H
0019 #define AMORPIXMAPMANAGER_H
0020 
0021 #include <QHash>
0022 #include <QString>
0023 
0024 class QPixmap;
0025 
0026 
0027 class AmorPixmapManager
0028 {
0029     public:
0030         AmorPixmapManager();
0031         virtual ~AmorPixmapManager();
0032 
0033         void setPixmapDir(const QString &dir);
0034 
0035         void reset();
0036 
0037         const QPixmap *load(const QString & img);
0038         const QPixmap *pixmap(const QString & img) const;
0039 
0040         static AmorPixmapManager* manager();
0041 
0042     public:
0043         QString mPixmapDir;                  // get pixmaps from here
0044         QHash<QString, QPixmap*> mPixmaps;   // list of pixmaps
0045         static AmorPixmapManager *mManager;  // static pointer to instance
0046 };
0047 
0048 
0049 #endif
0050 
0051 // kate: word-wrap off; encoding utf-8; indent-width 4; tab-width 4; line-numbers on; mixed-indent off; remove-trailing-space-save on; replace-tabs-save on; replace-tabs on; space-indent on;
0052 // vim:set spell et sw=4 ts=4 nowrap cino=l1,cs,U1:
0053