-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathuicontactlistdialog.h
44 lines (35 loc) · 965 Bytes
/
uicontactlistdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// uicontactlistdialog.h
//
// Copyright (c) 2019-2024 Kristofer Berggren
// All rights reserved.
//
// nchat is distributed under the MIT license, see LICENSE for details.
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include "protocol.h"
#include "uilistdialog.h"
struct UiContactListItem
{
std::string profileId;
std::string contactId;
std::string name;
};
class UiContactListDialog : public UiListDialog
{
public:
UiContactListDialog(const UiDialogParams& p_Params);
virtual ~UiContactListDialog();
UiContactListItem GetSelectedContactItem();
protected:
virtual void OnSelect();
virtual void OnBack();
virtual bool OnTimer();
void UpdateList();
private:
std::unordered_map<std::string, std::unordered_map<std::string, ContactInfo>> m_DialogContactInfos;
int64_t m_DialogContactInfosUpdateTime = 0;
std::vector<UiContactListItem> m_ContactListItemVec;
UiContactListItem m_SelectedContactItem;
};