9d72c53dd9
Most of RosterWindow's special functions have been split into a special BGroupView (including both the roster search-box and roster list), RosterView. This will give some more flexibility in other uses of the roster list. In addition, RosterViews can be tied to a specific account by its looper's instance ID, allowing it to either show all contacts (globally; if the ID is set to -1) or only those of the specified account. This can be useful, for example, when inviting contacts to a room― you can only invite contacts that use the same protocol, and are associated with your account, so showing all contacts doesn't make sense. The SearchBarTextControl class was removed, as it isn't particularly necessary.
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
/*
|
|
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
|
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
|
* Copyright 2021, Jaidyn Levesque. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Andrea Anzani, andrea.anzani@gmail.com
|
|
* Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
|
|
* Jaidyn Levesque, jadedctrl@teknik.io
|
|
*/
|
|
#ifndef _ROSTER_VIEW_H
|
|
#define _ROSTER_VIEW_H
|
|
|
|
#include <GroupView.h>
|
|
|
|
#include "Server.h"
|
|
|
|
class BTextControl;
|
|
class RosterItem;
|
|
class RosterListView;
|
|
class Server;
|
|
|
|
|
|
class RosterView : public BGroupView {
|
|
public:
|
|
RosterView(const char* title, Server* server, bigtime_t account = -1);
|
|
|
|
void MessageReceived(BMessage* message);
|
|
void ImMessage(BMessage* msg);
|
|
|
|
void AttachedToWindow();
|
|
void SetInvocationMessage(BMessage* msg);
|
|
|
|
void SetAccount(bigtime_t instance_id);
|
|
|
|
void UpdateListItem(RosterItem* item);
|
|
|
|
RosterListView* ListView();
|
|
|
|
private:
|
|
RosterMap _RosterMap();
|
|
|
|
Server* fServer;
|
|
RosterListView* fListView;
|
|
BTextControl* fSearchBox;
|
|
bigtime_t fAccount;
|
|
};
|
|
|
|
#endif // _ROSTER_VIEW_H
|