/****************************************************************************
 * This file is part of the project AqHome.
 * AqHome (c) by 2024 Martin Preuss, all rights reserved.
 *
 * The license for this file can be found in the file COPYING which you
 * should have received along with this file.
 ****************************************************************************/

#ifndef AQHOME_REACT_PARAM_H
#define AQHOME_REACT_PARAM_H

#include <gwenhywfar/list.h>
#include <gwenhywfar/db.h>


typedef struct AQHREACT_PARAM AQHREACT_PARAM;
GWEN_LIST_FUNCTION_DEFS(AQHREACT_PARAM, AQHREACT_Param)

#include "aqhome-react/server.h"



AQHREACT_PARAM *AQHREACT_Param_new();
void AQHREACT_Param_free(AQHREACT_PARAM *param);

const char *AQHREACT_Param_GetName(const AQHREACT_PARAM *param);
void AQHREACT_Param_SetName(AQHREACT_PARAM *param, const char *s);

const char *AQHREACT_Param_GetDescription(const AQHREACT_PARAM *param);
void AQHREACT_Param_SetDescription(AQHREACT_PARAM *param, const char *s);

int AQHREACT_Param_GetDataType(const AQHREACT_PARAM *param);
void AQHREACT_Param_SetDataType(AQHREACT_PARAM *param, int i);

const char *AQHREACT_Param_GetStringValue(const AQHREACT_PARAM *param);
void AQHREACT_Param_SetStringValue(AQHREACT_PARAM *param, const char *s);

double AQHREACT_Param_GetDoubleValue(const AQHREACT_PARAM *param);
void AQHREACT_Param_SetDoubleValue(AQHREACT_PARAM *param, double d);

uint32_t AQHREACT_Param_GetFlags(const AQHREACT_PARAM *param);
void AQHREACT_Param_SetFlags(AQHREACT_PARAM *param, uint32_t f);
void AQHREACT_Param_AddFlags(AQHREACT_PARAM *param, uint32_t f);
void AQHREACT_Param_SubFlags(AQHREACT_PARAM *param, uint32_t f);

AQHREACT_PARAM *AQHREACT_Param_List_GetParamByName(const AQHREACT_PARAM_LIST *paramList, const char *paramName);

int AQHREACT_Param_List_WriteIntoDb(const AQHREACT_PARAM_LIST *paramList, GWEN_DB_NODE *db, uint32_t dbFlags);

void AQHREACT_Param_Dump(const AQHREACT_PARAM *param, GWEN_BUFFER *buf, int indent);
void AQHREACT_Param_List_Dump(const AQHREACT_PARAM_LIST *paramList, GWEN_BUFFER *buf, int indent, const char *title);


#endif

