source: calamares/trunk/fuentes/src/libcalamaresui/utils/ImageRegistry.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 1.7 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   SPDX-License-Identifier: GPLv3+
4 *   License-Filename: LICENSES/GPLv3+-ImageRegistry
5 */
6
7/*
8 *   Copyright 2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
9
10    This program is free software: you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation, either version 3 of the License, or
13    (at your option) any later version.
14
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program.  If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#ifndef IMAGE_REGISTRY_H
25#define IMAGE_REGISTRY_H
26
27#include <QPixmap>
28
29#include "utils/CalamaresUtilsGui.h"
30#include "UiDllMacro.h"
31
32class UIDLLEXPORT ImageRegistry
33{
34public:
35    static ImageRegistry* instance();
36
37    explicit ImageRegistry();
38
39    QIcon icon( const QString& image, CalamaresUtils::ImageMode mode = CalamaresUtils::Original );
40    QPixmap pixmap( const QString& image, const QSize& size, CalamaresUtils::ImageMode mode = CalamaresUtils::Original, float opacity = 1.0, QColor tint = QColor( 0, 0, 0, 0 ) );
41
42private:
43    qint64 cacheKey( const QSize& size, float opacity, QColor tint );
44    void putInCache( const QString& image, const QSize& size, CalamaresUtils::ImageMode mode, float opacity, const QPixmap& pixmap, QColor tint );
45
46    static ImageRegistry* s_instance;
47};
48
49#endif // IMAGE_REGISTRY_H
Note: See TracBrowser for help on using the repository browser.