LeechCraft Azoth 0.6.70-16373-g319c272718
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
ihaveavatars.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QImage>
12#include <QFuture>
13#include <QtPlugin>
14
15namespace LC
16{
17namespace Azoth
18{
22 {
23 protected:
24 virtual ~IHaveAvatars () {}
25 public:
28 enum class Size
29 {
33
37 };
38
57
62 virtual bool HasAvatar () const = 0;
63
69 virtual bool SupportsSize (Size size) const = 0;
70 protected:
83 virtual void avatarChanged (QObject *thisObject) = 0;
84 };
85
91 inline uint qHash (IHaveAvatars::Size size)
92 {
93 return static_cast<uint> (size);
94 }
95}
96}
97
98Q_DECLARE_INTERFACE (LC::Azoth::IHaveAvatars,
99 "org.LeechCraft.Azoth.IHaveAvatars/1.0")
Describes an entry that can have an associated avatar.
virtual bool HasAvatar() const =0
Returns whether this exact entry has any avatar.
Size
The size of the avatar.
@ Thumbnail
Thumbnail avatar, possibly cropped.
virtual bool SupportsSize(Size size) const =0
Whether this entry has an avatar of the given size.
virtual QFuture< QImage > RefreshAvatar(Size size)=0
Requests the avatar of the given size.
virtual void avatarChanged(QObject *thisObject)=0
Notifies that the avatar of the entry has been changed.
uint qHash(IHaveAvatars::Size size)
Defines a hashing function for avatar sizes.