2021-05-27 11:15:30 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
|
|
*/
|
2021-07-25 14:42:38 -05:00
|
|
|
#ifndef _CONVERSATION_LIST_H
|
|
|
|
#define _CONVERSATION_LIST_H
|
2021-05-27 11:15:30 -05:00
|
|
|
|
|
|
|
#include <OutlineListView.h>
|
|
|
|
|
|
|
|
class BPopUpMenu;
|
2021-06-11 17:24:04 -05:00
|
|
|
class Conversation;
|
|
|
|
class ConversationAccountItem;
|
2021-05-27 11:15:30 -05:00
|
|
|
|
|
|
|
|
2021-06-11 17:24:04 -05:00
|
|
|
class ConversationListView : public BOutlineListView {
|
2021-05-27 11:15:30 -05:00
|
|
|
public:
|
|
|
|
ConversationListView(const char* name);
|
|
|
|
|
2021-07-25 14:42:38 -05:00
|
|
|
virtual void MessageReceived(BMessage* msg);
|
|
|
|
virtual void SelectionChanged();
|
|
|
|
virtual void MouseDown(BPoint where);
|
2021-05-27 11:15:30 -05:00
|
|
|
|
2021-08-14 23:37:59 -05:00
|
|
|
// After removing item, select another
|
|
|
|
void RemoveItemSelecting(BListItem* item);
|
|
|
|
|
2021-07-25 14:42:38 -05:00
|
|
|
void AddConversation(Conversation* chat);
|
|
|
|
void RemoveConversation(Conversation* chat);
|
2021-08-14 23:37:59 -05:00
|
|
|
void AddAccount(int64 instance);
|
|
|
|
void RemoveAccount(int64 instance);
|
2021-07-25 14:42:38 -05:00
|
|
|
void SortConversation(Conversation* chat);
|
2021-06-11 17:24:04 -05:00
|
|
|
|
2021-05-27 11:15:30 -05:00
|
|
|
private:
|
2021-07-25 14:42:38 -05:00
|
|
|
BPopUpMenu* _ConversationPopUp();
|
|
|
|
BPopUpMenu* _BlankPopUp();
|
2021-06-11 17:24:04 -05:00
|
|
|
|
2021-07-25 14:42:38 -05:00
|
|
|
ConversationAccountItem*
|
|
|
|
_EnsureAccountItem(Conversation* chat);
|
2021-05-27 11:15:30 -05:00
|
|
|
};
|
|
|
|
|
2021-07-25 14:42:38 -05:00
|
|
|
#endif // _CONVERSATION_LIST_H
|