LeechCraft Azoth  0.6.70-16373-g319c272718
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
virtual QList< QObject * > GetResourceSources() const =0
Returns the resource sources that this plugin provides.
virtual QHash< QImage, QString > GetReprImages(const QString &pack) const =0
Returns emoticons and their string representations from the given emoticon pack.
uint qHash(const QImage &image)
virtual QByteArray GetImage(const QString &pack, const QString &string) const =0
Returns the data corresponding to the given smile.
Interface for smile resource loaders.
virtual QSet< QString > GetEmoticonStrings(const QString &pack) const =0
Returns the strings that are replaceable with emoticons in the given pack.
Base interface for specific resource sources.
Interface for plugins having resource sources, like smile support or chat window styles.
virtual QAbstractItemModel * GetOptionsModel() const =0
Returns the model with the options for resource.