2021-05-28 08:38:33 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _CHAT_VIEW_H
|
|
|
|
#define _CHAT_VIEW_H
|
|
|
|
|
|
|
|
#include <GroupView.h>
|
2021-05-28 22:26:32 -05:00
|
|
|
#include <ObjectList.h>
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
#include "CayaConstants.h"
|
2021-05-31 10:50:43 -05:00
|
|
|
#include "Conversation.h"
|
2021-05-28 08:38:33 -05:00
|
|
|
|
2021-05-31 10:50:43 -05:00
|
|
|
class BStringView;
|
|
|
|
class BTextView;
|
2021-05-28 22:26:32 -05:00
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
class BitmapView;
|
|
|
|
class CayaRenderView;
|
|
|
|
class Contact;
|
2021-05-31 10:50:43 -05:00
|
|
|
class UserListView;
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
class ConversationView : public BGroupView {
|
|
|
|
public:
|
2021-05-28 22:26:32 -05:00
|
|
|
ConversationView();
|
2021-05-28 08:38:33 -05:00
|
|
|
ConversationView(Conversation* chat);
|
|
|
|
|
|
|
|
virtual bool QuitRequested();
|
2021-05-31 10:50:43 -05:00
|
|
|
virtual void AttachedToWindow();
|
|
|
|
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
void ImMessage(BMessage* msg);
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
Conversation* GetConversation();
|
2021-05-28 22:26:32 -05:00
|
|
|
void SetConversation(Conversation* chat);
|
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
void UpdateAvatar();
|
|
|
|
void UpdatePersonalMessage();
|
2021-05-31 10:50:43 -05:00
|
|
|
void UpdateUserList(UserMap users);
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
void ObserveString(int32 what, BString str);
|
|
|
|
void ObservePointer(int32 what, void* ptr);
|
|
|
|
void ObserveInteger(int32 what, int32 val);
|
2021-05-28 22:26:32 -05:00
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
void AppendStatus(CayaStatus status);
|
|
|
|
|
|
|
|
void AvoidFocus(bool avoid);
|
2021-05-28 22:26:32 -05:00
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
private:
|
2021-05-31 10:50:43 -05:00
|
|
|
void _InitInterface();
|
|
|
|
|
2021-05-30 19:07:50 -05:00
|
|
|
bool _AppendOrEnqueueMessage(BMessage* msg);
|
|
|
|
void _AppendMessage(BMessage* msg);
|
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
Conversation* fConversation;
|
|
|
|
Contact* fContact;
|
2021-05-31 10:50:43 -05:00
|
|
|
int32 fMessageCount;
|
|
|
|
BObjectList<BMessage> fMessageQueue;
|
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
CayaRenderView* fReceiveView;
|
|
|
|
BStringView* fStatus;
|
|
|
|
BTextView* fPersonalMessage;
|
|
|
|
BitmapView* fProtocolView;
|
|
|
|
BitmapView* fAvatar;
|
2021-05-31 10:50:43 -05:00
|
|
|
UserListView* fUserList;
|
2021-05-28 08:38:33 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _CHAT_VIEW_H
|
|
|
|
|