Chat-O-Matic/application/views/UserListView.h

56 lines
1023 B
C
Raw Permalink Normal View History

/*
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef CONVERSATIONLIST_H
#define CONVERSATIONLIST_H
#include <ListView.h>
#include "Role.h"
class BPopUpMenu;
class Conversation;
class User;
enum
{
kUserInfo = 'ULui',
kDeafenUser = 'UMdu',
kUndeafenUser = 'UMud',
kMuteUser = 'UMmu',
kUnmuteUser = 'UMum',
kKickUser = 'UMku',
kBanUser = 'UMbu'
};
class UserListView : public BListView {
public:
2021-07-25 14:42:38 -05:00
UserListView(const char* name);
2021-07-25 14:42:38 -05:00
virtual void MouseDown(BPoint where);
2021-07-25 14:42:38 -05:00
void Sort();
bool HasUser(User* user);
void AddUser(User* user);
void RemoveUser(User* user);
2021-07-25 14:42:38 -05:00
void SetConversation(Conversation* chat) { fChat = chat; }
private:
2021-07-25 14:42:38 -05:00
BPopUpMenu* _UserPopUp();
BPopUpMenu* _BlankPopUp();
2021-07-25 14:42:38 -05:00
void _ModerationAction(int32 im_what);
void _ProcessItem(BMessage* itemMsg, BPopUpMenu* menu,
Role* user, Role* target, BString target_id);
Conversation* fChat;
};
#endif // CONVERSATIONLIST_H