blob: 5325f15b2109c39db289b61022b7c3997de09829 [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001/*
2 * Copyright (C) 2015-2020 by Savoir-faire Linux
3 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <QImage>
22
23#include <interfaces/pixmapmanipulatori.h>
24#include <memory>
25
26Q_DECLARE_METATYPE(QImage);
27
28class Person;
29
30QByteArray QImageToByteArray(QImage image);
31
32class PixbufManipulator : public Interfaces::PixmapManipulatorI
33{
34public:
35 QVariant personPhoto(const QByteArray &data, const QString &type = "PNG") override;
36
37 /*
38 * TODO: the following methods return an empty QVariant/QByteArray.
39 */
40 QVariant numberCategoryIcon(const QVariant &p,
41 const QSize &size,
42 bool displayPresence = false,
43 bool isPresent = false) override;
44 QByteArray toByteArray(const QVariant &pxm) override;
45 QVariant userActionIcon(const UserActionElement &state) const override;
46 QVariant decorationRole(const QModelIndex &index) override;
47 QVariant decorationRole(const lrc::api::conversation::Info &conversation,
48 const lrc::api::account::Info &accountInfo) override;
49};