Chat-O-Matic/application/ProtocolTemplate.h
Jaidyn Ann 7c002d8fcc Room creation window; Catch-all template window
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.
2021-06-18 01:13:02 -05:00

35 lines
783 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_TEMPLATE_H
#define _PROTOCOL_TEMPLATE_H
#include <SupportDefs.h>
class BMessage;
class BView;
class CayaProtocol;
class ProtocolTemplate {
public:
ProtocolTemplate(CayaProtocol* protocol,
const char* type);
~ProtocolTemplate();
status_t InitCheck() const;
CayaProtocol* Protocol() const;
status_t Load(BView* parent, BMessage* settings = NULL);
status_t Save(BView* parent, BMessage* settings);
private:
CayaProtocol* fProtocol;
BMessage* fTemplate;
};
#endif // _PROTOCOL_TEMPLATE_H