7c002d8fcc
Explicit room-creation using protocol's own "room" template is now supported. Two new protocol API messages were added― IM_CREATE_ROOM and IM_ROOM_CREATED, which are parallels to IM_CREATE_CHAT and IM_CHAT_CREATED. Rather than the latter two, though, these are wholy based on the "room" template― their slots are completely determined by the protocol. A generic "TemplateWindow" was created, which allows catch-all creation of windows that leverage protocols' templates. It's used for the room-creation window (Chat->New Room / Alt+N), for example. At some point, it ideally should replace even the JoinRoom window, and maybe others.
42 lines
996 B
C++
42 lines
996 B
C++
/*
|
|
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
|
* Copyright 2003-2009, IM Kit Team. All rights reserved.
|
|
* Copyright 2021, Jaidyn Levesque. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _PROTOCOL_SETTINGS_H
|
|
#define _PROTOCOL_SETTINGS_H
|
|
|
|
#include <ObjectList.h>
|
|
#include <String.h>
|
|
|
|
#include "ProtocolTemplate.h"
|
|
|
|
class BMessage;
|
|
class CayaProtocolAddOn;
|
|
|
|
class ProtocolSettings {
|
|
public:
|
|
ProtocolSettings(CayaProtocolAddOn* addOn);
|
|
|
|
status_t InitCheck() const;
|
|
|
|
CayaProtocolAddOn* AddOn() const;
|
|
BObjectList<BString> Accounts() const;
|
|
|
|
status_t Load(const char* account, BView* parent);
|
|
status_t Save(const char* account, BView* parent);
|
|
|
|
status_t Rename(const char* from, const char* to);
|
|
status_t Delete(const char* account);
|
|
|
|
private:
|
|
status_t _Load(const char* account, BMessage** settings);
|
|
|
|
CayaProtocolAddOn* fAddOn;
|
|
ProtocolTemplate fTemplate;
|
|
status_t fStatus;
|
|
};
|
|
|
|
#endif // _PROTOCOL_SETTINGS_H
|