comunicmessages/widgets/conversationslistwidget.h

52 lines
1.2 KiB
C++

#ifndef CONVERSATIONSLISTWIDGET_H
#define CONVERSATIONSLISTWIDGET_H
#include <QWidget>
#include "../data/conversationslist.h"
#include "../data/user.h"
class ConversationsListHelper;
class UsersHelper;
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)
*/
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);
private:
ConversationsListHelper *mConversationsList;
UsersHelper *mUsersHelper;
//Current conversation in cache
ConversationsList mCurrList;
};
#endif // CONVERSATIONSLISTWIDGET_H