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>
|
|
|
|
#include <StringView.h>
|
|
|
|
#include <TextView.h>
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
#include "CayaConstants.h"
|
|
|
|
|
2021-05-28 22:26:32 -05:00
|
|
|
class BMessageQueue;
|
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
class BitmapView;
|
|
|
|
class CayaRenderView;
|
|
|
|
class Contact;
|
2021-05-28 22:26:32 -05:00
|
|
|
class Conversation;
|
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 void MessageReceived(BMessage* message);
|
|
|
|
virtual bool QuitRequested();
|
|
|
|
|
|
|
|
Conversation* GetConversation();
|
2021-05-28 22:26:32 -05:00
|
|
|
void SetConversation(Conversation* chat);
|
|
|
|
|
|
|
|
void AttachedToWindow();
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
void UpdateAvatar();
|
|
|
|
void UpdatePersonalMessage();
|
|
|
|
void ImMessage(BMessage* msg);
|
|
|
|
|
|
|
|
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:
|
|
|
|
Conversation* fConversation;
|
|
|
|
Contact* fContact;
|
|
|
|
CayaRenderView* fReceiveView;
|
|
|
|
BStringView* fStatus;
|
|
|
|
BTextView* fPersonalMessage;
|
|
|
|
BitmapView* fProtocolView;
|
|
|
|
BitmapView* fAvatar;
|
|
|
|
int32 fMessageCount;
|
2021-05-28 22:26:32 -05:00
|
|
|
BObjectList<BMessage> fMessageQueue;
|
2021-05-28 08:38:33 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _CHAT_VIEW_H
|
|
|
|
|