/*
* HTML document generation
*
* Copyright (C) 2017 Patrick McDermott
*
* This file is part of Marquee.
*
* Marquee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Marquee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Marquee. If not, see .
*/
#ifndef MQ_UTILS_HTML_H
#define MQ_UTILS_HTML_H
#include
G_BEGIN_DECLS
gchar *
mq_html_document(const gchar *title, const gchar *styles,
const gchar *head_tags, ...) G_GNUC_NULL_TERMINATED;
gchar *
mq_html_document_v(const gchar *title, const gchar *styles,
const gchar *head_tags, gchar **children);
#define TEXT_ELEMENT(ELEM) \
gchar * \
mq_html_##ELEM(const gchar *text); \
gchar * \
mq_html_##ELEM##_free(gchar *text);
TEXT_ELEMENT(h1)
TEXT_ELEMENT(h2)
TEXT_ELEMENT(h3)
TEXT_ELEMENT(h4)
TEXT_ELEMENT(h5)
TEXT_ELEMENT(h6)
TEXT_ELEMENT(p)
#undef TEXT_ELEMENT
gchar *
mq_html_container(const gchar *element, const gchar *classes, ...)
G_GNUC_NULL_TERMINATED;
gchar *
mq_html_container_v(const gchar *element, const gchar *classes,
gchar **children);
gchar *
mq_html_list(const gchar *type, GDestroyNotify destroy, ...)
G_GNUC_NULL_TERMINATED;
gchar *
mq_html_list_v(const gchar *type, gchar **children);
gchar *
mq_html_notebook(gboolean vertical, const gchar *name, guint current_page, ...)
G_GNUC_NULL_TERMINATED;
gchar *
mq_html_form(const gchar *submit_name, const gchar *submit_label,
const gchar *reset_name, const gchar *reset_label, ...)
G_GNUC_NULL_TERMINATED;
gchar *
mq_html_form_v(const gchar *submit_name, const gchar *submit_label,
const gchar *reset_name, const gchar *reset_label, gchar **children);
gchar *
mq_html_input_text(const gchar *name, const gchar *label, const gchar *value,
gboolean autofocus);
gchar *
mq_html_input_number_i(const gchar *name, const gchar *label,
gint min, gint step, gint max, gint value);
gchar *
mq_html_input_number_d(const gchar *name, const gchar *label,
gdouble min, gdouble step, gdouble max, gdouble value);
gchar *
mq_html_input_radio(const gchar *name, const gchar *id, const gchar *value,
const gchar *label, gboolean checked);
gchar *
mq_html_input_checkbox(const gchar *name, const gchar *label, gboolean checked);
gchar *
mq_html_input_select(const gchar *name, const gchar *label,
const gchar *selected,
GDestroyNotify destroy_value, GDestroyNotify destroy_label, ...)
G_GNUC_NULL_TERMINATED;
gchar *
mq_html_input_hidden(const gchar *name, const gchar *value);
gchar *
mq_html_label(const gchar *for_id, const gchar *label, gboolean add_colon);
gchar *
mq_html_submit(const gchar *name, const gchar *label, gboolean disabled);
gchar *
mq_html_buttonbox(const gchar *submit_name, const gchar *submit_label,
const gchar *reset_name, const gchar *reset_label);
gchar *
mq_html_input_iframe(const gchar *src);
G_END_DECLS
#endif /* MQ_UTILS_HTML_H */