LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
iresourceplugin.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 #ifndef PLUGINS_AZOTH_INTERFACES_IRESOURCEPLUGIN_H
10 #define PLUGINS_AZOTH_INTERFACES_IRESOURCEPLUGIN_H
11 #include <QtGlobal>
12 #include <QStringList>
13 #include <QMap>
14 #include <QImage>
15 
16 class QAbstractItemModel;
17 
18 inline uint qHash (const QImage& image)
19 {
20  return image.cacheKey ();
21 }
22 
23 namespace LC
24 {
25 namespace Azoth
26 {
38  {
39  public:
40  virtual ~IResourceSource () {}
41 
56  virtual QAbstractItemModel* GetOptionsModel () const = 0;
57  };
58 
68  {
69  public:
71 
87  virtual QSet<QString> GetEmoticonStrings (const QString& pack) const = 0;
88 
104  virtual QHash<QImage, QString> GetReprImages (const QString& pack) const = 0;
105 
128  virtual QByteArray GetImage (const QString& pack, const QString& string) const = 0;
129  };
130 
145  {
146  public:
147  virtual ~IResourcePlugin () {}
148 
159  virtual QList<QObject*> GetResourceSources () const = 0;
160  };
161 }
162 }
163 
164 Q_DECLARE_INTERFACE (LC::Azoth::IEmoticonResourceSource,
165  "org.Deviant.LeechCraft.Azoth.IEmoticonResourceSource/1.0")
166 Q_DECLARE_INTERFACE (LC::Azoth::IResourcePlugin,
167  "org.Deviant.LeechCraft.Azoth.IResourcePlugin/1.0")
168 
169 #endif
LC::Azoth::IEmoticonResourceSource::GetImage
virtual QByteArray GetImage(const QString &pack, const QString &string) const =0
Returns the data corresponding to the given smile.
QList
Definition: iaccountactionsprovider.h:16
LC::Azoth::IEmoticonResourceSource::GetReprImages
virtual QHash< QImage, QString > GetReprImages(const QString &pack) const =0
Returns emoticons and their string representations from the given emoticon pack.
LC::Azoth::IResourcePlugin::~IResourcePlugin
virtual ~IResourcePlugin()
Definition: iresourceplugin.h:147
LC::Azoth::IResourcePlugin::GetResourceSources
virtual QList< QObject * > GetResourceSources() const =0
Returns the resource sources that this plugin provides.
LC::Azoth::IEmoticonResourceSource
Interface for smile resource loaders.
Definition: iresourceplugin.h:67
LC::Azoth::IEmoticonResourceSource::~IEmoticonResourceSource
virtual ~IEmoticonResourceSource()
Definition: iresourceplugin.h:70
LC::Azoth::IEmoticonResourceSource::GetEmoticonStrings
virtual QSet< QString > GetEmoticonStrings(const QString &pack) const =0
Returns the strings that are replaceable with emoticons in the given pack.
LC::Azoth::IResourceSource::~IResourceSource
virtual ~IResourceSource()
Definition: iresourceplugin.h:40
qHash
uint qHash(const QImage &image)
Definition: iresourceplugin.h:18
LC::Azoth::IResourcePlugin
Interface for plugins having resource sources, like smile support or chat window styles.
Definition: iresourceplugin.h:144
LC::Azoth::IResourceSource
Base interface for specific resource sources.
Definition: iresourceplugin.h:37
LC
Definition: activityinfo.h:13
LC::Azoth::IResourceSource::GetOptionsModel
virtual QAbstractItemModel * GetOptionsModel() const =0
Returns the model with the options for resource.