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
|
|
|
|
2021-06-20 12:44:20 -05:00
|
|
|
#include "AppConstants.h"
|
2021-05-31 10:50:43 -05:00
|
|
|
#include "Conversation.h"
|
2021-06-03 23:39:50 -05:00
|
|
|
#include "Observer.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;
|
2021-06-20 12:44:20 -05:00
|
|
|
class RenderView;
|
2021-07-08 16:07:03 -05:00
|
|
|
class SendTextView;
|
2021-05-31 11:56:45 -05:00
|
|
|
class User;
|
2021-05-31 10:50:43 -05:00
|
|
|
class UserListView;
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
|
2021-07-17 00:23:56 -05:00
|
|
|
class ConversationView : public BGroupView, public Observer, public Notifier {
|
2021-05-28 08:38:33 -05:00
|
|
|
public:
|
2021-07-28 22:11:42 -05:00
|
|
|
ConversationView(Conversation* chat = NULL);
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
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-06-04 13:57:04 -05:00
|
|
|
void UpdateIcon();
|
2021-06-03 23:39:50 -05:00
|
|
|
|
2021-05-31 10:50:43 -05:00
|
|
|
void UpdateUserList(UserMap users);
|
2021-06-03 23:39:50 -05:00
|
|
|
void InvalidateUserList();
|
2021-05-28 08:38:33 -05:00
|
|
|
|
|
|
|
void ObserveString(int32 what, BString str);
|
2021-05-28 22:26:32 -05:00
|
|
|
|
2021-05-28 08:38:33 -05:00
|
|
|
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-06-07 00:03:15 -05:00
|
|
|
void _UserMessage(const char* format, const char* bodyFormat,
|
|
|
|
BMessage* msg);
|
|
|
|
|
2021-07-28 22:11:42 -05:00
|
|
|
// When the user hasn't joined any real conversations
|
|
|
|
void _FakeChat();
|
|
|
|
void _FakeChatNoRooms();
|
|
|
|
void _FakeChatNoAccounts();
|
|
|
|
|
2021-07-25 10:15:21 -05:00
|
|
|
Conversation* fConversation;
|
|
|
|
BObjectList<BMessage> fMessageQueue;
|
2021-05-31 10:50:43 -05:00
|
|
|
|
2021-07-25 10:15:21 -05:00
|
|
|
BTextView* fNameTextView;
|
|
|
|
BTextView* fSubjectTextView;
|
|
|
|
BitmapView* fProtocolView;
|
|
|
|
BitmapView* fIcon;
|
2021-06-04 13:57:04 -05:00
|
|
|
|
2021-07-25 10:15:21 -05:00
|
|
|
RenderView* fReceiveView;
|
|
|
|
UserListView* fUserList;
|
|
|
|
SendTextView* fSendView;
|
2021-05-28 08:38:33 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _CHAT_VIEW_H
|
|
|
|
|