LeechCraft Azoth 0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
iclentry.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#pragma once
10
11#include <QFlags>
12#include <QMetaType>
13#include <util/azoth/emitters/clentry.h>
14#include "azothcommon.h"
15#include "message.h"
16
17class QAction;
18class QImage;
19
20namespace LC::Azoth
21{
22 class IAccount;
23 class IMessage;
24
57 {
58 protected:
59 Emitters::CLEntry Emitter_;
60
61 virtual ~ICLEntry () = default;
62 public:
63 Emitters::CLEntry& GetCLEntryEmitter () { return Emitter_; }
64
69 {
78
82 FSessionEntry = 0x0001,
83
87
92
96
102
106
110 };
111
112 Q_DECLARE_FLAGS (Features, Feature)
113
114 enum class EntryType
115 {
119
123
128
133 };
134
139 virtual QObject* GetQObject () = 0;
140
146 virtual IAccount* GetParentAccount () const = 0;
147
162 virtual ICLEntry* GetParentCLEntry () const
163 {
164 return nullptr;
165 }
166
167 QObject* GetParentCLEntryObject () const
168 {
169 if (const auto entry = GetParentCLEntry ())
170 return entry->GetQObject ();
171 return nullptr;
172 }
173
179 virtual Features GetEntryFeatures () const = 0;
180
185 virtual EntryType GetEntryType () const = 0;
186
193 virtual QString GetEntryName () const = 0;
194
203 virtual void SetEntryName (const QString& name) = 0;
204
223 virtual QString GetEntryID () const = 0;
224
248 virtual QString GetHumanReadableID () const
249 {
250 return GetEntryID ();
251 }
252
258 virtual QStringList Groups () const = 0;
259
267 virtual void SetGroups (const QStringList& groups) = 0;
268
285 virtual QStringList Variants () const = 0;
286
289 virtual void SendMessage (const OutgoingMessage& message) = 0;
290
301 virtual QList<IMessage*> GetAllMessages () const = 0;
302
317 virtual void PurgeMessages (const QDateTime& before) = 0;
318
327 virtual void SetChatPartState (ChatPartState state,
328 const QString& variant) = 0;
329
341 virtual EntryStatus GetStatus (const QString& variant = QString ()) const = 0;
342
345 virtual void ShowInfo () = 0;
346
355 virtual QList<QAction*> GetActions () const = 0;
356
380 virtual QMap<QString, QVariant> GetClientInfo (const QString& variant) const = 0;
381
392 virtual void MarkMsgsRead () = 0;
393
396 virtual void ChatTabClosed () = 0;
397 };
398}
399
400Q_DECLARE_OPERATORS_FOR_FLAGS (LC::Azoth::ICLEntry::Features)
401Q_DECLARE_INTERFACE (LC::Azoth::ICLEntry, "org.Deviant.LeechCraft.Azoth.ICLEntry/1.0")
Interface representing a single account.
Definition iaccount.h:46
Represents a single entry in contact list.
Definition iclentry.h:57
virtual ~ICLEntry()=default
virtual QObject * GetQObject()=0
virtual Features GetEntryFeatures() const =0
virtual void SendMessage(const OutgoingMessage &message)=0
Sends the message described by message.
virtual void ChatTabClosed()=0
Called by Azoth when the chat with the entry is closed.
virtual void PurgeMessages(const QDateTime &before)=0
Purges messages before the given date.
EntryType
Definition iclentry.h:115
@ PrivateChat
Definition iclentry.h:127
@ Chat
Definition iclentry.h:118
@ MUC
Definition iclentry.h:122
@ UnauthEntry
Definition iclentry.h:132
virtual QString GetEntryID() const =0
Returns the ID of this entry.
virtual QStringList Groups() const =0
Returns the list of human-readable names of the groups that this entry belongs to.
virtual QString GetHumanReadableID() const
Returns the human-readable ID of this entry.
Definition iclentry.h:248
Emitters::CLEntry Emitter_
Definition iclentry.h:59
virtual void SetChatPartState(ChatPartState state, const QString &variant)=0
Notifies about our chat participation state change.
virtual void MarkMsgsRead()=0
Called whenever new messages are read.
Feature
Definition iclentry.h:69
@ FSelfContact
Definition iclentry.h:109
@ FHasCustomChatWidget
Definition iclentry.h:95
@ FMaskLongetivity
Definition iclentry.h:86
@ FSessionEntry
Definition iclentry.h:82
@ FSupportsRenames
Definition iclentry.h:91
@ FSupportsGrouping
Definition iclentry.h:105
@ FPermanentEntry
Definition iclentry.h:77
@ FSupportsAuth
Definition iclentry.h:101
virtual void SetGroups(const QStringList &groups)=0
Sets the list of groups this item belongs to.
virtual QList< IMessage * > GetAllMessages() const =0
Returns all already sent or received messages.
virtual EntryType GetEntryType() const =0
virtual EntryStatus GetStatus(const QString &variant=QString()) const =0
Returns the current status of a variant of the item.
virtual QMap< QString, QVariant > GetClientInfo(const QString &variant) const =0
Returns the client information for the given variant.
virtual QString GetEntryName() const =0
virtual IAccount * GetParentAccount() const =0
virtual QList< QAction * > GetActions() const =0
Returns the list of actions for the item.
QObject * GetParentCLEntryObject() const
Definition iclentry.h:167
virtual void ShowInfo()=0
Requests the entry to show dialog with info about it.
virtual ICLEntry * GetParentCLEntry() const
Definition iclentry.h:162
Emitters::CLEntry & GetCLEntryEmitter()
Definition iclentry.h:63
virtual QStringList Variants() const =0
Returns the list of destination variants.
virtual void SetEntryName(const QString &name)=0
Sets the human-readable name of this entry.
This interface is used to represent a message.
Definition imessage.h:40
Describes an entry's status.
Describes a message to be sent, as formed by the user and before it has been sent to the wire.
Definition message.h:22