2
* \file pixmapprovider.h
3
* Image provider to get pixmaps by ID.
9
* Copyright (C) 2014 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#ifndef PIXMAPPROVIDER_H
28
#define PIXMAPPROVIDER_H
34
class TaggedFileIconProvider;
37
* Image provider to get pixmaps by ID.
39
* The following source IDs are supported (starting with "image://kid3/"):
40
* - "fileicon/" followed by "null", "notag", "v1", "v2", "v1v2", or "modified",
41
* - "data" followed by a changing string to force loading of the image set with
42
* TaggedFileIconProvider::setImageData().
44
class KID3_CORE_EXPORT PixmapProvider {
48
* @param iconProvider icon provider to use
50
explicit PixmapProvider(TaggedFileIconProvider* iconProvider);
59
* @param id ID of pixmap to get, "image://kid3/fileicon/..." or
60
* "image://kid3/data..."
61
* @param size the original size of the image is returned here
62
* @param requestedSize the size requested via the Image.sourceSize property
63
* @return pixmap for ID.
65
QPixmap getPixmap(const QString& id, QSize* size, const QSize& requestedSize);
68
* Get image data for the pixmap available via the "data" icon ID.
71
QByteArray getImageData() const { return m_data; }
74
* Set image data for the pixmap available via the "data" icon ID.
75
* @param data image data
77
void setImageData(const QByteArray& data) {
82
TaggedFileIconProvider* m_fileIconProvider;
88
#endif // PIXMAPPROVIDER_H