LeechCraft Azoth
0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
Toggle main menu visibility
Loading...
Searching...
No Matches
ihaveserverhistory.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 <QList>
12
#include <QtPlugin>
13
#include <util/sll/eitherfwd.h>
14
#include "
imessage.h
"
15
#include "
ihistoryplugin.h
"
16
17
class
QModelIndex;
18
class
QAbstractItemModel;
19
20
template
<
typename
>
21
class
QFuture
;
22
23
namespace
LC
24
{
25
namespace
Azoth
26
{
27
struct
SrvHistMessage
28
{
29
IMessage::Direction
Dir_
;
30
QByteArray
ID_
;
31
QString
Nick_
;
32
QString
Body_
;
33
QDateTime
TS_
;
34
35
QString
RichBody_
;
36
};
37
38
using
SrvHistMessages_t
=
QList<SrvHistMessage>
;
39
40
enum
ServerHistoryRole
41
{
42
LastMessageDate
= Qt::UserRole + 1,
43
CLEntry
,
44
ServerHistoryRoleMax
45
};
46
47
enum class
ServerHistoryFeature
48
{
49
AccountSupportsHistory
,
50
Configurable
,
51
DatedFetching
52
};
53
54
struct
DefaultSortParams
55
{
56
int
Column_
;
57
int
Role_
;
58
Qt::SortOrder
Order_
;
59
};
60
61
class
IHaveServerHistory
62
{
63
public
:
64
virtual
~IHaveServerHistory
() {}
65
66
virtual
bool
HasFeature
(
ServerHistoryFeature
)
const
= 0;
67
68
virtual
void
OpenServerHistoryConfiguration
() = 0;
69
70
virtual
QAbstractItemModel*
GetServerContactsModel
()
const
= 0;
71
105
virtual
void
FetchServerHistory
(
const
QModelIndex& contact,
106
const
QByteArray& startId,
int
count) = 0;
107
108
virtual
DefaultSortParams
GetSortParams
()
const
= 0;
109
110
virtual
Util::ContextTask<QList<History::SomeEntryWithMessages>>
FetchServerHistory
(
const
std::optional<QDateTime>& since) = 0;
111
protected
:
130
virtual
void
serverHistoryFetched
(
const
QModelIndex& contact,
131
const
QByteArray& startId,
const
SrvHistMessages_t
& messages) = 0;
132
};
133
}
134
}
135
136
Q_DECLARE_INTERFACE (
LC::Azoth::IHaveServerHistory
,
137
"org.LeechCraft.Azoth.IHaveServerHistory/1.0"
)
LC::Azoth::IHaveServerHistory
Definition
ihaveserverhistory.h:62
LC::Azoth::IHaveServerHistory::~IHaveServerHistory
virtual ~IHaveServerHistory()
Definition
ihaveserverhistory.h:64
LC::Azoth::IHaveServerHistory::serverHistoryFetched
virtual void serverHistoryFetched(const QModelIndex &contact, const QByteArray &startId, const SrvHistMessages_t &messages)=0
Emitted when messages are fetched.
LC::Azoth::IHaveServerHistory::HasFeature
virtual bool HasFeature(ServerHistoryFeature) const =0
LC::Azoth::IHaveServerHistory::FetchServerHistory
virtual void FetchServerHistory(const QModelIndex &contact, const QByteArray &startId, int count)=0
Fetches the given history with the given contact.
LC::Azoth::IHaveServerHistory::GetSortParams
virtual DefaultSortParams GetSortParams() const =0
LC::Azoth::IHaveServerHistory::OpenServerHistoryConfiguration
virtual void OpenServerHistoryConfiguration()=0
LC::Azoth::IHaveServerHistory::FetchServerHistory
virtual Util::ContextTask< QList< History::SomeEntryWithMessages > > FetchServerHistory(const std::optional< QDateTime > &since)=0
LC::Azoth::IHaveServerHistory::GetServerContactsModel
virtual QAbstractItemModel * GetServerContactsModel() const =0
LC::Azoth::IMessage::Direction
Direction
Represents the direction of the message.
Definition
imessage.h:47
QFuture
Definition
ihaveserverhistory.h:21
QList
Definition
iaccountactionsprovider.h:16
ihistoryplugin.h
imessage.h
LC::Azoth::SrvHistMessages_t
QList< SrvHistMessage > SrvHistMessages_t
Definition
ihaveserverhistory.h:38
LC::Azoth::ServerHistoryFeature
ServerHistoryFeature
Definition
ihaveserverhistory.h:48
LC::Azoth::ServerHistoryFeature::Configurable
@ Configurable
Definition
ihaveserverhistory.h:50
LC::Azoth::ServerHistoryFeature::DatedFetching
@ DatedFetching
Definition
ihaveserverhistory.h:51
LC::Azoth::ServerHistoryFeature::AccountSupportsHistory
@ AccountSupportsHistory
Definition
ihaveserverhistory.h:49
LC::Azoth::ServerHistoryRole
ServerHistoryRole
Definition
ihaveserverhistory.h:41
LC::Azoth::LastMessageDate
@ LastMessageDate
Definition
ihaveserverhistory.h:42
LC::Azoth::CLEntry
@ CLEntry
Definition
ihaveserverhistory.h:43
LC::Azoth::ServerHistoryRoleMax
@ ServerHistoryRoleMax
Definition
ihaveserverhistory.h:44
LC
Definition
activityinfo.h:14
LC::Azoth::DefaultSortParams
Definition
ihaveserverhistory.h:55
LC::Azoth::DefaultSortParams::Order_
Qt::SortOrder Order_
Definition
ihaveserverhistory.h:58
LC::Azoth::DefaultSortParams::Column_
int Column_
Definition
ihaveserverhistory.h:56
LC::Azoth::DefaultSortParams::Role_
int Role_
Definition
ihaveserverhistory.h:57
LC::Azoth::SrvHistMessage
Definition
ihaveserverhistory.h:28
LC::Azoth::SrvHistMessage::Body_
QString Body_
Definition
ihaveserverhistory.h:32
LC::Azoth::SrvHistMessage::RichBody_
QString RichBody_
Definition
ihaveserverhistory.h:35
LC::Azoth::SrvHistMessage::Dir_
IMessage::Direction Dir_
Definition
ihaveserverhistory.h:29
LC::Azoth::SrvHistMessage::ID_
QByteArray ID_
Definition
ihaveserverhistory.h:30
LC::Azoth::SrvHistMessage::TS_
QDateTime TS_
Definition
ihaveserverhistory.h:33
LC::Azoth::SrvHistMessage::Nick_
QString Nick_
Definition
ihaveserverhistory.h:31
src
plugins
azoth
interfaces
azoth
ihaveserverhistory.h
Generated by
1.17.0