Chat-O-Matic/application/User.h
Jaidyn Ann 63d8bbef26 Add user-list to the conversation view, menu tweaks
UserListView and UserItem were added as the backbone of the user-list,
and the (currently unused) Caya message CAYA_SEND_INVITE was established
for inviting users to rooms.

Some menus were reworked (e.g., pop-ups of the RosterListView) or
generally tweaked to be more sensical or consistent.
2021-05-31 10:50:43 -05:00

85 lines
1.8 KiB
C++

/*
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
* Copyright 2012, Dario Casalinuovo. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef USER_H
#define USER_H
#include <String.h>
#include <Message.h>
#include <Messenger.h>
#include <ObjectList.h>
#include <libsupport/KeyMap.h>
#include "Notifier.h"
#include "CayaConstants.h"
class BBitmap;
class Conversation;
class ProtocolLooper;
class UserItem;
class UserPopUp;
typedef KeyMap<BString, Conversation*> ChatMap;
class User : public Notifier {
public:
User(BString id, BMessenger msgn);
void RegisterObserver(Conversation* chat);
void RegisterObserver(Observer* obs) { Notifier::RegisterObserver(obs); }
void UnregisterObserver(Conversation* chat);
void UnregisterObserver(Observer* obs) { Notifier::UnregisterObserver(obs); }
void ShowPopUp(BPoint where);
void DeletePopUp();
void HidePopUp();
BString GetId() const;
BMessenger Messenger() const;
void SetMessenger(BMessenger messenger);
ProtocolLooper* GetProtocolLooper() const;
void SetProtocolLooper(ProtocolLooper* looper);
BBitmap* ProtocolBitmap() const;
UserItem* GetListItem();
BString GetName() const;
BBitmap* AvatarBitmap() const;
CayaStatus GetNotifyStatus() const;
BString GetNotifyPersonalStatus() const;
void SetNotifyName(BString name);
void SetNotifyAvatarBitmap(BBitmap* bitmap);
void SetNotifyStatus(CayaStatus status);
void SetNotifyPersonalStatus(BString personalStatus);
ChatMap Conversations();
protected:
BMessenger fMessenger;
ProtocolLooper* fLooper;
UserItem* fListItem;
BString fID;
bigtime_t fInstance;
BString fName;
BString fPersonalStatus;
BBitmap* fAvatarBitmap;
CayaStatus fStatus;
UserPopUp* fPopUp;
ChatMap fConversations;
};
#endif // USER_H