StatusManager.h 855 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
  3. * Distributed under the terms of the MIT License.
  4. */
  5. #ifndef _STATUS_MANAGER_H
  6. #define _STATUS_MANAGER_H
  7. #include <Messenger.h>
  8. #include "AppConstants.h"
  9. #include "Notifier.h"
  10. class StatusManager : public Notifier {
  11. public:
  12. static StatusManager* Get();
  13. void SetNickname(BString nick, int64 instance = -1);
  14. UserStatus Status() const;
  15. void SetStatus(UserStatus status, int64 instance = -1);
  16. void SetStatus(UserStatus status, const char* str,
  17. int64 instance = -1);
  18. void SetReplicantMessenger(BMessenger* messenger);
  19. void ReplicantStatusNotify(UserStatus status,
  20. bool wait = false);
  21. private:
  22. StatusManager();
  23. ~StatusManager();
  24. UserStatus fStatus;
  25. BMessenger* fReplicantMessenger;
  26. };
  27. #endif // _STATUS_MANAGER_H