2010-05-07 04:47:10 -05:00
|
|
|
/*
|
2011-12-03 16:38:03 -06:00
|
|
|
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
2010-05-07 04:47:10 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2010-05-20 16:31:55 -05:00
|
|
|
#ifndef _CHAT_WINDOW_H
|
|
|
|
#define _CHAT_WINDOW_H
|
2010-05-28 17:38:16 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#include <Window.h>
|
|
|
|
#include <TextView.h>
|
2010-05-28 17:38:16 -05:00
|
|
|
#include <StringView.h>
|
2013-07-30 13:54:22 -05:00
|
|
|
#include <Notification.h>
|
2010-05-07 04:47:10 -05:00
|
|
|
#include "Observer.h"
|
2010-05-20 16:31:55 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#include "CayaConstants.h"
|
|
|
|
|
2012-03-07 13:22:09 -06:00
|
|
|
class BitmapView;
|
2010-05-07 04:47:10 -05:00
|
|
|
class ContactLinker;
|
|
|
|
class CayaRenderView;
|
|
|
|
|
2012-05-15 11:48:53 -05:00
|
|
|
class ChatWindow : public BWindow, public Observer {
|
2010-05-20 16:31:55 -05:00
|
|
|
public:
|
|
|
|
ChatWindow(ContactLinker* cl);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2012-06-07 11:46:07 -05:00
|
|
|
virtual void ShowWindow();
|
|
|
|
|
2010-05-20 16:31:55 -05:00
|
|
|
virtual void MessageReceived(BMessage* message);
|
2013-04-06 14:47:04 -05:00
|
|
|
void WindowActivated(bool active);
|
2010-05-20 16:31:55 -05:00
|
|
|
virtual bool QuitRequested();
|
|
|
|
|
2012-03-07 13:22:09 -06:00
|
|
|
void UpdateAvatar();
|
2012-03-07 18:47:00 -06:00
|
|
|
void UpdatePersonalMessage();
|
2010-05-20 16:31:55 -05:00
|
|
|
void ImMessage(BMessage* msg);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2010-05-20 16:31:55 -05:00
|
|
|
void ObserveString(int32 what, BString str);
|
|
|
|
void ObservePointer(int32 what, void* ptr);
|
|
|
|
void ObserveInteger(int32 what, int32 val);
|
|
|
|
void AppendStatus(CayaStatus status);
|
|
|
|
|
2012-06-07 11:46:07 -05:00
|
|
|
void AvoidFocus(bool avoid);
|
2010-05-20 16:31:55 -05:00
|
|
|
private:
|
|
|
|
BTextView* fSendView;
|
2010-05-28 17:38:16 -05:00
|
|
|
ContactLinker* fContactLinker;
|
2010-05-20 16:31:55 -05:00
|
|
|
CayaRenderView* fReceiveView;
|
2010-05-28 17:38:16 -05:00
|
|
|
BStringView* fStatus;
|
2012-03-07 18:47:00 -06:00
|
|
|
BTextView* fPersonalMessage;
|
2012-03-07 13:22:09 -06:00
|
|
|
BitmapView* fAvatar;
|
2013-07-30 13:54:22 -05:00
|
|
|
int32 fMessageCount;
|
2010-05-28 17:38:16 -05:00
|
|
|
|
2010-05-20 16:31:55 -05:00
|
|
|
};
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2010-05-20 16:31:55 -05:00
|
|
|
#endif // _CHAT_WINDOW_H
|