2021-07-21 12:12:02 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
|
|
*/
|
|
|
|
#ifndef _ACCOUNTS_MENU_H
|
|
|
|
#define _ACCOUNTS_MENU_H
|
|
|
|
|
2021-08-03 13:19:25 -05:00
|
|
|
#include <PopUpMenu.h>
|
2021-07-21 12:12:02 -05:00
|
|
|
|
|
|
|
#include "Observer.h"
|
|
|
|
|
2021-08-03 10:29:19 -05:00
|
|
|
class ProtocolLooper;
|
2021-08-03 13:19:25 -05:00
|
|
|
class Server;
|
2021-08-03 10:29:19 -05:00
|
|
|
|
2021-07-21 12:12:02 -05:00
|
|
|
|
2021-08-03 13:19:25 -05:00
|
|
|
class AccountsMenu : public BPopUpMenu, public Observer {
|
2021-07-21 12:12:02 -05:00
|
|
|
public:
|
2021-08-03 13:19:25 -05:00
|
|
|
AccountsMenu(const char* name, BMessage msg,
|
|
|
|
BMessage* allMsg, Server* server);
|
2021-07-28 10:13:31 -05:00
|
|
|
AccountsMenu(const char* name, BMessage msg,
|
|
|
|
BMessage* allMsg = NULL);
|
|
|
|
~AccountsMenu();
|
2021-07-21 12:12:02 -05:00
|
|
|
|
2021-07-28 10:13:31 -05:00
|
|
|
virtual void ObserveInteger(int32 what, int32 value);
|
|
|
|
|
|
|
|
void SetDefaultSelection(BMenuItem* item);
|
2021-07-21 12:12:02 -05:00
|
|
|
|
|
|
|
private:
|
2021-07-28 10:13:31 -05:00
|
|
|
void _PopulateMenu();
|
2021-07-21 12:12:02 -05:00
|
|
|
|
2021-08-03 10:29:19 -05:00
|
|
|
BBitmap* _EnsureProtocolIcon(const char* label,
|
|
|
|
ProtocolLooper* looper);
|
|
|
|
BBitmap* _EnsureAsteriskIcon();
|
|
|
|
|
|
|
|
|
2021-07-21 12:12:02 -05:00
|
|
|
BMessage fAccountMessage;
|
|
|
|
BMessage* fAllMessage;
|
2021-07-28 10:13:31 -05:00
|
|
|
static int32 fDefaultSelection;
|
2021-08-03 13:19:25 -05:00
|
|
|
Server* fServer;
|
2021-07-21 12:12:02 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _ACCOUNTS_MENU_H
|