Chat-O-Matic/application/windows/MainWindow.h

90 lines
2.0 KiB
C
Raw Permalink Normal View History

/*
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.
* Copyright 2021-2022, Jaidyn Levesque. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _MAIN_WINDOW_H
#define _MAIN_WINDOW_H
#include <Window.h>
#include "libsupport/KeyMap.h"
class BCardLayout;
class BLayoutItem;
class BMenu;
class BSplitView;
2021-05-29 15:47:54 -05:00
class BTextView;
2021-05-29 15:47:54 -05:00
class Conversation;
class ConversationItem;
class ConversationListView;
class ConversationView;
class ProtocolSettings;
class RosterItem;
2021-05-30 17:12:41 -05:00
class RosterWindow;
class StatusView;
class MainWindow: public BWindow {
public:
MainWindow();
void Start();
void Show();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage* message);
void ImMessage(BMessage* msg);
virtual void WorkspaceActivated(int32 workspace,
bool active);
2021-05-29 15:47:54 -05:00
void SetConversation(Conversation* chat);
void SetConversationView(ConversationView* view);
void RemoveConversation(Conversation* chat);
2021-07-25 14:42:38 -05:00
void SortConversation(Conversation* chat);
private:
void _InitInterface();
BMenuBar* _CreateMenuBar();
BMenu* _CreateAccountsMenu();
void _RefreshAccountsMenu();
BMenu* _CreateProtocolMenu();
void _ToggleMenuItems();
ConversationItem*
_EnsureConversationItem(BMessage* msg);
void _EnsureConversationView(Conversation* chat);
void _ApplyWeights();
void _SaveWeights();
2021-08-07 17:37:16 -05:00
bool _PopulateWithAccounts(BMenu* menu,
ProtocolSettings* settings);
void _ReplaceMenu(const char* name, BMenu* newMenu);
2021-05-30 17:12:41 -05:00
RosterWindow* fRosterWindow;
bool fWorkspaceChanged;
BMenuBar* fMenuBar;
2021-05-29 15:47:54 -05:00
KeyMap<Conversation*, BLayoutItem*> fChatList;
2021-05-29 15:47:54 -05:00
// Left panel, chat list
ConversationListView* fListView;
StatusView* fStatusView;
BSplitView* fSplitView;
2021-05-29 15:47:54 -05:00
// Right panel, chat
BCardLayout* fChatLayout;
Conversation* fConversation;
ConversationView* fBackupChatView;
};
#endif // _MAIN_WINDOW_H