Chat-O-Matic/application/views/ConversationView.h
Jaidyn Ann 89ff195c8d Set room topic/name through conversation view
If the user has permission to change a room's subject or name, they can
now edit the text views displaying them (toward the top of the window).
When enter is pressed, the changes will be sent to the protocol.

To do this, a BTextView subclass was added to libinterface
(splitting somewhat from SendTextView)― EnterTextView sends a message
containing the text to the given target when the user hits enter sans
modifiers.
2021-07-29 22:00:01 -05:00

77 lines
1.6 KiB
C++

/*
* 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>
#include <ObjectList.h>
#include "AppConstants.h"
#include "Conversation.h"
#include "Observer.h"
class BStringView;
class BitmapView;
class EnterTextView;
class RenderView;
class SendTextView;
class User;
class UserListView;
class ConversationView : public BGroupView, public Observer, public Notifier {
public:
ConversationView(Conversation* chat = NULL);
virtual bool QuitRequested();
virtual void AttachedToWindow();
virtual void MessageReceived(BMessage* message);
void ImMessage(BMessage* msg);
Conversation* GetConversation();
void SetConversation(Conversation* chat);
void UpdateIcon();
void UpdateUserList(UserMap users);
void InvalidateUserList();
void ObserveString(int32 what, BString str);
void AvoidFocus(bool avoid);
private:
void _InitInterface();
bool _AppendOrEnqueueMessage(BMessage* msg);
void _AppendMessage(BMessage* msg);
void _UserMessage(const char* format, const char* bodyFormat,
BMessage* msg);
// When the user hasn't joined any real conversations
void _FakeChat();
void _FakeChatNoRooms();
void _FakeChatNoAccounts();
Conversation* fConversation;
BObjectList<BMessage> fMessageQueue;
EnterTextView* fNameTextView;
EnterTextView* fSubjectTextView;
BitmapView* fProtocolView;
BitmapView* fIcon;
RenderView* fReceiveView;
UserListView* fUserList;
SendTextView* fSendView;
};
#endif // _CHAT_VIEW_H