2021-05-31 10:50:43 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
|
|
*/
|
|
|
|
#ifndef USERITEM_H
|
|
|
|
#define USERITEM_H
|
|
|
|
|
2021-06-03 23:41:23 -05:00
|
|
|
#include <GraphicsDefs.h>
|
2021-05-31 10:50:43 -05:00
|
|
|
#include <StringItem.h>
|
|
|
|
|
|
|
|
#include "Observer.h"
|
|
|
|
|
|
|
|
class User;
|
|
|
|
|
|
|
|
|
|
|
|
class UserItem : public BStringItem, public Observer {
|
|
|
|
public:
|
2021-06-03 23:41:23 -05:00
|
|
|
UserItem(const char* name, User* user, int32 status);
|
|
|
|
|
|
|
|
void DrawItem(BView* owner, BRect frame, bool complete);
|
|
|
|
|
|
|
|
void ObserveString(int32 what, BString str);
|
|
|
|
void ObserveInteger(int32 what, int32 value);
|
2021-05-31 10:50:43 -05:00
|
|
|
|
|
|
|
User* GetUser();
|
|
|
|
|
|
|
|
protected:
|
2021-06-04 13:57:04 -05:00
|
|
|
rgb_color _GetTextColor(rgb_color highColor);
|
2021-05-31 10:50:43 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
User* fUser;
|
2021-06-04 13:57:04 -05:00
|
|
|
int fStatus;
|
2021-05-31 10:50:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // USERITEM_H
|
|
|
|
|