2018-12-02 20:26:49 +00:00
|
|
|
#ifndef CONVERSATIONSLISTWIDGET_H
|
|
|
|
#define CONVERSATIONSLISTWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2018-12-03 20:18:12 +00:00
|
|
|
#include "../data/conversationslist.h"
|
|
|
|
#include "../data/user.h"
|
2018-12-02 20:26:49 +00:00
|
|
|
|
|
|
|
class ConversationsListHelper;
|
2018-12-03 20:18:12 +00:00
|
|
|
class UsersHelper;
|
2018-12-02 20:26:49 +00:00
|
|
|
|
|
|
|
class ConversationsListWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ConversationsListWidget(QWidget *parent = nullptr);
|
|
|
|
~ConversationsListWidget();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Refresh the list of conversations of the user
|
|
|
|
*/
|
|
|
|
void refresh();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This slot is triggered once we have got a new list of conversations
|
|
|
|
*
|
|
|
|
* @param success TRUE for a success / FALSE else
|
|
|
|
* @param list The list of conversation (empty list in case of failure)
|
|
|
|
*/
|
2018-12-03 20:18:12 +00:00
|
|
|
void onGotConversationsList(bool success, const ConversationsList &list);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This slot is triggered once we have information about the users
|
|
|
|
*
|
|
|
|
* @param success TRUE in case of success / FALSE else
|
|
|
|
* @param users The list of suers (empty list in case of failure)
|
|
|
|
*/
|
|
|
|
void onGotUsersInfo(bool success, const QList<User> &users);
|
2018-12-02 20:26:49 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
ConversationsListHelper *mConversationsList;
|
2018-12-03 20:18:12 +00:00
|
|
|
UsersHelper *mUsersHelper;
|
|
|
|
|
|
|
|
//Current conversation in cache
|
|
|
|
ConversationsList mCurrList;
|
2018-12-02 20:26:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONVERSATIONSLISTWIDGET_H
|