StatusView.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2009, Pier Luigi Fiorini. All rights reserved.
  3. * Copyright 2021, Jaidyn Levesque. All rights reserved.
  4. * Distributed under the terms of the MIT License.
  5. */
  6. #ifndef _STATUS_VIEW_H
  7. #define _STATUS_VIEW_H
  8. #include <View.h>
  9. #include "AppConstants.h"
  10. #include "Observer.h"
  11. class BPopUpMenu;
  12. class AccountsMenu;
  13. class BitmapView;
  14. class EnterTextView;
  15. class MenuButton;
  16. class Server;
  17. class StatusView : public BView, public Observer {
  18. public:
  19. StatusView(const char* name, Server* server);
  20. virtual void AttachedToWindow();
  21. virtual void MessageReceived(BMessage* msg);
  22. virtual void ObserveString(int32 what, BString str);
  23. virtual void ObserveInteger(int32 what, int32 value);
  24. virtual void ObservePointer(int32 what, void* ptr);
  25. private:
  26. void _SetName(BString name);
  27. void _SetStatus(UserStatus status);
  28. void _SetAvatarIcon(const BBitmap* bitmap);
  29. void _SetToAccount();
  30. EnterTextView* fNickname;
  31. BitmapView* fAvatar;
  32. BPopUpMenu* fStatusMenu;
  33. MenuButton* fAccountsButton;
  34. AccountsMenu* fAccountsMenu;
  35. int64 fAccount;
  36. Server* fServer;
  37. };
  38. #endif // _STATUS_VIEW_H