Chat-O-Matic/application/ProtocolTemplate.h
Jaidyn Ann 3fbe072d42 Generalize protocol settings' GUI templating
A nice templating system is used for account settings dialogues― the
required slots are specified by the protocol, and are reflected in the
settings dialogue.

To generalize this templating system (and eventually use elsewhere),
ProtocolSettings was split into two classes― ProtocolSettings and
ProtocolTemplate.

The CayaProtocol::SettingsTemplate() call was also edited to require a
string parameter, naming the specific template that should be returned.

"account" is used for the account settings dialogue, and other values
are TBA.
2021-06-17 17:02:29 -05:00

35 lines
773 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 CayaProtocolAddOn;
class ProtocolTemplate {
public:
ProtocolTemplate(CayaProtocolAddOn* addOn,
const char* type);
~ProtocolTemplate();
status_t InitCheck() const;
CayaProtocolAddOn* AddOn() const;
status_t Load(BView* parent, BMessage* settings = NULL);
BMessage* Save(BView* parent);
private:
CayaProtocolAddOn* fAddOn;
BMessage* fTemplate;
};
#endif // _PROTOCOL_TEMPLATE_H