LeechCraft Azoth 0.6.70-18808-g3467692359
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#include <util/azoth/emitters/mucperms.h>
17
18namespace LC
19{
20namespace Azoth
21{
39 {
40 protected:
41 Emitters::MUCPerms PermsEmitter_;
42
43 virtual ~IMUCPerms () = default;
44 public:
45 Emitters::MUCPerms& GetMUCPermsEmitter () { return PermsEmitter_; }
46
59 virtual MUCPerms_t GetPossiblePerms () const = 0;
60
70 virtual MUCPerms_t GetPerms (const ICLEntry& participant) const = 0;
71
72 virtual QPair<QByteArray, QByteArray> GetKickPerm () const = 0;
73 virtual QPair<QByteArray, QByteArray> GetBanPerm () const = 0;
74
91 virtual QByteArray GetAffName (const ICLEntry& participant) const = 0;
92
111 virtual bool MayChangePerm (const ICLEntry& participant,
112 const QByteArray& permClass, const QByteArray& targetPerm) const = 0;
113
132 virtual void SetPerm (ICLEntry& participant,
133 const QByteArray& permClass, const QByteArray& targetPerm, const QString& reason) = 0;
134
146 virtual bool IsLessByPerm (const ICLEntry& part1, const ICLEntry& part2) const = 0;
147
157 virtual bool IsMultiPerm (const QByteArray& permClass) const = 0;
158
164 virtual QString GetUserString (const QByteArray& id) const = 0;
165
186 virtual void TrySetPerm (const QString& userId,
187 const QByteArray& permClass, const QByteArray& targetPerm, const QString& reason)
188 {
189 Q_UNUSED (userId)
190 Q_UNUSED (permClass)
191 Q_UNUSED (targetPerm)
192 Q_UNUSED (reason)
193 }
194 };
195}
196}
197
198Q_DECLARE_INTERFACE (LC::Azoth::IMUCPerms,
199 "org.Deviant.LeechCraft.Azoth.IMUCPerms/1.0")
200
201#endif
Represents a single entry in contact list.
Definition iclentry.h:49
This interface describes permissions in the given room.
Definition imucperms.h:39
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:186
virtual QPair< QByteArray, QByteArray > GetBanPerm() const =0
virtual void SetPerm(ICLEntry &participant, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason)=0
Sets the permission for the given participant.
virtual QByteArray GetAffName(const ICLEntry &participant) const =0
Returns the name of the affiliation icon.
virtual MUCPerms_t GetPerms(const ICLEntry &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 MUCPerms_t GetPossiblePerms() const =0
Returns all possible permission classes and values.
Emitters::MUCPerms & GetMUCPermsEmitter()
Definition imucperms.h:45
virtual bool MayChangePerm(const ICLEntry &participant, const QByteArray &permClass, const QByteArray &targetPerm) const =0
Whether given participant's permission may be changed to the given value.
virtual bool IsLessByPerm(const ICLEntry &part1, const ICLEntry &part2) const =0
Returns if one participant has less perms than another.
Emitters::MUCPerms PermsEmitter_
Definition imucperms.h:41
virtual ~IMUCPerms()=default
virtual QString GetUserString(const QByteArray &id) const =0
Returns a human-readable string for the given id.
virtual QPair< QByteArray, QByteArray > GetKickPerm() const =0
QMap< QByteArray, QList< QByteArray > > MUCPerms_t
Definition mucevents.h:21