LeechCraft Azoth
0.6.70-11552-gf61ee51c3d
Modular multiprotocol IM plugin for LeechCraft
Main Page
Namespaces
Classes
Files
File List
File Members
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
* Boost Software License - Version 1.0 - August 17th, 2003
6
*
7
* Permission is hereby granted, free of charge, to any person or organization
8
* obtaining a copy of the software and accompanying documentation covered by
9
* this license (the "Software") to use, reproduce, display, distribute,
10
* execute, and transmit the Software, and to prepare derivative works of the
11
* Software, and to permit third-parties to whom the Software is furnished to
12
* do so, all subject to the following:
13
*
14
* The copyright notices in the Software and this entire statement, including
15
* the above license grant, this restriction and the following disclaimer,
16
* must be included in all copies of the Software, in whole or in part, and
17
* all derivative works of the Software, unless such copies or derivative
18
* works are solely in the form of machine-executable object code generated by
19
* a source language processor.
20
*
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
**********************************************************************/
29
30
#pragma once
31
32
#include <QList>
33
#include <QtPlugin>
34
#include <util/sll/eitherfwd.h>
35
#include "
imessage.h
"
36
#include "
ihistoryplugin.h
"
37
38
class
QModelIndex;
39
class
QAbstractItemModel;
40
41
template
<
typename
>
42
class
QFuture
;
43
44
namespace
LeechCraft
45
{
46
namespace
Azoth
47
{
48
struct
SrvHistMessage
49
{
50
IMessage::Direction
Dir_
;
51
QByteArray
ID_
;
52
QString
Nick_
;
53
QString
Body_
;
54
QDateTime
TS_
;
55
56
QString
RichBody_
;
57
};
58
59
using
SrvHistMessages_t
=
QList<SrvHistMessage>
;
60
61
enum
ServerHistoryRole
62
{
63
LastMessageDate
= Qt::UserRole + 1,
64
CLEntry
,
65
ServerHistoryRoleMax
66
};
67
68
enum class
ServerHistoryFeature
69
{
70
AccountSupportsHistory
,
71
Configurable
,
72
DatedFetching
73
};
74
75
struct
DefaultSortParams
76
{
77
int
Column_
;
78
int
Role_
;
79
Qt::SortOrder
Order_
;
80
};
81
82
class
IHaveServerHistory
83
{
84
public
:
85
virtual
~IHaveServerHistory
() {}
86
87
virtual
bool
HasFeature (
ServerHistoryFeature
)
const
= 0;
88
89
virtual
void
OpenServerHistoryConfiguration () = 0;
90
91
virtual
QAbstractItemModel* GetServerContactsModel ()
const
= 0;
92
126
virtual
void
FetchServerHistory (
const
QModelIndex& contact,
127
const
QByteArray& startId,
int
count) = 0;
128
129
virtual
DefaultSortParams
GetSortParams ()
const
= 0;
130
131
struct
UserHistorySyncInfo
132
{
133
QString
VisibleName_
;
134
QList<HistoryItem>
Messages_
;
135
};
136
using
MessagesSyncMap_t
= QHash<QString, UserHistorySyncInfo>;
137
using
DatedFetchResult_t
= Util::Either<QString, MessagesSyncMap_t>;
138
139
virtual
QFuture<DatedFetchResult_t>
FetchServerHistory (
const
QDateTime& since) = 0;
140
protected
:
159
virtual
void
serverHistoryFetched (
const
QModelIndex& contact,
160
const
QByteArray& startId,
const
SrvHistMessages_t
& messages) = 0;
161
};
162
}
163
}
164
165
Q_DECLARE_INTERFACE (
LeechCraft::Azoth::IHaveServerHistory
,
166
"org.LeechCraft.Azoth.IHaveServerHistory/1.0"
)
LeechCraft::Azoth::SrvHistMessage::RichBody_
QString RichBody_
Definition:
ihaveserverhistory.h:56
LeechCraft::Azoth::ServerHistoryFeature::AccountSupportsHistory
LeechCraft::Azoth::SrvHistMessage::Body_
QString Body_
Definition:
ihaveserverhistory.h:53
LeechCraft::Azoth::DefaultSortParams::Order_
Qt::SortOrder Order_
Definition:
ihaveserverhistory.h:79
LeechCraft::Azoth::IHaveServerHistory
Definition:
ihaveserverhistory.h:82
LeechCraft::Azoth::SrvHistMessage::Dir_
IMessage::Direction Dir_
Definition:
ihaveserverhistory.h:50
LeechCraft::Azoth::SrvHistMessage::Nick_
QString Nick_
Definition:
ihaveserverhistory.h:52
LeechCraft
Definition:
activityinfo.h:34
LeechCraft::Azoth::ServerHistoryRoleMax
Definition:
ihaveserverhistory.h:65
LeechCraft::Azoth::SrvHistMessage
Definition:
ihaveserverhistory.h:48
LeechCraft::Azoth::LastMessageDate
Definition:
ihaveserverhistory.h:63
LeechCraft::Azoth::ServerHistoryFeature::DatedFetching
LeechCraft::Azoth::ServerHistoryFeature
ServerHistoryFeature
Definition:
ihaveserverhistory.h:68
LeechCraft::Azoth::DefaultSortParams::Column_
int Column_
Definition:
ihaveserverhistory.h:77
LeechCraft::Azoth::ServerHistoryRole
ServerHistoryRole
Definition:
ihaveserverhistory.h:61
QFuture
Definition:
ihaveserverhistory.h:42
LeechCraft::Azoth::IMessage::Direction
Direction
Represents the direction of the message.
Definition:
imessage.h:70
LeechCraft::Azoth::IHaveServerHistory::~IHaveServerHistory
virtual ~IHaveServerHistory()
Definition:
ihaveserverhistory.h:85
imessage.h
LeechCraft::Azoth::DefaultSortParams
Definition:
ihaveserverhistory.h:75
LeechCraft::Azoth::CLEntry
Definition:
ihaveserverhistory.h:64
LeechCraft::Azoth::IHaveServerHistory::UserHistorySyncInfo
Definition:
ihaveserverhistory.h:131
QList
Definition:
iaccountactionsprovider.h:37
LeechCraft::Azoth::IHaveServerHistory::MessagesSyncMap_t
QHash< QString, UserHistorySyncInfo > MessagesSyncMap_t
Definition:
ihaveserverhistory.h:136
LeechCraft::Azoth::SrvHistMessage::ID_
QByteArray ID_
Definition:
ihaveserverhistory.h:51
LeechCraft::Azoth::IHaveServerHistory::UserHistorySyncInfo::Messages_
QList< HistoryItem > Messages_
Definition:
ihaveserverhistory.h:134
ihistoryplugin.h
LeechCraft::Azoth::IHaveServerHistory::DatedFetchResult_t
Util::Either< QString, MessagesSyncMap_t > DatedFetchResult_t
Definition:
ihaveserverhistory.h:137
LeechCraft::Azoth::SrvHistMessage::TS_
QDateTime TS_
Definition:
ihaveserverhistory.h:54
LeechCraft::Azoth::DefaultSortParams::Role_
int Role_
Definition:
ihaveserverhistory.h:78
LeechCraft::Azoth::ServerHistoryFeature::Configurable
LeechCraft::Azoth::IHaveServerHistory::UserHistorySyncInfo::VisibleName_
QString VisibleName_
Definition:
ihaveserverhistory.h:133
src
plugins
azoth
interfaces
azoth
ihaveserverhistory.h
Generated by
1.8.11