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.
|
|
|
|
*/
|
|
|
|
#ifndef _ACCOUNT_MANAGER_H
|
|
|
|
#define _ACCOUNT_MANAGER_H
|
|
|
|
|
2012-02-27 18:46:15 -06:00
|
|
|
#include <Messenger.h>
|
|
|
|
|
2021-06-20 12:44:20 -05:00
|
|
|
#include "AppConstants.h"
|
2010-05-07 04:47:10 -05:00
|
|
|
#include "Notifier.h"
|
|
|
|
|
2012-02-27 18:46:15 -06:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
class AccountManager : public Notifier {
|
|
|
|
public:
|
|
|
|
static AccountManager* Get();
|
|
|
|
|
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:
|
|
|
|
AccountManager();
|
|
|
|
~AccountManager();
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _ACCOUNT_MANAGER_H
|