LeechCraft Azoth 0.6.70-16373-g319c272718
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
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
17namespace LC
18{
19namespace Azoth
20{
38 {
39 public:
40 virtual ~IMUCPerms () {}
41
54 virtual QMap<QByteArray, QList<QByteArray>> GetPossiblePerms () const = 0;
55
71 virtual QMap<QByteArray, QList<QByteArray>> GetPerms (QObject *participant) const = 0;
72
73 virtual QPair<QByteArray, QByteArray> GetKickPerm () const = 0;
74 virtual QPair<QByteArray, QByteArray> GetBanPerm () const = 0;
75
92 virtual QByteArray GetAffName (QObject *participant) const = 0;
93
112 virtual bool MayChangePerm (QObject *participant,
113 const QByteArray& permClass, const QByteArray& targetPerm) const = 0;
114
133 virtual void SetPerm (QObject *participant,
134 const QByteArray& permClass, const QByteArray& targetPerm, const QString& reason) = 0;
135
147 virtual bool IsLessByPerm (QObject *part1, QObject *part2) const = 0;
148
158 virtual bool IsMultiPerm (const QByteArray& permClass) const = 0;
159
165 virtual QString GetUserString (const QByteArray& id) const = 0;
166
187 virtual void TrySetPerm (const QString& userId,
188 const QByteArray& permClass, const QByteArray& targetPerm, const QString& reason)
189 {
190 Q_UNUSED (userId)
191 Q_UNUSED (permClass)
192 Q_UNUSED (targetPerm)
193 Q_UNUSED (reason)
194 }
195 };
196}
197}
198
199Q_DECLARE_INTERFACE (LC::Azoth::IMUCPerms,
200 "org.Deviant.LeechCraft.Azoth.IMUCPerms/1.0")
201
202#endif
This interface describes permissions in the given room.
Definition imucperms.h:38
virtual QByteArray GetAffName(QObject *participant) const =0
Returns the name of the affiliation icon.
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:187
virtual QPair< QByteArray, QByteArray > GetBanPerm() const =0
virtual QMap< QByteArray, QList< QByteArray > > GetPerms(QObject *participant) const =0
Returns current permissions for the given participant.
virtual bool IsMultiPerm(const QByteArray &permClass) const =0
Returns whether users can have many perms of the given class at once.
virtual QMap< QByteArray, QList< QByteArray > > GetPossiblePerms() const =0
Returns all possible permission classes and values.
virtual void SetPerm(QObject *participant, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason)=0
Sets the permission for the given participant.
virtual bool MayChangePerm(QObject *participant, const QByteArray &permClass, const QByteArray &targetPerm) const =0
Whether given participant's permission may be changed to the given value.
virtual bool IsLessByPerm(QObject *part1, QObject *part2) const =0
Returns if one participant has less perms than another.
virtual QString GetUserString(const QByteArray &id) const =0
Returns a human-readable string for the given id.
virtual ~IMUCPerms()
Definition imucperms.h:40
virtual QPair< QByteArray, QByteArray > GetKickPerm() const =0