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"
|
|
|
|
|
|
|
|
class BCardLayout;
|
|
|
|
class BTextControl;
|
|
|
|
|
|
|
|
class Server;
|
|
|
|
class StatusView;
|
|
|
|
class RosterListView;
|
|
|
|
class RosterItem;
|
|
|
|
|
|
|
|
class MainWindow: public BWindow, public Observer {
|
|
|
|
public:
|
|
|
|
MainWindow();
|
|
|
|
|
2010-05-16 16:02:50 -05:00
|
|
|
void Start();
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
void ImMessage(BMessage* msg);
|
|
|
|
void ImError(BMessage* msg);
|
|
|
|
virtual bool QuitRequested();
|
|
|
|
|
|
|
|
void ObserveInteger(int32 what, int32 val);
|
|
|
|
|
2010-05-16 16:02:50 -05:00
|
|
|
Server* GetServer() const { return fServer; }
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
void UpdateListItem(RosterItem* item);
|
|
|
|
|
|
|
|
int32 CountItems() const;
|
|
|
|
RosterItem* ItemAt(int index);
|
|
|
|
void AddItem(RosterItem*);
|
|
|
|
bool HasItem(RosterItem*);
|
|
|
|
void RemoveItem(RosterItem*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
StatusView* fStatusView;
|
|
|
|
RosterListView* fListView;
|
2010-05-16 16:02:50 -05:00
|
|
|
Server* fServer;
|
2010-05-07 04:47:10 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _MAIN_WINDOW_H
|