1
/****************************************************************************
2
* Copyright (C) 2013-2014 by Savoir-Faire Linux ***
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library 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 GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#ifndef PIXMAPMANIPULATIONVISITOR_H
19
#define PIXMAPMANIPULATIONVISITOR_H
20
#include "../typedefs.h"
23
#include <QtCore/QVariant>
31
* Different clients can have multiple way of displaying images. Some may
32
* add borders, other add corner radius (see Ubuntu-SDK HIG). This
33
* abstract class define many operations that can be defined by each clients.
35
* Most methods return QVariants as this library doesn't link against QtGui
37
* This interface is not frozen, more methods may be added later. To implement,
38
* just create an object somewhere, be sure to call PixmapManipulationVisitor()
40
class LIB_EXPORT PixmapManipulationVisitor {
42
PixmapManipulationVisitor();
43
virtual ~PixmapManipulationVisitor() {}
44
virtual QVariant contactPhoto(Contact* c, QSize size, bool displayPresence = true);
45
virtual QVariant callPhoto(Call* c, QSize size, bool displayPresence = true);
46
virtual QVariant callPhoto(const PhoneNumber* n, QSize size, bool displayPresence = true);
47
virtual QVariant numberCategoryIcon(const QPixmap* p, QSize size, bool displayPresence = false, bool isPresent = false);
50
static PixmapManipulationVisitor* instance();
52
static PixmapManipulationVisitor* m_spInstance;
55
#endif //PIXMAPMANIPULATIONVISITOR_H