Chat-O-Matic/application/views/RosterListView.h
Jaidyn Ann 9d72c53dd9 Split RosterWindow into per-account RosterView
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.
2021-06-18 16:41:09 -05:00

40 lines
813 B
C++

/*
* Copyright 2009, Pier Luigi Fiorini. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ROSTER_LIST_VIEW_H
#define _ROSTER_LIST_VIEW_H
#include <OutlineListView.h>
class BPopUpMenu;
class Contact;
class RosterItem;
class RosterListView : public BOutlineListView
{
public:
RosterListView(const char* name);
virtual void MessageReceived(BMessage* msg);
virtual void MouseMoved(BPoint where, uint32 code, const BMessage*);
virtual void MouseDown(BPoint where);
virtual void Draw(BRect updateRect);
virtual void AttachedToWindow();
bool AddRosterItem(RosterItem* item);
RosterItem* RosterItemAt(int32 index);
void Sort();
private:
void _InfoWindow(Contact* linker);
BPopUpMenu* fPopUp;
RosterItem* fPrevItem;
};
#endif // _ROSTER_LIST_VIEW_H