Chat-O-Matic/application/ProtocolManager.h

59 lines
1.5 KiB
C
Raw Normal View History

/*
2011-12-03 16:38:03 -06:00
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _PROTOCOL_MANAGER_H
#define _PROTOCOL_MANAGER_H
#include <Path.h>
#include <String.h>
#include <libsupport/KeyMap.h>
2010-05-08 14:35:28 -05:00
#include "CayaProtocol.h"
#include "CayaProtocolAddOn.h"
class BBitmap;
class BDirectory;
class BHandler;
2010-05-20 16:31:55 -05:00
class ProtocolManager {
public:
void Init(BDirectory dir, BHandler* target);
static ProtocolManager* Get();
2010-05-28 12:11:16 -05:00
uint32 CountProtocolAddOns() const;
CayaProtocolAddOn* ProtocolAddOnAt(uint32 i) const;
CayaProtocolAddOn* ProtocolAddOn(const char* signature);
2010-05-28 12:11:16 -05:00
uint32 CountProtocolInstances() const;
CayaProtocol* ProtocolInstanceAt(uint32 i) const;
CayaProtocol* ProtocolInstance(bigtime_t identifier);
void AddAccount(CayaProtocolAddOn* addOn,
2010-05-20 16:31:55 -05:00
const char* account,
BHandler* target);
private:
2010-05-28 12:11:16 -05:00
typedef KeyMap<BString, CayaProtocolAddOn*> AddOnMap;
typedef KeyMap<bigtime_t, CayaProtocol*> ProtocolMap;
ProtocolManager();
2021-06-11 21:43:50 -05:00
void _LoadAccounts(const char* image_path,
CayaProtocolAddOn* addOn, int protoIndex,
BHandler* target);
void _LoadAccount(const char* imagePath,
BEntry accountEntry, int protoIndex,
2010-05-20 16:31:55 -05:00
BHandler* target);
2021-06-11 21:43:50 -05:00
void _LoadAccount(CayaProtocolAddOn* addOn,
BEntry accountEntry, BHandler* target);
AddOnMap fAddOnMap;
ProtocolMap fProtocolMap;
};
#endif // _PROTOCOL_MANAGER_H