2010-05-07 04:47:10 -05:00
|
|
|
/*
|
2011-12-03 16:38:03 -06:00
|
|
|
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
2010-05-07 04:47:10 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2021-08-16 10:40:18 -05:00
|
|
|
#ifndef _STATUS_MANAGER_H
|
|
|
|
#define _STATUS_MANAGER_H
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2012-02-27 18:46:15 -06:00
|
|
|
#include <Messenger.h>
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#include "Notifier.h"
|
2021-08-19 17:04:33 -05:00
|
|
|
#include "UserStatus.h"
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2012-02-27 18:46:15 -06:00
|
|
|
|
2021-08-16 10:40:18 -05:00
|
|
|
class StatusManager : public Notifier {
|
2010-05-07 04:47:10 -05:00
|
|
|
public:
|
2021-08-16 10:40:18 -05:00
|
|
|
static StatusManager* Get();
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2021-08-03 13:19:25 -05:00
|
|
|
void SetNickname(BString nick, int64 instance = -1);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2021-06-20 12:44:20 -05:00
|
|
|
UserStatus Status() const;
|
2021-08-03 13:19:25 -05:00
|
|
|
void SetStatus(UserStatus status, int64 instance = -1);
|
|
|
|
void SetStatus(UserStatus status, const char* str,
|
|
|
|
int64 instance = -1);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2012-02-27 18:46:15 -06:00
|
|
|
void SetReplicantMessenger(BMessenger* messenger);
|
2021-06-20 12:44:20 -05:00
|
|
|
void ReplicantStatusNotify(UserStatus status,
|
2012-03-03 20:27:16 -06:00
|
|
|
bool wait = false);
|
2010-05-07 04:47:10 -05:00
|
|
|
private:
|
2021-08-16 10:40:18 -05:00
|
|
|
StatusManager();
|
|
|
|
~StatusManager();
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2021-06-20 12:44:20 -05:00
|
|
|
UserStatus fStatus;
|
2012-02-27 18:46:15 -06:00
|
|
|
BMessenger* fReplicantMessenger;
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
};
|
|
|
|
|
2021-08-16 10:40:18 -05:00
|
|
|
#endif // _STATUS_MANAGER_H
|