/**********************************************************
 * This file has been automatically created by "typemaker2"
 * from the file "balance.xml".
 * Please do not edit this file, all changes will be lost.
 * Better edit the mentioned source file instead.
 **********************************************************/

#ifndef AB_BALANCE_BALANCE_H
#define AB_BALANCE_BALANCE_H


#ifdef __cplusplus
extern "C" {
#endif

/** @page P_AB_BALANCE Structure AB_BALANCE
<p>This page describes the properties of AB_BALANCE.</p>



<h1>AB_BALANCE</h1>

This class holds time and amount of an account balance.


@anchor AB_BALANCE_date
<h2>date</h2>

<p>Set this property with @ref AB_Balance_SetDate(), get it with @ref AB_Balance_GetDate().</p>


@anchor AB_BALANCE_value
<h2>value</h2>

<p>Set this property with @ref AB_Balance_SetValue(), get it with @ref AB_Balance_GetValue().</p>


@anchor AB_BALANCE_type
<h2>type</h2>

<p>Set this property with @ref AB_Balance_SetType(), get it with @ref AB_Balance_GetType().</p>

*/

/* needed system headers */
#include <gwenhywfar/types.h>
#include <gwenhywfar/list1.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/xml.h>

/* pre-headers */
#include <aqbanking/error.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/gwendate.h>

typedef struct AB_BALANCE AB_BALANCE;
GWEN_LIST_FUNCTION_LIB_DEFS(AB_BALANCE, AB_Balance, AQBANKING_API)



typedef enum {
  AB_Balance_TypeUnknown = -1,
  AB_Balance_TypeNone = 0,
  AB_Balance_TypeNoted,
  AB_Balance_TypeBooked,
  AB_Balance_TypeBankLine,
  AB_Balance_TypeDisposable,
  AB_Balance_TypeTemporary,
  AB_Balance_TypeDayStart,
  AB_Balance_TypeDayEnd
} AB_BALANCE_TYPE;


/* post-headers */
#include <aqbanking/types/value.h>


AQBANKING_API AB_BALANCE_TYPE AB_Balance_Type_fromString(const char *p_s);

AQBANKING_API const char *AB_Balance_Type_toString(AB_BALANCE_TYPE p_i);

/** Constructor. */
AQBANKING_API AB_BALANCE *AB_Balance_new(void);

/** Destructor. */
AQBANKING_API void AB_Balance_free(AB_BALANCE *p_struct);

AQBANKING_API void AB_Balance_Attach(AB_BALANCE *p_struct);

AQBANKING_API AB_BALANCE *AB_Balance_dup(const AB_BALANCE *p_src);

AQBANKING_API AB_BALANCE *AB_Balance_copy(AB_BALANCE *p_struct, const AB_BALANCE *p_src);

/** Getter.
 * Use this function to get the member "date" (see @ref AB_BALANCE_date)
*/
AQBANKING_API const GWEN_DATE *AB_Balance_GetDate(const AB_BALANCE *p_struct);

/** Getter.
 * Use this function to get the member "value" (see @ref AB_BALANCE_value)
*/
AQBANKING_API const AB_VALUE *AB_Balance_GetValue(const AB_BALANCE *p_struct);

/** Getter.
 * Use this function to get the member "type" (see @ref AB_BALANCE_type)
*/
AQBANKING_API AB_BALANCE_TYPE AB_Balance_GetType(const AB_BALANCE *p_struct);

/** Setter.
 * Use this function to set the member "date" (see @ref AB_BALANCE_date)
*/
AQBANKING_API void AB_Balance_SetDate(AB_BALANCE *p_struct, const GWEN_DATE *p_src);

/** Setter.
 * Use this function to set the member "value" (see @ref AB_BALANCE_value)
*/
AQBANKING_API void AB_Balance_SetValue(AB_BALANCE *p_struct, const AB_VALUE *p_src);

/** Setter.
 * Use this function to set the member "type" (see @ref AB_BALANCE_type)
*/
AQBANKING_API void AB_Balance_SetType(AB_BALANCE *p_struct, AB_BALANCE_TYPE p_src);

AQBANKING_API AB_BALANCE_LIST *AB_Balance_List_dup(const AB_BALANCE_LIST *p_src);

AQBANKING_API void AB_Balance_ReadDb(AB_BALANCE *p_struct, GWEN_DB_NODE *p_db);

AQBANKING_API int AB_Balance_WriteDb(const AB_BALANCE *p_struct, GWEN_DB_NODE *p_db);

AQBANKING_API AB_BALANCE *AB_Balance_fromDb(GWEN_DB_NODE *p_db);

AQBANKING_API int AB_Balance_toDb(const AB_BALANCE *p_struct, GWEN_DB_NODE *p_db);

AQBANKING_API void AB_Balance_ReadXml(AB_BALANCE *p_struct, GWEN_XMLNODE *p_db);

AQBANKING_API void AB_Balance_WriteXml(const AB_BALANCE *p_struct, GWEN_XMLNODE *p_db);

AQBANKING_API void AB_Balance_toXml(const AB_BALANCE *p_struct, GWEN_XMLNODE *p_db);

AQBANKING_API AB_BALANCE *AB_Balance_fromXml(GWEN_XMLNODE *p_db);

AQBANKING_API AB_BALANCE *AB_Balance_List_GetByType(const AB_BALANCE_LIST *p_list, int p_cmp);

AQBANKING_API AB_BALANCE *AB_Balance_List_FindFirstByType(const AB_BALANCE_LIST *bl, int ty);
AQBANKING_API AB_BALANCE *AB_Balance_List_FindNextByType(AB_BALANCE *bal, int ty);
AQBANKING_API AB_BALANCE *AB_Balance_List_GetLatestByType(const AB_BALANCE_LIST *bl, int ty);
/* end-headers */


#ifdef __cplusplus
}
#endif

#endif

