LeechCraft Azoth  0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
imucperms.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_IMUCPERMS_H
10 #define PLUGINS_AZOTH_INTERFACES_IMUCPERMS_H
11 #include <QFlags>
12 #include <QMetaType>
13 #include <QMap>
14 #include <QByteArray>
15 #include <QPair>
16 
17 namespace LC
18 {
19 namespace Azoth
20 {
37  class IMUCPerms
38  {
39  public:
40  virtual ~IMUCPerms () {}
41 
54  virtual QMap<QByteArray, QList<QByteArray>> GetPossiblePerms () const = 0;
55 
65  virtual QMap<QByteArray, QList<QByteArray>> GetPerms (const ICLEntry& participant) const = 0;
66 
67  virtual QPair<QByteArray, QByteArray> GetKickPerm () const = 0;
68  virtual QPair<QByteArray, QByteArray> GetBanPerm () const = 0;
69 
86  virtual QByteArray GetAffName (const ICLEntry& participant) const = 0;
87 
106  virtual bool MayChangePerm (const ICLEntry& participant,
107  const QByteArray& permClass, const QByteArray& targetPerm) const = 0;
108 
127  virtual void SetPerm (ICLEntry& participant,
128  const QByteArray& permClass, const QByteArray& targetPerm, const QString& reason) = 0;
129 
141  virtual bool IsLessByPerm (const ICLEntry& part1, const ICLEntry& part2) const = 0;
142 
152  virtual bool IsMultiPerm (const QByteArray& permClass) const = 0;
153 
159  virtual QString GetUserString (const QByteArray& id) const = 0;
160 
181  virtual void TrySetPerm (const QString& userId,
182  const QByteArray& permClass, const QByteArray& targetPerm, const QString& reason)
183  {
184  Q_UNUSED (userId)
185  Q_UNUSED (permClass)
186  Q_UNUSED (targetPerm)
187  Q_UNUSED (reason)
188  }
189  };
190 }
191 }
192 
193 Q_DECLARE_INTERFACE (LC::Azoth::IMUCPerms,
194  "org.Deviant.LeechCraft.Azoth.IMUCPerms/1.0")
195 
196 #endif
virtual bool IsLessByPerm(const ICLEntry &part1, const ICLEntry &part2) const =0
Returns if one participant has less perms than another.
virtual ~IMUCPerms()
Definition: imucperms.h:40
virtual bool IsMultiPerm(const QByteArray &permClass) const =0
Returns whether users can have many perms of the given class at once.
virtual QByteArray GetAffName(const ICLEntry &participant) const =0
Returns the name of the affiliation icon.
virtual QMap< QByteArray, QList< QByteArray > > GetPerms(const ICLEntry &participant) const =0
Returns current permissions for the given participant.
virtual void SetPerm(ICLEntry &participant, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason)=0
Sets the permission for the given participant.
virtual QString GetUserString(const QByteArray &id) const =0
Returns a human-readable string for the given id.
virtual QPair< QByteArray, QByteArray > GetKickPerm() const =0
virtual void TrySetPerm(const QString &userId, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason)
Sets a perm on a user not present in the room.
Definition: imucperms.h:181
virtual QMap< QByteArray, QList< QByteArray > > GetPossiblePerms() const =0
Returns all possible permission classes and values.
virtual QPair< QByteArray, QByteArray > GetBanPerm() const =0
This interface describes permissions in the given room.
Definition: imucperms.h:37
Represents a single entry in contact list.
Definition: iclentry.h:56
virtual bool MayChangePerm(const ICLEntry &participant, const QByteArray &permClass, const QByteArray &targetPerm) const =0
Whether given participant&#39;s permission may be changed to the given value.