2010-05-07 04:47:10 -05:00
|
|
|
/*
|
2011-12-03 16:38:03 -06:00
|
|
|
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
|
|
|
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
2010-05-07 04:47:10 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _MAIN_WINDOW_H
|
|
|
|
#define _MAIN_WINDOW_H
|
|
|
|
|
|
|
|
#include <Window.h>
|
|
|
|
|
|
|
|
#include "Observer.h"
|
|
|
|
|
2021-05-30 12:30:26 -05:00
|
|
|
class BSplitView;
|
2021-05-29 15:47:54 -05:00
|
|
|
class BTextView;
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2021-05-29 15:47:54 -05:00
|
|
|
class Conversation;
|
2021-05-27 11:15:30 -05:00
|
|
|
class ConversationItem;
|
|
|
|
class ConversationListView;
|
2021-05-28 22:26:32 -05:00
|
|
|
class ConversationView;
|
2021-05-30 12:30:26 -05:00
|
|
|
class RosterItem;
|
2021-05-30 17:12:41 -05:00
|
|
|
class RosterWindow;
|
2010-05-07 04:47:10 -05:00
|
|
|
class Server;
|
|
|
|
class StatusView;
|
|
|
|
|
2021-05-24 01:47:21 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
class MainWindow: public BWindow, public Observer {
|
|
|
|
public:
|
|
|
|
MainWindow();
|
|
|
|
|
2010-05-16 16:02:50 -05:00
|
|
|
void Start();
|
2021-05-30 12:30:26 -05:00
|
|
|
virtual bool QuitRequested();
|
2010-05-16 16:02:50 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
void ImMessage(BMessage* msg);
|
|
|
|
void ImError(BMessage* msg);
|
2021-05-30 12:30:26 -05:00
|
|
|
|
|
|
|
// Observer inheritance
|
|
|
|
void ObserveInteger(int32 what, int32 val);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2011-12-14 17:36:27 -06:00
|
|
|
virtual void WorkspaceActivated(int32 workspace,
|
|
|
|
bool active);
|
|
|
|
|
2021-05-29 15:47:54 -05:00
|
|
|
void SetConversation(Conversation* chat);
|
2010-05-16 16:02:50 -05:00
|
|
|
Server* GetServer() const { return fServer; }
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2011-12-14 17:36:27 -06:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
private:
|
2021-05-30 12:30:26 -05:00
|
|
|
void _InitInterface();
|
|
|
|
BMenuBar* _CreateMenuBar();
|
|
|
|
|
|
|
|
ConversationItem* _EnsureConversationItem(BMessage* msg);
|
|
|
|
void _UpdateListItem(ConversationItem* item);
|
2021-05-27 11:15:30 -05:00
|
|
|
|
2010-05-16 16:02:50 -05:00
|
|
|
Server* fServer;
|
2021-05-30 17:12:41 -05:00
|
|
|
RosterWindow* fRosterWindow;
|
2011-12-14 17:36:27 -06:00
|
|
|
bool fWorkspaceChanged;
|
2021-05-29 15:47:54 -05:00
|
|
|
|
|
|
|
// Left panel, chat list
|
|
|
|
ConversationListView* fListView;
|
|
|
|
StatusView* fStatusView;
|
|
|
|
|
|
|
|
// Right panel, chat
|
2021-05-30 12:30:26 -05:00
|
|
|
BSplitView* fRightView;
|
2021-05-29 15:47:54 -05:00
|
|
|
BScrollView* fSendScroll;
|
|
|
|
BTextView* fSendView;
|
|
|
|
ConversationView* fChatView;
|
2021-05-30 20:45:24 -05:00
|
|
|
Conversation* fConversation;
|
2010-05-07 04:47:10 -05:00
|
|
|
};
|
|
|
|
|
2021-05-30 12:30:26 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#endif // _MAIN_WINDOW_H
|
2021-05-30 12:30:26 -05:00
|
|
|
|