diff --git a/modules/broken_seals_module/.gitignore b/modules/broken_seals_module/.gitignore deleted file mode 100644 index 00d0f29..0000000 --- a/modules/broken_seals_module/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.import -*.d -*.o -*.meta -*.obj -*.pyc -*.bc -*.os diff --git a/modules/broken_seals_module/LICENSE b/modules/broken_seals_module/LICENSE deleted file mode 100644 index 77b0728..0000000 --- a/modules/broken_seals_module/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2023 Péter Magyar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/modules/broken_seals_module/SCsub b/modules/broken_seals_module/SCsub deleted file mode 100644 index c25c19d..0000000 --- a/modules/broken_seals_module/SCsub +++ /dev/null @@ -1,25 +0,0 @@ -import os - -Import('env') - -module_env = env.Clone() - -sources = [ - - "register_types.cpp", - - "biome_terrain_generator.cpp", -] - -if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': - # Shared lib compilation - module_env.Append(CCFLAGS=['-fPIC']) - module_env['LIBS'] = [] - shared_lib = module_env.SharedLibrary(target='#bin/broken_seals_module', source=sources) - shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] - env.Append(LIBS=[shared_lib_shim]) - env.Append(LIBPATH=['#bin']) -else: - # Static compilation - module_env.add_source_files(env.modules_sources, sources) - diff --git a/modules/broken_seals_module/biome_terrain_generator.cpp b/modules/broken_seals_module/biome_terrain_generator.cpp deleted file mode 100644 index 002f5d7..0000000 --- a/modules/broken_seals_module/biome_terrain_generator.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (c) 2020-2023 Péter Magyar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "biome_terrain_generator.h" - -#include "core/config/engine.h" - -#include "core/math/math_funcs.h" - -#include "modules/modules_enabled.gen.h" - -#ifdef MODULE_VOXELMAN_ENABLED -#include "../voxelman/world/default/voxel_chunk_default.h" -#include "../voxelman/world/voxel_chunk.h" -#endif - -#include "../entity_spell_system/singletons/ess.h" -#include "../entity_spell_system/spawners/ess_entity_spawner.h" -#include "../opensimplex/open_simplex_noise.h" - -int BiomeTerrainGenerator::get_current_seed() { - return _current_seed; -} -void BiomeTerrainGenerator::set_current_seed(int value) { - _current_seed = value; -} - -#ifdef MODULE_VOXELMAN_ENABLED -void BiomeTerrainGenerator::generate_simple_terrarin(Ref chunk, bool spawn_mobs) { - Ref noise; - noise.instance(); - noise->set_seed(10 * get_current_seed()); - noise->set_octaves(4); - noise->set_period(280.0); - noise->set_persistence(0.8); - - Ref terr_noise; - terr_noise.instance(); - terr_noise->set_seed(10 * 321 + 112 * get_current_seed()); - terr_noise->set_octaves(4); - terr_noise->set_period(90.0); - terr_noise->set_persistence(0.9); - - Ref det_noise; - det_noise.instance(); - det_noise->set_seed(10 * 3231 + 112 * get_current_seed()); - det_noise->set_octaves(6); - det_noise->set_period(80.0); - det_noise->set_persistence(0.3); - - for (int x = -chunk->get_margin_start(); x < chunk->get_size_x() + chunk->get_margin_end(); ++x) { - for (int z = -chunk->get_margin_start(); z < chunk->get_size_z() + chunk->get_margin_end(); ++z) { - float val = noise->get_noise_2d(x + (chunk->get_position_x() * chunk->get_size_x()), z + (chunk->get_position_z() * chunk->get_size_z())); - val *= val; - val *= 200.0; - val += 2.0; - - float tv = terr_noise->get_noise_2d(x + (chunk->get_position_x() * chunk->get_size_x()), z + (chunk->get_position_z() * chunk->get_size_z())); - tv *= tv * tv * tv; - val += tv * 2.0; - - float dval = noise->get_noise_2d(x + (chunk->get_position_x() * chunk->get_size_x()), z + (chunk->get_position_z() * chunk->get_size_z())); - - val += dval * 6.0; - - int v = (int(val)); - - v -= chunk->get_position_y() * (chunk->get_size_y()); - - if (v > chunk->get_size_y() + chunk->get_margin_end()) - v = chunk->get_size_y() + chunk->get_margin_end(); - - for (int y = -chunk->get_margin_start(); y < v; y++) { - Math::seed(x + (chunk->get_position_x() * chunk->get_size_x()) + z + (chunk->get_position_z() * chunk->get_size_z()) + y + (chunk->get_position_y() * chunk->get_size_y())); - - if (v < 2) - chunk->set_voxel(1, x, y, z, VoxelChunkDefault::DEFAULT_CHANNEL_TYPE); - else if (v == 2) - chunk->set_voxel(3, x, y, z, VoxelChunkDefault::DEFAULT_CHANNEL_TYPE); - else - chunk->set_voxel(2, x, y, z, VoxelChunkDefault::DEFAULT_CHANNEL_TYPE); - - float val2 = (val - static_cast(val)) * 4.0; - val2 = static_cast(val2); - val2 /= 4.0; - - chunk->set_voxel(static_cast(255.0 * val2), x, y, z, VoxelChunkDefault::DEFAULT_CHANNEL_ISOLEVEL); - } - } - } - - //if (!Engine::get_singleton()->is_editor_hint() && chunk->get_position_y() == 0 && spawn_mobs) { - // Vector3 v = Vector3(chunk->get_position_x() * chunk->get_size_x() * chunk->get_voxel_scale() + chunk->get_size_x() / 2, - // (chunk->get_position_y() + 1) * chunk->get_size_y() * chunk->get_voxel_scale(), - // chunk->get_position_z()) * - // (chunk->get_size_z() * chunk->get_voxel_scale() + chunk->get_size_z() / 2); - // - // ESS::get_singleton()->get_entity_spawner()->call("spawn_mob", 0, Math::rand() % 3, v); - // } -} -#endif - -BiomeTerrainGenerator::BiomeTerrainGenerator() { - _current_seed = 0; -} - -BiomeTerrainGenerator::~BiomeTerrainGenerator() { -} - -void BiomeTerrainGenerator::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_current_seed"), &BiomeTerrainGenerator::get_current_seed); - ClassDB::bind_method(D_METHOD("set_current_seed", "value"), &BiomeTerrainGenerator::set_current_seed); - ADD_PROPERTY(PropertyInfo(Variant::INT, "current_seed"), "set_current_seed", "get_current_seed"); - -#ifdef MODULE_VOXELMAN_ENABLED - ClassDB::bind_method(D_METHOD("generate_simple_terrarin", "chunk", "spawn_mobs"), &BiomeTerrainGenerator::generate_simple_terrarin); -#endif -} diff --git a/modules/broken_seals_module/biome_terrain_generator.h b/modules/broken_seals_module/biome_terrain_generator.h deleted file mode 100644 index 1f31f3f..0000000 --- a/modules/broken_seals_module/biome_terrain_generator.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef BIOME_TERRAIN_GENERATOR_H -#define BIOME_TERRAIN_GENERATOR_H -/* -Copyright (c) 2020-2023 Péter Magyar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "core/object/reference.h" - -#include "modules/modules_enabled.gen.h" - -#ifdef MODULE_VOXELMAN_ENABLED -class VoxelChunk; -#endif - -class BiomeTerrainGenerator : public Reference { - GDCLASS(BiomeTerrainGenerator, Reference); - -public: - int get_current_seed(); - void set_current_seed(int value); - -#ifdef MODULE_VOXELMAN_ENABLED - void generate_simple_terrarin(Ref chunk, bool spawn_mobs); -#endif - - BiomeTerrainGenerator(); - ~BiomeTerrainGenerator(); - -protected: - static void _bind_methods(); - -private: - int _current_seed; -}; - -#endif diff --git a/modules/broken_seals_module/config.py b/modules/broken_seals_module/config.py deleted file mode 100644 index eb872e3..0000000 --- a/modules/broken_seals_module/config.py +++ /dev/null @@ -1,17 +0,0 @@ - -def can_build(env, platform): - return True - - -def configure(env): - pass - - -def get_doc_classes(): - return [ - "BiomeTerrainGenerator", - ] - -def get_doc_path(): - return "doc_classes" - diff --git a/modules/broken_seals_module/doc_classes/BiomeTerrainGenerator.xml b/modules/broken_seals_module/doc_classes/BiomeTerrainGenerator.xml deleted file mode 100644 index feff179..0000000 --- a/modules/broken_seals_module/doc_classes/BiomeTerrainGenerator.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/broken_seals_module/register_types.cpp b/modules/broken_seals_module/register_types.cpp deleted file mode 100644 index 84b6b88..0000000 --- a/modules/broken_seals_module/register_types.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "register_types.h" - -/* - -Copyright (c) 2020-2023 Péter Magyar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -*/ - -#include "biome_terrain_generator.h" - -void register_broken_seals_module_types(ModuleRegistrationLevel p_level) { - if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) { - ClassDB::register_class(); - } -} - -void unregister_broken_seals_module_types(ModuleRegistrationLevel p_level) { -} diff --git a/modules/broken_seals_module/register_types.h b/modules/broken_seals_module/register_types.h deleted file mode 100644 index b95d3f7..0000000 --- a/modules/broken_seals_module/register_types.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef BROKEN_SEALS_MODULE_REGISTER_TYPES_H -#define BROKEN_SEALS_MODULE_REGISTER_TYPES_H - -/* - -Copyright (c) 2020-2023 Péter Magyar -Copyright(c) 2017-2020 Mattias Edlund - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -*/ - -#include "modules/register_module_types.h" - -void register_broken_seals_module_types(ModuleRegistrationLevel p_level); -void unregister_broken_seals_module_types(ModuleRegistrationLevel p_level); - -#endif diff --git a/modules/cscript/SCsub b/modules/cscript/SCsub deleted file mode 100644 index a4af0cf..0000000 --- a/modules/cscript/SCsub +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python - -Import("env") -Import("env_modules") - -env_gdscript = env_modules.Clone() - -env_gdscript.add_source_files(env.modules_sources, "*.cpp") - -if env["tools"]: - env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp") - \ No newline at end of file diff --git a/modules/cscript/config.py b/modules/cscript/config.py deleted file mode 100644 index b70e908..0000000 --- a/modules/cscript/config.py +++ /dev/null @@ -1,22 +0,0 @@ - -def can_build(env, platform): - return True - -def configure(env): - pass - - -def get_doc_classes(): - return [ - "@CScript", - "CScript", - ] - - -def get_doc_path(): - return "doc_classes" - - -def is_enabled(): - # The module is disabled by default. - return False \ No newline at end of file diff --git a/modules/cscript/cscript.cpp b/modules/cscript/cscript.cpp deleted file mode 100644 index 3464394..0000000 --- a/modules/cscript/cscript.cpp +++ /dev/null @@ -1,2230 +0,0 @@ -/*************************************************************************/ -/* gdscript.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "cscript.h" - -#include "core/config/engine.h" -#include "core/config/project_settings.h" -#include "core/core_string_names.h" -#include "core/global_constants.h" -#include "core/io/file_access_encrypted.h" -#include "core/os/file_access.h" -#include "core/os/os.h" -#include "cscript_compiler.h" - -/////////////////////////// - -CScriptNativeClass::CScriptNativeClass(const StringName &p_name) { - name = p_name; -} - -bool CScriptNativeClass::_get(const StringName &p_name, Variant &r_ret) const { - bool ok; - int v = ClassDB::get_integer_constant(name, p_name, &ok); - - if (ok) { - r_ret = v; - return true; - } else { - return false; - } -} - -void CScriptNativeClass::_bind_methods() { - ClassDB::bind_method(D_METHOD("new"), &CScriptNativeClass::_new); -} - -Variant CScriptNativeClass::_new() { - Object *o = instance(); - ERR_FAIL_COND_V_MSG(!o, Variant(), "Class type: '" + String(name) + "' is not instantiable."); - - Reference *ref = Object::cast_to(o); - if (ref) { - return REF(ref); - } else { - return o; - } -} - -Object *CScriptNativeClass::instance() { - return ClassDB::instance(name); -} - -CScriptInstance *CScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error) { - /* STEP 1, CREATE */ - - CScriptInstance *instance = memnew(CScriptInstance); - instance->base_ref = p_isref; - instance->members.resize(member_indices.size()); - instance->script = Ref(this); - instance->owner = p_owner; -#ifdef DEBUG_ENABLED - //needed for hot reloading - for (RBMap::Element *E = member_indices.front(); E; E = E->next()) { - instance->member_indices_cache[E->key()] = E->get().index; - } -#endif - instance->owner->set_script_instance(instance); - - /* STEP 2, INITIALIZE AND CONSTRUCT */ - - CScriptLanguage::singleton->lock.lock(); - instances.insert(instance->owner); - CScriptLanguage::singleton->lock.unlock(); - - initializer->call(instance, p_args, p_argcount, r_error); - - if (r_error.error != Variant::CallError::CALL_OK) { - instance->script = Ref(); - instance->owner->set_script_instance(nullptr); -#ifndef NO_THREADS - CScriptLanguage::singleton->lock.lock(); -#endif - instances.erase(p_owner); -#ifndef NO_THREADS - CScriptLanguage::singleton->lock.unlock(); -#endif - - ERR_FAIL_COND_V(r_error.error != Variant::CallError::CALL_OK, nullptr); //error constructing - } - - //@TODO make thread safe - return instance; -} - -Variant CScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { - /* STEP 1, CREATE */ - - if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; - return Variant(); - } - - r_error.error = Variant::CallError::CALL_OK; - REF ref; - Object *owner = nullptr; - - CScript *_baseptr = this; - while (_baseptr->_base) { - _baseptr = _baseptr->_base; - } - - ERR_FAIL_COND_V(_baseptr->native.is_null(), Variant()); - if (_baseptr->native.ptr()) { - owner = _baseptr->native->instance(); - } else { - owner = memnew(Reference); //by default, no base means use reference - } - ERR_FAIL_COND_V_MSG(!owner, Variant(), "Can't inherit from a virtual class."); - - Reference *r = Object::cast_to(owner); - if (r) { - ref = REF(r); - } - - CScriptInstance *instance = _create_instance(p_args, p_argcount, owner, r != nullptr, r_error); - if (!instance) { - if (ref.is_null()) { - memdelete(owner); //no owner, sorry - } - return Variant(); - } - - if (ref.is_valid()) { - return ref; - } else { - return owner; - } -} - -bool CScript::can_instance() const { -#ifdef TOOLS_ENABLED - return valid && (tool || ScriptServer::is_scripting_enabled()); -#else - return valid; -#endif -} - -Ref"; - - return this; -} - -HTMLBuilder *HTMLBuilder::csection() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cselect() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::csmall() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::csource() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cspan() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cstrike() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cstrong() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cstyle() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::csub() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::csummary() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::csup() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::csvg() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctable() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctbody() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctd() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctemplateh() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctextarea() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctfoot() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cth() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cthead() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctime() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctitle() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctr() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctrack() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::ctt() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cu() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cul() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cvar() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cvideo() { - write_tag(); - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::cwbr() { - write_tag(); - result += ""; - - return this; -} - -HTMLTag *HTMLBuilder::form_get() { - write_tag(); - - return _tag.start("form")->method_get(); -} -HTMLTag *HTMLBuilder::form_post() { - write_tag(); - - return _tag.start("form")->method_post(); -} -HTMLBuilder *HTMLBuilder::form_get(const String &action, const String &cls, const String &id) { - HTMLTag *t = form_get(); - - t->fora(action); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} -HTMLBuilder *HTMLBuilder::form_post(const String &action, const String &cls, const String &id) { - HTMLTag *t = form_post(); - - t->action(action); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::form_postr(const String &action, Ref request, const String &cls, const String &id) { - form_post(action, cls, id); - csrf_tokenr(request); - - return this; -} - -HTMLTag *HTMLBuilder::input_button() { - write_tag(); - - return _tag.start("input")->itbutton(); -} - -HTMLTag *HTMLBuilder::input_checkbox() { - write_tag(); - - return _tag.start("input")->itcheckbox(); -} - -HTMLTag *HTMLBuilder::input_color() { - write_tag(); - - return _tag.start("input")->itcolor(); -} - -HTMLTag *HTMLBuilder::input_date() { - write_tag(); - - return _tag.start("input")->itdate(); -} - -HTMLTag *HTMLBuilder::input_datetime_local() { - write_tag(); - - return _tag.start("input")->itdatetime_local(); -} - -HTMLTag *HTMLBuilder::input_email() { - write_tag(); - - return _tag.start("input")->itemail(); -} - -HTMLTag *HTMLBuilder::input_file() { - write_tag(); - - return _tag.start("input")->itfile(); -} - -HTMLTag *HTMLBuilder::input_hidden() { - write_tag(); - - return _tag.start("input")->ithidden(); -} - -HTMLTag *HTMLBuilder::input_image() { - write_tag(); - - return _tag.start("input")->itimage(); -} - -HTMLTag *HTMLBuilder::input_month() { - write_tag(); - - return _tag.start("input")->itmonth(); -} - -HTMLTag *HTMLBuilder::input_number() { - write_tag(); - - return _tag.start("input")->itnumber(); -} - -HTMLTag *HTMLBuilder::input_password() { - write_tag(); - - return _tag.start("input")->itpassword(); -} - -HTMLTag *HTMLBuilder::input_radio() { - write_tag(); - - return _tag.start("input")->itradio(); -} - -HTMLTag *HTMLBuilder::input_range() { - write_tag(); - - return _tag.start("input")->itrange(); -} - -HTMLTag *HTMLBuilder::input_reset() { - write_tag(); - - return _tag.start("input")->itreset(); -} - -HTMLTag *HTMLBuilder::input_search() { - write_tag(); - - return _tag.start("input")->itsearch(); -} - -HTMLTag *HTMLBuilder::input_submit() { - write_tag(); - - return _tag.start("input")->itsubmit(); -} - -HTMLTag *HTMLBuilder::input_tel() { - write_tag(); - - return _tag.start("input")->ittel(); -} - -HTMLTag *HTMLBuilder::input_text() { - write_tag(); - - return _tag.start("input")->ittext(); -} - -HTMLTag *HTMLBuilder::input_time() { - write_tag(); - - return _tag.start("input")->ittime(); -} - -HTMLTag *HTMLBuilder::input_url() { - write_tag(); - - return _tag.start("input")->iturl(); -} - -HTMLTag *HTMLBuilder::input_week() { - write_tag(); - - return _tag.start("input")->itweek(); -} - -HTMLBuilder *HTMLBuilder::label(const String &pfor, const String &plabel, const String &cls, const String &id) { - HTMLTag *t = label(); - - t->fora(pfor); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - w(plabel); - - clabel(); - - return this; -} - -HTMLBuilder *HTMLBuilder::input_button(const String &name, const String &value, const String &cls, const String &id) { - HTMLTag *t = input_button(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_checkbox(const String &name, const String &value, const bool checked, const String &cls, const String &id) { - HTMLTag *t = input_checkbox(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - t->checked(checked); - - return this; -} - -HTMLBuilder *HTMLBuilder::input_color(const String &name, const String &value, const String &cls, const String &id) { - HTMLTag *t = input_color(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_date(const String &name, const String &value, const String &cls, const String &id, const String &date_min, const String &date_max, const String &date_step) { - HTMLTag *t = input_date(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (date_min != "") { - t->min(date_min); - } - - if (date_max != "") { - t->max(date_max); - } - - if (date_step != "") { - t->step(date_step); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_datetime_local(const String &name, const String &value, const String &cls, const String &id, const String &date_min, const String &date_max, const String &date_step) { - HTMLTag *t = input_datetime_local(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (date_min != "") { - t->min(date_min); - } - - if (date_max != "") { - t->max(date_max); - } - - if (date_step != "") { - t->step(date_step); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_email(const String &name, const String &value, const String &placeholder, const String &cls, const String &id) { - HTMLTag *t = input_email(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (placeholder != "") { - t->placeholder(placeholder); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_file(const String &name, const String &accept, const String &cls, const String &id) { - HTMLTag *t = input_file(); - - t->name(name); - - if (accept != "") { - t->accept(accept); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_image(const String &name, const String &src, const String &alt, const String &cls, const String &id, const int width, const int height) { - HTMLTag *t = input_image(); - - t->name(name); - - if (src != "") { - t->src(src); - } - - if (alt != "") { - t->alt(alt); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (width != 0) { - t->width(width); - } - - if (height != 0) { - t->height(height); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_month(const String &name, const String &cls, const String &id) { - HTMLTag *t = input_month(); - - t->name(name); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_number(const String &name, const String &vmin, const String &vmax, const String &cls, const String &id) { - HTMLTag *t = input_number(); - - t->name(name); - - if (vmin != "") { - t->min(vmin); - } - - if (vmax != "") { - t->max(vmax); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_password(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size) { - HTMLTag *t = input_password(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (placeholder != "") { - t->placeholder(placeholder); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (minlength != "") { - t->minlength(minlength); - } - - if (maxlength != "") { - t->maxlength(maxlength); - } - - if (size != "") { - t->size(size); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_radio(const String &name, const String &value, const String &cls, const String &id) { - HTMLTag *t = input_password(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_range(const String &name, const String &value, const String &vmin, const String &vmax, const String &vstep, const String &cls, const String &id) { - HTMLTag *t = input_range(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (vmin != "") { - t->min(vmin); - } - - if (vmax != "") { - t->max(vmax); - } - - if (vstep != "") { - t->step(vstep); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_reset(const String &name, const String &value, const String &cls, const String &id) { - HTMLTag *t = input_reset(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_search(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size, const String &pattern) { - HTMLTag *t = input_search(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (placeholder != "") { - t->placeholder(placeholder); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (minlength != "") { - t->minlength(minlength); - } - - if (maxlength != "") { - t->maxlength(maxlength); - } - - if (size != "") { - t->size(size); - } - - if (pattern != "") { - t->pattern(pattern); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_submit(const String &value, const String &cls, const String &id) { - HTMLTag *t = input_submit(); - - t->value(value); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_tel(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size, const String &pattern) { - HTMLTag *t = input_tel(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (placeholder != "") { - t->placeholder(placeholder); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (minlength != "") { - t->minlength(minlength); - } - - if (maxlength != "") { - t->maxlength(maxlength); - } - - if (size != "") { - t->size(size); - } - - if (pattern != "") { - t->pattern(pattern); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_text(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size) { - HTMLTag *t = input_text(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (placeholder != "") { - t->placeholder(placeholder); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (minlength != "") { - t->minlength(minlength); - } - - if (maxlength != "") { - t->maxlength(maxlength); - } - - if (size != "") { - t->size(size); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_time(const String &name, const String &cls, const String &id, const String &vmin, const String &vmax, const String &vstep) { - HTMLTag *t = input_time(); - - t->name(name); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (vmin != "") { - t->min(vmin); - } - - if (vmax != "") { - t->max(vmax); - } - - if (vstep != "") { - t->step(vstep); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_url(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size) { - HTMLTag *t = input_url(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - if (placeholder != "") { - t->placeholder(placeholder); - } - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (minlength != "") { - t->minlength(minlength); - } - - if (maxlength != "") { - t->maxlength(maxlength); - } - - if (size != "") { - t->size(size); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_week(const String &name, const String &cls, const String &id, const String &vmin, const String &vmax) { - HTMLTag *t = input_week(); - - t->name(name); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - if (vmin != "") { - t->min(vmin); - } - - if (vmax != "") { - t->max(vmax); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::input_hidden(const String &name, const String &value) { - HTMLTag *t = input_hidden(); - - t->name(name); - - if (value != "") { - t->value(value); - } - - return this; -} - -HTMLBuilder *HTMLBuilder::csrf_token(const String &token) { - if (token == "") { - // don't waste html characters if it's an empty string anyway - return this; - } - - input_hidden("csrf_token", token); - - return this; -} - -HTMLBuilder *HTMLBuilder::csrf_tokenr(Ref request) { - return csrf_token(request->get_csrf_token()); -} - -void HTMLBuilder::f() { - write_tag(); -} - -HTMLTag *HTMLBuilder::tag(const String &p_tag, const bool p_simple) { - write_tag(); - - return _tag.start(p_tag, p_simple); -} - -HTMLBuilder *HTMLBuilder::ctag(const String &p_tag) { - write_tag(); - - result += ""; - - return this; -} - -HTMLBuilder *HTMLBuilder::w(const String &val) { - write_tag(); - - result += val; - - return this; -} - -HTMLBuilder *HTMLBuilder::wn(const double val, int p_decimals) { - write_tag(); - - result += String::num(val, p_decimals); - - return this; -} -HTMLBuilder *HTMLBuilder::wns(const double val) { - write_tag(); - - result += String::num_scientific(val); - - return this; -} -HTMLBuilder *HTMLBuilder::wr(const double val, const bool p_trailing) { - write_tag(); - - //TODO - //result += String::num_real(val, p_trailing); - - return this; -} -HTMLBuilder *HTMLBuilder::wi(const int64_t val, const int base, const bool capitalize_hex) { - write_tag(); - - result += String::num_int64(val, base, capitalize_hex); - - return this; -} -HTMLBuilder *HTMLBuilder::wui(const uint64_t val, const int base, const bool capitalize_hex) { - write_tag(); - - result += String::num_uint64(val, base, capitalize_hex); - - return this; -} - -HTMLBuilder *HTMLBuilder::wbn(const bool val) { - write_tag(); - - result += String::bool_num(val); - - return this; -} -HTMLBuilder *HTMLBuilder::wbs(const bool val) { - write_tag(); - - result += String::bool_str(val); - - return this; -} - -HTMLBuilder *HTMLBuilder::we(const String &val) { - write_tag(); - - result += val.http_escape(); - - return this; -} - -HTMLBuilder *HTMLBuilder::write_tag() { - if (_tag.has_data()) { - _tag.close(); - result += _tag.result; - _tag.reset(); - } - - return this; -} - -HTMLBuilder::HTMLBuilder() { - _tag.owner = this; -} - -HTMLBuilder::~HTMLBuilder() { -} diff --git a/modules/web/html/html_builder.h b/modules/web/html/html_builder.h deleted file mode 100644 index 35766dd..0000000 --- a/modules/web/html/html_builder.h +++ /dev/null @@ -1,563 +0,0 @@ -#ifndef HTML_BUILDER_H -#define HTML_BUILDER_H - -#include "core/string/ustring.h" - -#include "core/object/reference.h" - -class Request; -class HTMLBuilder; -class WebServerRequest; - -class HTMLTag { -public: - bool simple; - String result; - - HTMLTag *str(const String &str); - HTMLTag *style(const String &val); - HTMLTag *href(const String &val); - HTMLTag *cls(const String &val); - HTMLTag *clsse(const String &val); //se -> skip empty - HTMLTag *id(const String &val); - HTMLTag *name(const String &val); - HTMLTag *content(const String &val); - HTMLTag *value(const String &val); - HTMLTag *accept(const String &val); - HTMLTag *src(const String &val); - HTMLTag *alt(const String &val); - HTMLTag *inputmode(const String &val); - HTMLTag *list(const String &val); - - HTMLTag *rows(const String &val); - HTMLTag *cols(const String &val); - - HTMLTag *enctype(const String &val); - HTMLTag *enctype_multipart_form_data(); - - HTMLTag *autocomplete(const String &val); - - HTMLTag *autocomplete_off(); - HTMLTag *autocomplete_on(); - HTMLTag *autocomplete_name(); - HTMLTag *autocomplete_name_honorific_prefix(); - HTMLTag *autocomplete_name_given_name(); - HTMLTag *autocomplete_name_additional_name(); - HTMLTag *autocomplete_name_family_name(); - HTMLTag *autocomplete_name_honorific_suffix(); - HTMLTag *autocomplete_name_nickname(); - HTMLTag *autocomplete_email(); - HTMLTag *autocomplete_username(); - HTMLTag *autocomplete_new_password(); - HTMLTag *autocomplete_current_password(); - HTMLTag *autocomplete_one_time_code(); - HTMLTag *autocomplete_organization_title(); - HTMLTag *autocomplete_organization(); - HTMLTag *autocomplete_street_address(); - HTMLTag *autocomplete_address_line1(); - HTMLTag *autocomplete_address_line2(); - HTMLTag *autocomplete_address_line3(); - HTMLTag *autocomplete_address_level_1(); - HTMLTag *autocomplete_address_level_2(); - HTMLTag *autocomplete_address_level_3(); - HTMLTag *autocomplete_address_level_4(); - HTMLTag *autocomplete_country(); - HTMLTag *autocomplete_country_name(); - HTMLTag *autocomplete_postal_code(); - HTMLTag *autocomplete_cc_name(); - HTMLTag *autocomplete_cc_given_name(); - HTMLTag *autocomplete_cc_additional_name(); - HTMLTag *autocomplete_cc_family_name(); - HTMLTag *autocomplete_cc_number(); - HTMLTag *autocomplete_cc_exp(); - HTMLTag *autocomplete_cc_exp_month(); - HTMLTag *autocomplete_cc_exp_year(); - HTMLTag *autocomplete_cc_csc(); - HTMLTag *autocomplete_cc_type(); - HTMLTag *autocomplete_transaction_currency(); - HTMLTag *autocomplete_transaction_amount(); - HTMLTag *autocomplete_language(); - HTMLTag *autocomplete_bday(); - HTMLTag *autocomplete_bday_day(); - HTMLTag *autocomplete_bday_month(); - HTMLTag *autocomplete_bday_year(); - HTMLTag *autocomplete_sex(); - HTMLTag *autocomplete_tel(); - HTMLTag *autocomplete_tel_country_code(); - HTMLTag *autocomplete_tel_national(); - HTMLTag *autocomplete_tel_area_code(); - HTMLTag *autocomplete_tel_local(); - HTMLTag *autocomplete_tel_extension(); - HTMLTag *autocomplete_impp(); - HTMLTag *autocomplete_url(); - HTMLTag *autocomplete_photo(); - - HTMLTag *onclick(const String &val); - - HTMLTag *checked(const bool val = true); - HTMLTag *selected(const bool val = true); - HTMLTag *autofocus(const bool val = true); - HTMLTag *disabled(const bool val = true); - HTMLTag *multiple(const bool val = true); - HTMLTag *required(const bool val = true); - HTMLTag *spellcheck(const bool val); - - HTMLTag *max(const String &val); - HTMLTag *min(const String &val); - HTMLTag *step(const String &val); - HTMLTag *step_any(); - - HTMLTag *minlength(const int val); - HTMLTag *minlength(const String &val); - HTMLTag *maxlength(const int val); - HTMLTag *maxlength(const String &val); - HTMLTag *size(const int val); - HTMLTag *size(const String &val); - - HTMLTag *width(const int val); - HTMLTag *width(const String &val); - HTMLTag *height(const int val); - HTMLTag *height(const String &val); - - HTMLTag *pattern(const String &val); - - HTMLTag *method(const String &val); - HTMLTag *method_get(); - HTMLTag *method_post(); - - HTMLTag *action(const String &val); - HTMLTag *type(const String &val); - HTMLTag *placeholder(const String &val); - HTMLTag *fora(const String &val); // for attrib -> for is reserved keyword - - HTMLTag *rel(const String &val); - HTMLTag *rel_stylesheet(); - HTMLTag *rel_alternate(); - HTMLTag *rel_author(); - HTMLTag *rel_bookmark(); - HTMLTag *rel_external(); - HTMLTag *rel_help(); - HTMLTag *rel_license(); - HTMLTag *rel_next(); - HTMLTag *rel_nofollow(); - HTMLTag *rel_noopener(); - HTMLTag *rel_noreferrer(); - HTMLTag *rel_prev(); - HTMLTag *rel_search(); - HTMLTag *rel_tag(); - - HTMLTag *charset(const String &val); - HTMLTag *charset_utf_8(); - - HTMLTag *itbutton(); - HTMLTag *itcheckbox(); - HTMLTag *itcolor(); - HTMLTag *itdate(); - HTMLTag *itdatetime_local(); - HTMLTag *itemail(); - HTMLTag *itfile(); - HTMLTag *ithidden(); - HTMLTag *itimage(); - HTMLTag *itmonth(); - HTMLTag *itnumber(); - HTMLTag *itpassword(); - HTMLTag *itradio(); - HTMLTag *itrange(); - HTMLTag *itreset(); - HTMLTag *itsearch(); - HTMLTag *itsubmit(); - HTMLTag *ittel(); - HTMLTag *ittext(); - HTMLTag *ittime(); - HTMLTag *iturl(); - HTMLTag *itweek(); - - HTMLTag *inputmode_none(); - HTMLTag *inputmode_text(); - HTMLTag *inputmode_decimal(); - HTMLTag *inputmode_numeric(); - HTMLTag *inputmode_tel(); - HTMLTag *inputmode_search(); - HTMLTag *inputmode_email(); - HTMLTag *inputmode_url(); - - HTMLTag *attrib(const String &attr, const String &val); - - HTMLTag *start(const String &p_new_tag, const bool p_simple = false); - HTMLTag *reset(); - HTMLTag *close(); - - HTMLBuilder *f(); - - bool has_data(); - - HTMLTag(); - - HTMLBuilder *owner; -}; - -class HTMLBuilder { -public: - String result; - - HTMLBuilder *comment(const String &val); - HTMLTag *doctype(); - HTMLBuilder *doctype(const String &val); - - HTMLTag *a(); - HTMLTag *abbr(); - HTMLTag *acronym(); // Not supported in HTML5. - HTMLTag *address(); - HTMLTag *applet(); // Not supported in HTML5. - HTMLTag *area(); - HTMLTag *article(); - HTMLTag *aside(); - HTMLTag *audio(); - HTMLTag *b(); - HTMLTag *basefont(); // Not supported in HTML5. - HTMLTag *bdi(); - HTMLTag *bdo(); - HTMLTag *big(); // Not supported in HTML5. - HTMLTag *blockquote(); - HTMLTag *body(); - HTMLTag *br(); - HTMLTag *button(); - HTMLTag *canvas(); - HTMLTag *caption(); - HTMLTag *center(); // Not supported in HTML5. - HTMLTag *cite(); - HTMLTag *code(); - HTMLTag *col(); - HTMLTag *colgroup(); - HTMLTag *data(); - HTMLTag *datalist(); - HTMLTag *dd(); - HTMLTag *del(); - HTMLTag *details(); - HTMLTag *dfn(); - HTMLTag *dialog(); - HTMLTag *dir(); // Not supported in HTML5. - HTMLTag *div(); - HTMLTag *dl(); - HTMLTag *dt(); - HTMLTag *em(); - HTMLTag *embed(); - HTMLTag *fieldset(); - HTMLTag *figcaption(); - HTMLTag *figure(); - HTMLTag *font(); // Not supported in HTML5. - HTMLTag *footer(); - HTMLTag *form(); - HTMLTag *frame(); // Not supported in HTML5. - HTMLTag *frameset(); // Not supported in HTML5. - HTMLTag *h1(); - HTMLTag *h2(); - HTMLTag *h3(); - HTMLTag *h4(); - HTMLTag *h5(); - HTMLTag *h6(); - HTMLTag *head(); - HTMLTag *header(); - HTMLTag *hr(); - HTMLTag *html(); - - HTMLTag *i(); - HTMLTag *iframe(); - HTMLTag *img(); - HTMLTag *input(); - HTMLTag *ins(); - HTMLTag *kbd(); - HTMLTag *label(); - HTMLTag *legend(); - HTMLTag *li(); - HTMLTag *link(); - HTMLTag *main(); - HTMLTag *map(); - HTMLTag *mark(); - HTMLTag *meta(); - HTMLTag *meter(); - - HTMLTag *nav(); - HTMLTag *noframes(); // Not supported in HTML5. - HTMLTag *noscript(); - HTMLTag *objectt(); //, Like "object tag". As having a method named object() can cause issues. - HTMLTag *ol(); - HTMLTag *optgroup(); - HTMLTag *option(); - HTMLTag *output(); - HTMLTag *p(); - HTMLTag *param(); - HTMLTag *picture(); - HTMLTag *pre(); - HTMLTag *progress(); - HTMLTag *q(); - HTMLTag *rp(); - - HTMLTag *rt(); - HTMLTag *ruby(); - HTMLTag *s(); - HTMLTag *samp(); - HTMLTag *script(); - HTMLTag *section(); - HTMLTag *select(); - HTMLTag *small(); - HTMLTag *source(); - HTMLTag *span(); - HTMLTag *strike(); // Not supported in HTML5 - HTMLTag *strong(); - HTMLTag *style(); - HTMLTag *sub(); - HTMLTag *summary(); - HTMLTag *sup(); - - HTMLTag *svg(); - HTMLTag *table(); - HTMLTag *tbody(); - HTMLTag *td(); - HTMLTag *templateh(); - HTMLTag *textarea(); - HTMLTag *tfoot(); - HTMLTag *th(); - HTMLTag *thead(); - HTMLTag *time(); - HTMLTag *title(); - HTMLTag *tr(); - HTMLTag *track(); - HTMLTag *tt(); // Not supported in HTML5. - HTMLTag *u(); - HTMLTag *ul(); - HTMLTag *var(); - HTMLTag *video(); - HTMLTag *wbr(); - - HTMLBuilder *a(const String &href, const String &cls = "", const String &id = ""); - HTMLBuilder *fa(const String &href, const String &body, const String &cls = "", const String &id = ""); - - HTMLBuilder *div(const String &cls, const String &id = ""); - HTMLBuilder *fdiv(const String &body, const String &cls = "", const String &id = ""); - - HTMLBuilder *textarea(const String &name, const String &cls = "", const String &id = ""); - HTMLBuilder *ftextarea(const String &name, const String &body, const String &cls = "", const String &id = ""); - - HTMLBuilder *select(const String &name, const String &cls = "", const String &id = ""); - - HTMLTag *option(const String &value); - HTMLBuilder *foption(const String &value, const String &body, const bool selected = false); - - // closing tags c prefix means close - // Note simple tags should not have these like
- // Note that I might have a few that shouldn't be here, those will be removed as I find them - HTMLBuilder *ca(); - HTMLBuilder *cabbr(); - HTMLBuilder *cacronym(); - HTMLBuilder *caddress(); - HTMLBuilder *capplet(); - HTMLBuilder *carea(); - HTMLBuilder *carticle(); - HTMLBuilder *caside(); - HTMLBuilder *caudio(); - HTMLBuilder *cb(); - HTMLBuilder *cbasefont(); - HTMLBuilder *cbdi(); - HTMLBuilder *cbdo(); - HTMLBuilder *cbig(); - HTMLBuilder *cblockquote(); - HTMLBuilder *cbody(); - HTMLBuilder *cbutton(); - HTMLBuilder *ccanvas(); - - HTMLBuilder *ccaption(); - HTMLBuilder *ccenter(); - HTMLBuilder *ccite(); - HTMLBuilder *ccode(); - HTMLBuilder *ccol(); - HTMLBuilder *ccolgroup(); - HTMLBuilder *cdata(); - HTMLBuilder *cdatalist(); - HTMLBuilder *cdd(); - HTMLBuilder *cdel(); - HTMLBuilder *cdetails(); - HTMLBuilder *cdfn(); - HTMLBuilder *cdialog(); - HTMLBuilder *cdir(); - HTMLBuilder *cdiv(); - HTMLBuilder *cdl(); - HTMLBuilder *cdt(); - - HTMLBuilder *cem(); - HTMLBuilder *cembed(); - HTMLBuilder *cfieldset(); - HTMLBuilder *cfigcaption(); - HTMLBuilder *cfigure(); - HTMLBuilder *cfont(); - HTMLBuilder *cfooter(); - HTMLBuilder *cform(); - HTMLBuilder *cframe(); - HTMLBuilder *cframeset(); - HTMLBuilder *ch1(); - HTMLBuilder *ch2(); - HTMLBuilder *ch3(); - HTMLBuilder *ch4(); - HTMLBuilder *ch5(); - HTMLBuilder *ch6(); - HTMLBuilder *chead(); - HTMLBuilder *cheader(); - HTMLBuilder *chr(); - HTMLBuilder *chtml(); - - HTMLBuilder *ci(); - HTMLBuilder *ciframe(); - HTMLBuilder *cimg(); - HTMLBuilder *cinput(); - HTMLBuilder *cins(); - HTMLBuilder *ckbd(); - HTMLBuilder *clabel(); - HTMLBuilder *clegend(); - HTMLBuilder *cli(); - HTMLBuilder *clink(); - HTMLBuilder *cmain(); - HTMLBuilder *cmap(); - HTMLBuilder *cmark(); - HTMLBuilder *cmeta(); - HTMLBuilder *cmeter(); - - HTMLBuilder *cnav(); - HTMLBuilder *cnoframes(); - HTMLBuilder *cnoscript(); - HTMLBuilder *cobjectt(); - HTMLBuilder *c_ol(); - HTMLBuilder *coptgroup(); - HTMLBuilder *coption(); - HTMLBuilder *coutput(); - HTMLBuilder *cp(); - HTMLBuilder *cparam(); - HTMLBuilder *cpicture(); - HTMLBuilder *cpre(); - HTMLBuilder *cprogress(); - HTMLBuilder *cq(); - HTMLBuilder *crp(); - - HTMLBuilder *crt(); - HTMLBuilder *cruby(); - HTMLBuilder *cs(); - HTMLBuilder *csamp(); - HTMLBuilder *cscript(); - HTMLBuilder *csection(); - HTMLBuilder *cselect(); - HTMLBuilder *csmall(); - HTMLBuilder *csource(); - HTMLBuilder *cspan(); - HTMLBuilder *cstrike(); - HTMLBuilder *cstrong(); - HTMLBuilder *cstyle(); - HTMLBuilder *csub(); - HTMLBuilder *csummary(); - HTMLBuilder *csup(); - - HTMLBuilder *csvg(); - HTMLBuilder *ctable(); - HTMLBuilder *ctbody(); - HTMLBuilder *ctd(); - HTMLBuilder *ctemplateh(); - HTMLBuilder *ctextarea(); - HTMLBuilder *ctfoot(); - HTMLBuilder *cth(); - HTMLBuilder *cthead(); - HTMLBuilder *ctime(); - HTMLBuilder *ctitle(); - HTMLBuilder *ctr(); - HTMLBuilder *ctrack(); - HTMLBuilder *ctt(); - HTMLBuilder *cu(); - HTMLBuilder *cul(); - HTMLBuilder *cvar(); - HTMLBuilder *cvideo(); - HTMLBuilder *cwbr(); - - HTMLTag *form_get(); - HTMLTag *form_post(); - HTMLBuilder *form_get(const String &action, const String &cls = "", const String &id = ""); - HTMLBuilder *form_post(const String &action, const String &cls = "", const String &id = ""); - // will add a csrf token from request - HTMLBuilder *form_postr(const String &action, Ref request, const String &cls = "", const String &id = ""); - - HTMLTag *input_button(); - HTMLTag *input_checkbox(); - HTMLTag *input_color(); - HTMLTag *input_date(); - HTMLTag *input_datetime_local(); - HTMLTag *input_email(); - HTMLTag *input_file(); - HTMLTag *input_hidden(); - HTMLTag *input_image(); - HTMLTag *input_month(); - HTMLTag *input_number(); - HTMLTag *input_password(); - HTMLTag *input_radio(); - HTMLTag *input_range(); - HTMLTag *input_reset(); - HTMLTag *input_search(); - HTMLTag *input_submit(); - HTMLTag *input_tel(); - HTMLTag *input_text(); - HTMLTag *input_time(); - HTMLTag *input_url(); - HTMLTag *input_week(); - - HTMLBuilder *label(const String &pfor, const String &plabel, const String &cls = "", const String &id = ""); - - HTMLBuilder *input_button(const String &name, const String &value = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_checkbox(const String &name, const String &value = "", const bool checked = false, const String &cls = "", const String &id = ""); - HTMLBuilder *input_color(const String &name, const String &value = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_date(const String &name, const String &value = "", const String &cls = "", const String &id = "", const String &date_min = "", const String &date_max = "", const String &date_step = ""); - HTMLBuilder *input_datetime_local(const String &name, const String &value = "", const String &cls = "", const String &id = "", const String &date_min = "", const String &date_max = "", const String &date_step = ""); - HTMLBuilder *input_email(const String &name, const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_file(const String &name, const String &accept = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_image(const String &name, const String &src = "", const String &alt = "", const String &cls = "", const String &id = "", const int width = 0, const int height = 0); - HTMLBuilder *input_month(const String &name, const String &cls = "", const String &id = ""); - HTMLBuilder *input_number(const String &name, const String & = "", const String & = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_password(const String &name, const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = ""); - HTMLBuilder *input_radio(const String &name, const String &value = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_range(const String &name, const String &value = "", const String &vmin = "", const String &vmax = "", const String &vstep = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_reset(const String &name, const String &value = "", const String &cls = "", const String &id = ""); - HTMLBuilder *input_search(const String &name, const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = "", const String &pattern = ""); - HTMLBuilder *input_submit(const String &value, const String &cls = "", const String &id = ""); - HTMLBuilder *input_tel(const String &name, const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = "", const String &pattern = ""); - HTMLBuilder *input_text(const String &name, const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = ""); - HTMLBuilder *input_time(const String &name, const String &cls = "", const String &id = "", const String &vmin = "", const String &vmax = "", const String &vstep = ""); - HTMLBuilder *input_url(const String &name, const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = ""); - HTMLBuilder *input_week(const String &name, const String &cls = "", const String &id = "", const String &vmin = "", const String &vmax = ""); - HTMLBuilder *input_hidden(const String &name, const String &value); - - HTMLBuilder *csrf_token(const String &token); - HTMLBuilder *csrf_tokenr(Ref request); - - HTMLTag *tag(const String &p_tag, const bool p_simple = false); - HTMLBuilder *ctag(const String &p_tag); - - void f(); - - // write - HTMLBuilder *w(const String &val); - - HTMLBuilder *wn(const double val, int p_decimals = -1); - HTMLBuilder *wns(const double val); - HTMLBuilder *wr(const double val, const bool p_trailing = true); - HTMLBuilder *wi(const int64_t val, const int base = 10, const bool capitalize_hex = false); - HTMLBuilder *wui(const uint64_t val, const int base = 10, const bool capitalize_hex = false); - HTMLBuilder *wbn(const bool val); - HTMLBuilder *wbs(const bool val); - - // write_escaped - HTMLBuilder *we(const String &val); - - HTMLBuilder *write_tag(); - - HTMLBuilder(); - virtual ~HTMLBuilder(); - -protected: - HTMLTag _tag; -}; - -#endif diff --git a/modules/web/html/html_builder_bind.cpp b/modules/web/html/html_builder_bind.cpp deleted file mode 100644 index 0d082cb..0000000 --- a/modules/web/html/html_builder_bind.cpp +++ /dev/null @@ -1,3984 +0,0 @@ -#include "html_builder_bind.h" -#include "core/string/print_string.h" -#include "core/string/ustring.h" - -#include "core/object/method_bind_ext.gen.inc" - -#include "../http/web_server_request.h" - -bool _HTMLTag::get_simple() const { - return simple; -} -void _HTMLTag::set_simple(const bool val) { - simple = val; -} - -String _HTMLTag::get_result() { - return result; -} -void _HTMLTag::set_result(const String &str) { - result = str; -} - -Ref<_HTMLTag> _HTMLTag::str(const String &str) { - result += " " + str; - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::style(const String &val) { - attrib("style", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::href(const String &val) { - attrib("href", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::cls(const String &val) { - attrib("class", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::clsse(const String &val) { - if (val == "") { - return Ref<_HTMLTag>(this); - } - - attrib("class", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::id(const String &val) { - attrib("id", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::name(const String &val) { - attrib("name", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::content(const String &val) { - attrib("content", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::value(const String &val) { - attrib("value", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::accept(const String &val) { - attrib("accept", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::src(const String &val) { - attrib("src", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::alt(const String &val) { - attrib("alt", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rows(const String &val) { - attrib("rows", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::cols(const String &val) { - attrib("cols", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::enctype(const String &val) { - attrib("enctype", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::enctype_multipart_form_data() { - attrib("enctype", "multipart/form-data"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::autocomplete(const String &val) { - attrib("autocomplete", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::autocomplete_off() { - attrib("autocomplete", "off"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_on() { - attrib("autocomplete", "on"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name() { - attrib("autocomplete", "name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name_honorific_prefix() { - attrib("autocomplete", "honorific-prefix"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name_given_name() { - attrib("autocomplete", "given-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name_additional_name() { - attrib("autocomplete", "additional-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name_family_name() { - attrib("autocomplete", "family-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name_honorific_suffix() { - attrib("autocomplete", "honorific-suffix"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_name_nickname() { - attrib("autocomplete", "nickname"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_email() { - attrib("autocomplete", "email"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_username() { - attrib("autocomplete", "username"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_new_password() { - attrib("autocomplete", "new-password"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_current_password() { - attrib("autocomplete", "current-password"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_one_time_code() { - attrib("autocomplete", "one-time-code"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_organization_title() { - attrib("autocomplete", "organization-title"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_organization() { - attrib("autocomplete", "organization"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_street_address() { - attrib("autocomplete", "street-address"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_line1() { - attrib("autocomplete", "address-line1"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_line2() { - attrib("autocomplete", "address-line2"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_line3() { - attrib("autocomplete", "address-line3"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_level_1() { - attrib("autocomplete", "address-level1"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_level_2() { - attrib("autocomplete", "address-level2"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_level_3() { - attrib("autocomplete", "address-level3"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_address_level_4() { - attrib("autocomplete", "address-level4"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_country() { - attrib("autocomplete", "country"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_country_name() { - attrib("autocomplete", "country-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_postal_code() { - attrib("autocomplete", "postal-code"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_name() { - attrib("autocomplete", "cc-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_given_name() { - attrib("autocomplete", "cc-given-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_additional_name() { - attrib("autocomplete", "cc-additional-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_family_name() { - attrib("autocomplete", "cc-family-name"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_number() { - attrib("autocomplete", "cc-number"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_exp() { - attrib("autocomplete", "cc-exp"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_exp_month() { - attrib("autocomplete", "cc-exp-month"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_exp_year() { - attrib("autocomplete", "cc-exp-year"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_csc() { - attrib("autocomplete", "cc-csc"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_cc_type() { - attrib("autocomplete", "cc-type"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_transaction_currency() { - attrib("autocomplete", "transaction-currency"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_transaction_amount() { - attrib("autocomplete", "transaction-amount"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_language() { - attrib("autocomplete", "language"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_bday() { - attrib("autocomplete", "bday"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_bday_day() { - attrib("autocomplete", "bday-day"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_bday_month() { - attrib("autocomplete", "bday-month"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_bday_year() { - attrib("autocomplete", "bday-year"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_sex() { - attrib("autocomplete", "sex"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_tel() { - attrib("autocomplete", "tel"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_tel_country_code() { - attrib("autocomplete", "tel-country-code"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_tel_national() { - attrib("autocomplete", "tel-national"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_tel_area_code() { - attrib("autocomplete", "tel-area-code"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_tel_local() { - attrib("autocomplete", "tel-local"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_tel_extension() { - attrib("autocomplete", "tel-extension"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_impp() { - attrib("autocomplete", "impp"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_url() { - attrib("autocomplete", "url"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::autocomplete_photo() { - attrib("autocomplete", "photo"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::onclick(const String &val) { - attrib("onclick", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::inputmode(const String &val) { - attrib("inputmode", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::list(const String &val) { - attrib("list", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::checked(const bool val) { - if (val) { - result += " checked"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::selected(const bool val) { - if (val) { - result += " selected"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::autofocus(const bool val) { - if (val) { - result += " autofocus"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::disabled(const bool val) { - if (val) { - result += " disabled"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::multiple(const bool val) { - if (val) { - result += " multiple"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::required(const bool val) { - if (val) { - result += " required"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::spellcheck(const bool val) { - if (val) { - attrib("spellcheck", "true"); - } else { - attrib("spellcheck", "false"); - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::max(const String &val) { - attrib("max", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::min(const String &val) { - attrib("min", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::step(const String &val) { - attrib("step", val); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::step_any() { - attrib("step", "any"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::minlength(const int val) { - attrib("minlength", String::num(val)); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::minlengths(const String &val) { - attrib("minlength", val); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::maxlength(const int val) { - attrib("maxlength", String::num(val)); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::maxlengths(const String &val) { - attrib("maxlength", val); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::size(const int val) { - attrib("size", String::num(val)); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::sizes(const String &val) { - attrib("size", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::width(const int val) { - attrib("width", String::num(val)); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::widths(const String &val) { - attrib("width", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::height(const int val) { - attrib("height", String::num(val)); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::heights(const String &val) { - attrib("height", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::pattern(const String &val) { - attrib("pattern", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::method(const String &val) { - attrib("method", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::method_get() { - attrib("method", "get"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::method_post() { - attrib("method", "post"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::action(const String &val) { - attrib("action", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::type(const String &val) { - attrib("type", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::placeholder(const String &val) { - attrib("placeholder", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::fora(const String &val) { - attrib("for", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel(const String &val) { - attrib("rel", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_stylesheet() { - attrib("rel", "stylesheet"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_alternate() { - attrib("rel", "alternate"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_author() { - attrib("rel", "author"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_bookmark() { - attrib("rel", "bookmark"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_external() { - attrib("rel", "external"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_help() { - attrib("rel", "help"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_license() { - attrib("rel", "license"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_next() { - attrib("rel", "next"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_nofollow() { - attrib("rel", "nofollow"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_noopener() { - attrib("rel", "noopener"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_noreferrer() { - attrib("rel", "noreferrer"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_prev() { - attrib("rel", "prev"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_search() { - attrib("rel", "search"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::rel_tag() { - attrib("rel", "_tag"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::charset(const String &val) { - attrib("charset", val); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::charset_utf_8() { - attrib("charset", "utf-8"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::itbutton() { - attrib("type", "button"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itcheckbox() { - attrib("type", "checkbox"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itcolor() { - attrib("type", "color"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itdate() { - attrib("type", "date"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itdatetime_local() { - attrib("type", "datetime_local"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itemail() { - attrib("type", "email"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itfile() { - attrib("type", "file"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::ithidden() { - attrib("type", "hidden"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itimage() { - attrib("type", "image"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itmonth() { - attrib("type", "month"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itnumber() { - attrib("type", "number"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itpassword() { - attrib("type", "password"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itradio() { - attrib("type", "radio"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itrange() { - attrib("type", "range"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itreset() { - attrib("type", "reset"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itsearch() { - attrib("type", "search"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itsubmit() { - attrib("type", "submit"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::ittel() { - attrib("type", "tel"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::ittext() { - attrib("type", "text"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::ittime() { - attrib("type", "time"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::iturl() { - attrib("type", "url"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::itweek() { - attrib("type", "week"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::inputmode_none() { - attrib("inputmode", "none"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_text() { - attrib("inputmode", "text"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_decimal() { - attrib("inputmode", "decimal"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_numeric() { - attrib("inputmode", "numeric"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_tel() { - attrib("inputmode", "tel"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_search() { - attrib("inputmode", "search"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_email() { - attrib("inputmode", "email"); - - return Ref<_HTMLTag>(this); -} -Ref<_HTMLTag> _HTMLTag::inputmode_url() { - attrib("inputmode", "url"); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::attrib(const String &attr, const String &val) { - result += " " + attr + "=\"" + val + "\""; - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::start(const String &p_tag, const bool p_simple) { - simple = p_simple; - - result = "<" + p_tag; - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::reset() { - result.clear(); - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLTag> _HTMLTag::close() { - if (simple) { - result += "/>"; - } else { - result += ">"; - } - - return Ref<_HTMLTag>(this); -} - -Ref<_HTMLBuilder> _HTMLTag::f() { - return Ref<_HTMLBuilder>(owner); -} - -bool _HTMLTag::has_data() { - return result.length() > 0; -} - -_HTMLTag::_HTMLTag() { - simple = true; -} - -void _HTMLTag::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_simple"), &_HTMLTag::get_simple); - ClassDB::bind_method(D_METHOD("set_simple", "val"), &_HTMLTag::set_simple); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "simple"), "set_simple", "get_simple"); - - ClassDB::bind_method(D_METHOD("get_result"), &_HTMLTag::get_result); - ClassDB::bind_method(D_METHOD("set_result", "val"), &_HTMLTag::set_result); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "result"), "set_result", "get_result"); - - ClassDB::bind_method(D_METHOD("str", "srt"), &_HTMLTag::str); - ClassDB::bind_method(D_METHOD("style", "val"), &_HTMLTag::style); - ClassDB::bind_method(D_METHOD("href", "val"), &_HTMLTag::href); - ClassDB::bind_method(D_METHOD("cls", "val"), &_HTMLTag::cls); - ClassDB::bind_method(D_METHOD("clsse", "val"), &_HTMLTag::clsse); - ClassDB::bind_method(D_METHOD("id", "val"), &_HTMLTag::id); - ClassDB::bind_method(D_METHOD("name", "val"), &_HTMLTag::name); - ClassDB::bind_method(D_METHOD("content", "val"), &_HTMLTag::content); - ClassDB::bind_method(D_METHOD("value", "val"), &_HTMLTag::value); - ClassDB::bind_method(D_METHOD("accept", "val"), &_HTMLTag::accept); - ClassDB::bind_method(D_METHOD("src", "val"), &_HTMLTag::src); - ClassDB::bind_method(D_METHOD("alt", "val"), &_HTMLTag::alt); - ClassDB::bind_method(D_METHOD("inputmode", "val"), &_HTMLTag::inputmode); - ClassDB::bind_method(D_METHOD("list", "val"), &_HTMLTag::list); - - ClassDB::bind_method(D_METHOD("rows", "val"), &_HTMLTag::rows); - ClassDB::bind_method(D_METHOD("cols", "val"), &_HTMLTag::cols); - - ClassDB::bind_method(D_METHOD("enctype", "val"), &_HTMLTag::enctype); - ClassDB::bind_method(D_METHOD("enctype_multipart_form_data"), &_HTMLTag::enctype_multipart_form_data); - - ClassDB::bind_method(D_METHOD("autocomplete", "val"), &_HTMLTag::autocomplete); - - ClassDB::bind_method(D_METHOD("autocomplete_off"), &_HTMLTag::autocomplete_off); - ClassDB::bind_method(D_METHOD("autocomplete_on"), &_HTMLTag::autocomplete_on); - ClassDB::bind_method(D_METHOD("autocomplete_name"), &_HTMLTag::autocomplete_name); - ClassDB::bind_method(D_METHOD("autocomplete_name_honorific_prefix"), &_HTMLTag::autocomplete_name_honorific_prefix); - ClassDB::bind_method(D_METHOD("autocomplete_name_given_name"), &_HTMLTag::autocomplete_name_given_name); - ClassDB::bind_method(D_METHOD("autocomplete_name_additional_name"), &_HTMLTag::autocomplete_name_additional_name); - ClassDB::bind_method(D_METHOD("autocomplete_name_family_name"), &_HTMLTag::autocomplete_name_family_name); - ClassDB::bind_method(D_METHOD("autocomplete_name_honorific_suffix"), &_HTMLTag::autocomplete_name_honorific_suffix); - ClassDB::bind_method(D_METHOD("autocomplete_name_nickname"), &_HTMLTag::autocomplete_name_nickname); - ClassDB::bind_method(D_METHOD("autocomplete_email"), &_HTMLTag::autocomplete_email); - - ClassDB::bind_method(D_METHOD("autocomplete_username"), &_HTMLTag::autocomplete_username); - ClassDB::bind_method(D_METHOD("autocomplete_new_password"), &_HTMLTag::autocomplete_new_password); - ClassDB::bind_method(D_METHOD("autocomplete_current_password"), &_HTMLTag::autocomplete_current_password); - ClassDB::bind_method(D_METHOD("autocomplete_one_time_code"), &_HTMLTag::autocomplete_one_time_code); - ClassDB::bind_method(D_METHOD("autocomplete_organization_title"), &_HTMLTag::autocomplete_organization_title); - ClassDB::bind_method(D_METHOD("autocomplete_organization"), &_HTMLTag::autocomplete_organization); - ClassDB::bind_method(D_METHOD("autocomplete_street_address"), &_HTMLTag::autocomplete_street_address); - ClassDB::bind_method(D_METHOD("autocomplete_address_line1"), &_HTMLTag::autocomplete_address_line1); - ClassDB::bind_method(D_METHOD("autocomplete_address_line2"), &_HTMLTag::autocomplete_address_line2); - ClassDB::bind_method(D_METHOD("autocomplete_address_line3"), &_HTMLTag::autocomplete_address_line3); - ClassDB::bind_method(D_METHOD("autocomplete_address_level_1"), &_HTMLTag::autocomplete_address_level_1); - ClassDB::bind_method(D_METHOD("autocomplete_address_level_2"), &_HTMLTag::autocomplete_address_level_2); - ClassDB::bind_method(D_METHOD("autocomplete_address_level_3"), &_HTMLTag::autocomplete_address_level_3); - ClassDB::bind_method(D_METHOD("autocomplete_address_level_4"), &_HTMLTag::autocomplete_address_level_4); - - ClassDB::bind_method(D_METHOD("autocomplete_country"), &_HTMLTag::autocomplete_country); - ClassDB::bind_method(D_METHOD("autocomplete_country_name"), &_HTMLTag::autocomplete_country_name); - ClassDB::bind_method(D_METHOD("autocomplete_postal_code"), &_HTMLTag::autocomplete_postal_code); - ClassDB::bind_method(D_METHOD("autocomplete_cc_name"), &_HTMLTag::autocomplete_cc_name); - ClassDB::bind_method(D_METHOD("autocomplete_cc_given_name"), &_HTMLTag::autocomplete_cc_given_name); - ClassDB::bind_method(D_METHOD("autocomplete_cc_additional_name"), &_HTMLTag::autocomplete_cc_additional_name); - - ClassDB::bind_method(D_METHOD("autocomplete_cc_family_name"), &_HTMLTag::autocomplete_cc_family_name); - ClassDB::bind_method(D_METHOD("autocomplete_cc_number"), &_HTMLTag::autocomplete_cc_number); - ClassDB::bind_method(D_METHOD("autocomplete_cc_exp"), &_HTMLTag::autocomplete_cc_exp); - ClassDB::bind_method(D_METHOD("autocomplete_cc_exp_month"), &_HTMLTag::autocomplete_cc_exp_month); - ClassDB::bind_method(D_METHOD("autocomplete_cc_exp_year"), &_HTMLTag::autocomplete_cc_exp_year); - - ClassDB::bind_method(D_METHOD("autocomplete_cc_csc"), &_HTMLTag::autocomplete_cc_csc); - ClassDB::bind_method(D_METHOD("autocomplete_cc_type"), &_HTMLTag::autocomplete_cc_type); - ClassDB::bind_method(D_METHOD("autocomplete_transaction_currency"), &_HTMLTag::autocomplete_transaction_currency); - ClassDB::bind_method(D_METHOD("autocomplete_transaction_amount"), &_HTMLTag::autocomplete_transaction_amount); - - ClassDB::bind_method(D_METHOD("autocomplete_language"), &_HTMLTag::autocomplete_language); - ClassDB::bind_method(D_METHOD("autocomplete_bday"), &_HTMLTag::autocomplete_bday); - ClassDB::bind_method(D_METHOD("autocomplete_bday_day"), &_HTMLTag::autocomplete_bday_day); - ClassDB::bind_method(D_METHOD("autocomplete_bday_month"), &_HTMLTag::autocomplete_bday_month); - - ClassDB::bind_method(D_METHOD("autocomplete_bday_year"), &_HTMLTag::autocomplete_bday_year); - ClassDB::bind_method(D_METHOD("autocomplete_sex"), &_HTMLTag::autocomplete_sex); - ClassDB::bind_method(D_METHOD("autocomplete_tel"), &_HTMLTag::autocomplete_tel); - ClassDB::bind_method(D_METHOD("autocomplete_tel_country_code"), &_HTMLTag::autocomplete_tel_country_code); - ClassDB::bind_method(D_METHOD("autocomplete_tel_national"), &_HTMLTag::autocomplete_tel_national); - - ClassDB::bind_method(D_METHOD("autocomplete_tel_area_code"), &_HTMLTag::autocomplete_tel_area_code); - ClassDB::bind_method(D_METHOD("autocomplete_tel_local"), &_HTMLTag::autocomplete_tel_local); - ClassDB::bind_method(D_METHOD("autocomplete_tel_extension"), &_HTMLTag::autocomplete_tel_extension); - ClassDB::bind_method(D_METHOD("autocomplete_impp"), &_HTMLTag::autocomplete_impp); - ClassDB::bind_method(D_METHOD("autocomplete_url"), &_HTMLTag::autocomplete_url); - ClassDB::bind_method(D_METHOD("autocomplete_photo"), &_HTMLTag::autocomplete_photo); - - ClassDB::bind_method(D_METHOD("onclick", "val"), &_HTMLTag::onclick); - - ClassDB::bind_method(D_METHOD("checked", "val"), &_HTMLTag::checked, true); - ClassDB::bind_method(D_METHOD("selected", "val"), &_HTMLTag::selected, true); - ClassDB::bind_method(D_METHOD("autofocus", "val"), &_HTMLTag::autofocus, true); - ClassDB::bind_method(D_METHOD("disabled", "val"), &_HTMLTag::disabled, true); - ClassDB::bind_method(D_METHOD("multiple", "val"), &_HTMLTag::multiple, true); - ClassDB::bind_method(D_METHOD("required", "val"), &_HTMLTag::required, true); - ClassDB::bind_method(D_METHOD("spellcheck", "val"), &_HTMLTag::spellcheck, true); - - ClassDB::bind_method(D_METHOD("max", "val"), &_HTMLTag::max); - ClassDB::bind_method(D_METHOD("min", "val"), &_HTMLTag::min); - ClassDB::bind_method(D_METHOD("step", "val"), &_HTMLTag::step); - - ClassDB::bind_method(D_METHOD("step_any"), &_HTMLTag::step_any); - - ClassDB::bind_method(D_METHOD("minlength", "val"), &_HTMLTag::minlength); - ClassDB::bind_method(D_METHOD("minlengths", "val"), &_HTMLTag::minlengths); - ClassDB::bind_method(D_METHOD("maxlength", "val"), &_HTMLTag::maxlength); - ClassDB::bind_method(D_METHOD("maxlengths", "val"), &_HTMLTag::maxlengths); - ClassDB::bind_method(D_METHOD("size", "val"), &_HTMLTag::size); - ClassDB::bind_method(D_METHOD("sizes", "val"), &_HTMLTag::sizes); - - ClassDB::bind_method(D_METHOD("width", "val"), &_HTMLTag::width); - ClassDB::bind_method(D_METHOD("widths", "val"), &_HTMLTag::widths); - ClassDB::bind_method(D_METHOD("height", "val"), &_HTMLTag::height); - ClassDB::bind_method(D_METHOD("heights", "val"), &_HTMLTag::heights); - - ClassDB::bind_method(D_METHOD("pattern", "val"), &_HTMLTag::pattern); - - ClassDB::bind_method(D_METHOD("method", "val"), &_HTMLTag::method); - - ClassDB::bind_method(D_METHOD("method_get"), &_HTMLTag::method_get); - ClassDB::bind_method(D_METHOD("method_post"), &_HTMLTag::method_post); - - ClassDB::bind_method(D_METHOD("action", "val"), &_HTMLTag::action); - ClassDB::bind_method(D_METHOD("type", "val"), &_HTMLTag::type); - ClassDB::bind_method(D_METHOD("placeholder", "val"), &_HTMLTag::placeholder); - ClassDB::bind_method(D_METHOD("fora", "val"), &_HTMLTag::fora); - - ClassDB::bind_method(D_METHOD("rel", "val"), &_HTMLTag::rel); - - ClassDB::bind_method(D_METHOD("rel_stylesheet"), &_HTMLTag::rel_stylesheet); - ClassDB::bind_method(D_METHOD("rel_alternate"), &_HTMLTag::rel_alternate); - ClassDB::bind_method(D_METHOD("rel_author"), &_HTMLTag::rel_author); - ClassDB::bind_method(D_METHOD("rel_bookmark"), &_HTMLTag::rel_bookmark); - ClassDB::bind_method(D_METHOD("rel_external"), &_HTMLTag::rel_external); - ClassDB::bind_method(D_METHOD("rel_help"), &_HTMLTag::rel_help); - ClassDB::bind_method(D_METHOD("rel_license"), &_HTMLTag::rel_license); - - ClassDB::bind_method(D_METHOD("rel_next"), &_HTMLTag::rel_next); - ClassDB::bind_method(D_METHOD("rel_nofollow"), &_HTMLTag::rel_nofollow); - ClassDB::bind_method(D_METHOD("rel_noopener"), &_HTMLTag::rel_noopener); - ClassDB::bind_method(D_METHOD("rel_noreferrer"), &_HTMLTag::rel_noreferrer); - ClassDB::bind_method(D_METHOD("rel_prev"), &_HTMLTag::rel_prev); - ClassDB::bind_method(D_METHOD("rel_search"), &_HTMLTag::rel_search); - ClassDB::bind_method(D_METHOD("rel_tag"), &_HTMLTag::rel_tag); - - ClassDB::bind_method(D_METHOD("charset", "val"), &_HTMLTag::charset); - ClassDB::bind_method(D_METHOD("charset_utf_8"), &_HTMLTag::charset_utf_8); - - ClassDB::bind_method(D_METHOD("itbutton"), &_HTMLTag::itbutton); - ClassDB::bind_method(D_METHOD("itcheckbox"), &_HTMLTag::itcheckbox); - ClassDB::bind_method(D_METHOD("itcolor"), &_HTMLTag::itcolor); - ClassDB::bind_method(D_METHOD("itdate"), &_HTMLTag::itdate); - ClassDB::bind_method(D_METHOD("itdatetime_local"), &_HTMLTag::itdatetime_local); - ClassDB::bind_method(D_METHOD("itemail"), &_HTMLTag::itemail); - ClassDB::bind_method(D_METHOD("itfile"), &_HTMLTag::itfile); - ClassDB::bind_method(D_METHOD("ithidden"), &_HTMLTag::ithidden); - ClassDB::bind_method(D_METHOD("itimage"), &_HTMLTag::itimage); - - ClassDB::bind_method(D_METHOD("itmonth"), &_HTMLTag::itmonth); - ClassDB::bind_method(D_METHOD("itnumber"), &_HTMLTag::itnumber); - ClassDB::bind_method(D_METHOD("itpassword"), &_HTMLTag::itpassword); - ClassDB::bind_method(D_METHOD("itradio"), &_HTMLTag::itradio); - ClassDB::bind_method(D_METHOD("itrange"), &_HTMLTag::itrange); - - ClassDB::bind_method(D_METHOD("itreset"), &_HTMLTag::itreset); - ClassDB::bind_method(D_METHOD("itsearch"), &_HTMLTag::itsearch); - ClassDB::bind_method(D_METHOD("itsubmit"), &_HTMLTag::itsubmit); - ClassDB::bind_method(D_METHOD("ittel"), &_HTMLTag::ittel); - ClassDB::bind_method(D_METHOD("ittext"), &_HTMLTag::ittext); - - ClassDB::bind_method(D_METHOD("ittime"), &_HTMLTag::ittime); - ClassDB::bind_method(D_METHOD("iturl"), &_HTMLTag::iturl); - ClassDB::bind_method(D_METHOD("itweek"), &_HTMLTag::itweek); - - ClassDB::bind_method(D_METHOD("inputmode_none"), &_HTMLTag::inputmode_none); - ClassDB::bind_method(D_METHOD("inputmode_text"), &_HTMLTag::inputmode_text); - ClassDB::bind_method(D_METHOD("inputmode_decimal"), &_HTMLTag::inputmode_decimal); - ClassDB::bind_method(D_METHOD("inputmode_numeric"), &_HTMLTag::inputmode_numeric); - ClassDB::bind_method(D_METHOD("inputmode_tel"), &_HTMLTag::inputmode_tel); - ClassDB::bind_method(D_METHOD("inputmode_search"), &_HTMLTag::inputmode_search); - ClassDB::bind_method(D_METHOD("inputmode_email"), &_HTMLTag::inputmode_email); - ClassDB::bind_method(D_METHOD("inputmode_url"), &_HTMLTag::inputmode_url); - - ClassDB::bind_method(D_METHOD("attrib", "attr", "val"), &_HTMLTag::attrib); - - ClassDB::bind_method(D_METHOD("start", "new_tag", "simple"), &_HTMLTag::start, false); - - ClassDB::bind_method(D_METHOD("reset"), &_HTMLTag::reset); - ClassDB::bind_method(D_METHOD("close"), &_HTMLTag::close); - - ClassDB::bind_method(D_METHOD("f"), &_HTMLTag::f); - - ClassDB::bind_method(D_METHOD("has_data"), &_HTMLTag::has_data); -} - -String _HTMLBuilder::get_result() { - return result; -} -void _HTMLBuilder::set_result(const String &str) { - result = str; -} - -Ref<_HTMLBuilder> _HTMLBuilder::comment(const String &val) { - write_tag(); - - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::doctype(const String &val) { - write_tag(); - - return _tag->start("!DOCTYPE"); -} - -Ref<_HTMLTag> _HTMLBuilder::a(const String &href, const String &cls, const String &id) { - write_tag(); - - _tag->start("a"); - - if (href != "") { - _tag->href(href); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLBuilder> _HTMLBuilder::fa(const String &href, const String &body, const String &cls, const String &id) { - a(href, cls, id); - w(body); - ca(); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::abbr() { - write_tag(); - - return _tag->start("abbr"); -} - -Ref<_HTMLTag> _HTMLBuilder::acronym() { // Not supported in HTML5. Use instead. Defines an acronym - write_tag(); - - return _tag->start("acronym"); -} - -Ref<_HTMLTag> _HTMLBuilder::address() { - write_tag(); - - return _tag->start("address"); -} - -Ref<_HTMLTag> _HTMLBuilder::applet() { // Not supported in HTML5. Use or instead. Defines an embedded applet - write_tag(); - - return _tag->start("applet"); -} - -Ref<_HTMLTag> _HTMLBuilder::area() { - write_tag(); - - return _tag->start("area"); -} - -Ref<_HTMLTag> _HTMLBuilder::article() { - write_tag(); - - return _tag->start("article"); -} - -Ref<_HTMLTag> _HTMLBuilder::aside() { - write_tag(); - - return _tag->start("aside"); -} - -Ref<_HTMLTag> _HTMLBuilder::audio() { - write_tag(); - - return _tag->start("audio"); -} - -Ref<_HTMLTag> _HTMLBuilder::b() { - write_tag(); - - return _tag->start("b"); -} - -Ref<_HTMLTag> _HTMLBuilder::basefont() { // Not supported in HTML5. Use CSS instead. Specifies a default color, size, and font for all text in a document - write_tag(); - - return _tag->start("basefont"); -} - -Ref<_HTMLTag> _HTMLBuilder::bdi() { - write_tag(); - - return _tag->start("bdi"); -} - -Ref<_HTMLTag> _HTMLBuilder::bdo() { - write_tag(); - - return _tag->start("bdo"); -} - -Ref<_HTMLTag> _HTMLBuilder::big() { // Not supported in HTML5. Use CSS instead. Defines big text - write_tag(); - - return _tag->start("big"); -} - -Ref<_HTMLTag> _HTMLBuilder::blockquote() { - write_tag(); - - return _tag->start("blockquote"); -} - -Ref<_HTMLTag> _HTMLBuilder::body() { - write_tag(); - - return _tag->start("body"); -} - -Ref<_HTMLTag> _HTMLBuilder::br() { - write_tag(); - - return _tag->start("br", true); -} - -Ref<_HTMLTag> _HTMLBuilder::button() { - write_tag(); - - return _tag->start("button"); -} - -Ref<_HTMLTag> _HTMLBuilder::canvas() { - write_tag(); - - return _tag->start("canvas"); -} - -Ref<_HTMLTag> _HTMLBuilder::caption() { - write_tag(); - - return _tag->start("caption"); -} - -Ref<_HTMLTag> _HTMLBuilder::center() { // Not supported in HTML5. Use CSS instead. Defines centered text - write_tag(); - - return _tag->start("center"); -} - -Ref<_HTMLTag> _HTMLBuilder::cite() { - write_tag(); - - return _tag->start("cite"); -} - -Ref<_HTMLTag> _HTMLBuilder::code() { - write_tag(); - - return _tag->start("code"); -} - -Ref<_HTMLTag> _HTMLBuilder::col() { - write_tag(); - - return _tag->start("col"); -} - -Ref<_HTMLTag> _HTMLBuilder::colgroup() { - write_tag(); - - return _tag->start("colgroup"); -} - -Ref<_HTMLTag> _HTMLBuilder::data() { - write_tag(); - - return _tag->start("cite"); -} - -Ref<_HTMLTag> _HTMLBuilder::datalist() { - write_tag(); - - return _tag->start("datalist"); -} - -Ref<_HTMLTag> _HTMLBuilder::dd() { - write_tag(); - - return _tag->start("dd"); -} - -Ref<_HTMLTag> _HTMLBuilder::del() { - write_tag(); - - return _tag->start("del"); -} - -Ref<_HTMLTag> _HTMLBuilder::details() { - write_tag(); - - return _tag->start("details"); -} - -Ref<_HTMLTag> _HTMLBuilder::dfn() { - write_tag(); - - return _tag->start("dfn"); -} - -Ref<_HTMLTag> _HTMLBuilder::dialog() { - write_tag(); - - return _tag->start("dialog"); -} - -Ref<_HTMLTag> _HTMLBuilder::dir() { // Not supported in HTML5. Use
    instead. - write_tag(); - - return _tag->start("dir"); -} - -Ref<_HTMLTag> _HTMLBuilder::div(const String &cls, const String &id) { - write_tag(); - - _tag->start("div"); - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLBuilder> _HTMLBuilder::fdiv(const String &body, const String &cls, const String &id) { - div(cls, id); - w(body); - cdiv(); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::dl() { - write_tag(); - - return _tag->start("dl"); -} - -Ref<_HTMLTag> _HTMLBuilder::dt() { - write_tag(); - - return _tag->start("dt"); -} - -Ref<_HTMLTag> _HTMLBuilder::em() { - write_tag(); - - return _tag->start("em"); -} - -Ref<_HTMLTag> _HTMLBuilder::embed() { - write_tag(); - - return _tag->start("embed"); -} - -Ref<_HTMLTag> _HTMLBuilder::fieldset() { - write_tag(); - - return _tag->start("fieldset"); -} -Ref<_HTMLTag> _HTMLBuilder::figcaption() { - write_tag(); - - return _tag->start("figcaption"); -} - -Ref<_HTMLTag> _HTMLBuilder::figure() { - write_tag(); - - return _tag->start("figure"); -} - -Ref<_HTMLTag> _HTMLBuilder::font() { // Not supported in HTML5. - write_tag(); - - return _tag->start("font"); -} - -Ref<_HTMLTag> _HTMLBuilder::footer() { - write_tag(); - - return _tag->start("footer"); -} - -Ref<_HTMLTag> _HTMLBuilder::form() { - write_tag(); - - return _tag->start("form"); -} - -Ref<_HTMLTag> _HTMLBuilder::frame() { // Not supported in HTML5. - write_tag(); - - return _tag->start("frame"); -} - -Ref<_HTMLTag> _HTMLBuilder::frameset() { // Not supported in HTML5. - write_tag(); - - return _tag->start("frameset"); -} - -Ref<_HTMLTag> _HTMLBuilder::h1() { - write_tag(); - - return _tag->start("h1"); -} - -Ref<_HTMLTag> _HTMLBuilder::h2() { - write_tag(); - - return _tag->start("h2"); -} - -Ref<_HTMLTag> _HTMLBuilder::h3() { - write_tag(); - - return _tag->start("h3"); -} - -Ref<_HTMLTag> _HTMLBuilder::h4() { - write_tag(); - - return _tag->start("h4"); -} - -Ref<_HTMLTag> _HTMLBuilder::h5() { - write_tag(); - - return _tag->start("h5"); -} - -Ref<_HTMLTag> _HTMLBuilder::h6() { - write_tag(); - - return _tag->start("h6"); -} - -Ref<_HTMLTag> _HTMLBuilder::head() { - write_tag(); - - return _tag->start("head"); -} - -Ref<_HTMLTag> _HTMLBuilder::header() { - write_tag(); - - return _tag->start("header"); -} - -Ref<_HTMLTag> _HTMLBuilder::hr() { - write_tag(); - - return _tag->start("hr"); -} - -Ref<_HTMLTag> _HTMLBuilder::html() { - write_tag(); - - return _tag->start("html"); -} - -Ref<_HTMLTag> _HTMLBuilder::i() { - write_tag(); - - return _tag->start("i"); -} - -Ref<_HTMLTag> _HTMLBuilder::iframe() { - write_tag(); - - return _tag->start("iframe"); -} - -Ref<_HTMLTag> _HTMLBuilder::img() { - write_tag(); - - return _tag->start("img"); -} - -Ref<_HTMLTag> _HTMLBuilder::input() { - write_tag(); - - return _tag->start("input"); -} - -Ref<_HTMLTag> _HTMLBuilder::ins() { - write_tag(); - - return _tag->start("ins"); -} - -Ref<_HTMLTag> _HTMLBuilder::kbd() { - write_tag(); - - return _tag->start("kbd"); -} - -Ref<_HTMLTag> _HTMLBuilder::label() { - write_tag(); - - return _tag->start("label"); -} - -Ref<_HTMLTag> _HTMLBuilder::legend() { - write_tag(); - - return _tag->start("legend"); -} - -Ref<_HTMLTag> _HTMLBuilder::li() { - write_tag(); - - return _tag->start("li"); -} - -Ref<_HTMLTag> _HTMLBuilder::link() { - write_tag(); - - return _tag->start("link"); -} - -Ref<_HTMLTag> _HTMLBuilder::main() { - write_tag(); - - return _tag->start("main"); -} - -Ref<_HTMLTag> _HTMLBuilder::map() { - write_tag(); - - return _tag->start("map"); -} -Ref<_HTMLTag> _HTMLBuilder::mark() { - write_tag(); - - return _tag->start("mark"); -} - -Ref<_HTMLTag> _HTMLBuilder::meta() { - write_tag(); - - return _tag->start("meta"); -} - -Ref<_HTMLTag> _HTMLBuilder::meter() { - write_tag(); - - return _tag->start("meter"); -} - -Ref<_HTMLTag> _HTMLBuilder::nav() { - write_tag(); - - return _tag->start("nav"); -} - -Ref<_HTMLTag> _HTMLBuilder::noframes() { // Not supported in HTML5. - write_tag(); - - return _tag->start("noframes"); -} - -Ref<_HTMLTag> _HTMLBuilder::noscript() { - write_tag(); - - return _tag->start("noscript"); -} - -Ref<_HTMLTag> _HTMLBuilder::objectt() { - write_tag(); - - return _tag->start("object"); -} - -Ref<_HTMLTag> _HTMLBuilder::ol() { - write_tag(); - - return _tag->start("ol"); -} - -Ref<_HTMLTag> _HTMLBuilder::optgroup() { - write_tag(); - - return _tag->start("optgroup"); -} - -Ref<_HTMLTag> _HTMLBuilder::option(const String &value) { - write_tag(); - - _tag->start("option"); - - if (value != "") { - _tag->value(value); - } - - return _tag; -} -Ref<_HTMLBuilder> _HTMLBuilder::foption(const String &value, const String &body, const bool selected) { - option(value)->selected(selected); - w(body); - coption(); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::output() { - write_tag(); - - return _tag->start("output"); -} - -Ref<_HTMLTag> _HTMLBuilder::p() { - write_tag(); - - return _tag->start("p"); -} - -Ref<_HTMLTag> _HTMLBuilder::param() { - write_tag(); - - return _tag->start("param"); -} - -Ref<_HTMLTag> _HTMLBuilder::picture() { - write_tag(); - - return _tag->start("picture"); -} - -Ref<_HTMLTag> _HTMLBuilder::pre() { - write_tag(); - - return _tag->start("pre"); -} - -Ref<_HTMLTag> _HTMLBuilder::progress() { - write_tag(); - - return _tag->start("progress"); -} - -Ref<_HTMLTag> _HTMLBuilder::q() { - write_tag(); - - return _tag->start("q"); -} - -Ref<_HTMLTag> _HTMLBuilder::rp() { - write_tag(); - - return _tag->start("rp"); -} - -Ref<_HTMLTag> _HTMLBuilder::rt() { - write_tag(); - - return _tag->start("rt"); -} - -Ref<_HTMLTag> _HTMLBuilder::ruby() { - write_tag(); - - return _tag->start("ruby"); -} - -Ref<_HTMLTag> _HTMLBuilder::s() { - write_tag(); - - return _tag->start("s"); -} - -Ref<_HTMLTag> _HTMLBuilder::samp() { - write_tag(); - - return _tag->start("samp"); -} - -Ref<_HTMLTag> _HTMLBuilder::script() { - write_tag(); - - return _tag->start("script"); -} - -Ref<_HTMLTag> _HTMLBuilder::section() { - write_tag(); - - return _tag->start("section"); -} - -Ref<_HTMLTag> _HTMLBuilder::select(const String &name, const String &cls, const String &id) { - write_tag(); - - _tag->start("select"); - - if (name != "") { - _tag->name(name); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::small() { - write_tag(); - - return _tag->start("small"); -} - -Ref<_HTMLTag> _HTMLBuilder::source() { - write_tag(); - - return _tag->start("source"); -} - -Ref<_HTMLTag> _HTMLBuilder::span() { - write_tag(); - - return _tag->start("span"); -} - -Ref<_HTMLTag> _HTMLBuilder::strike() { // Not supported in HTML5 - write_tag(); - - return _tag->start("strike"); -} - -Ref<_HTMLTag> _HTMLBuilder::strong() { - write_tag(); - - return _tag->start("strong"); -} - -Ref<_HTMLTag> _HTMLBuilder::style() { - write_tag(); - - return _tag->start("style"); -} - -Ref<_HTMLTag> _HTMLBuilder::sub() { - write_tag(); - - return _tag->start("sub"); -} - -Ref<_HTMLTag> _HTMLBuilder::summary() { - write_tag(); - - return _tag->start("summary"); -} - -Ref<_HTMLTag> _HTMLBuilder::sup() { - write_tag(); - - return _tag->start("sup"); -} - -Ref<_HTMLTag> _HTMLBuilder::svg() { - write_tag(); - - return _tag->start("svg"); -} - -Ref<_HTMLTag> _HTMLBuilder::table() { - write_tag(); - - return _tag->start("table"); -} - -Ref<_HTMLTag> _HTMLBuilder::tbody() { - write_tag(); - - return _tag->start("tbody"); -} - -Ref<_HTMLTag> _HTMLBuilder::td() { - write_tag(); - - return _tag->start("td"); -} - -Ref<_HTMLTag> _HTMLBuilder::templateh() { - write_tag(); - - return _tag->start("template"); -} - -Ref<_HTMLTag> _HTMLBuilder::textarea(const String &name, const String &cls, const String &id) { - write_tag(); - - _tag->start("textarea"); - - if (name != "") { - _tag->name(name); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLBuilder> _HTMLBuilder::ftextarea(const String &name, const String &body, const String &cls, const String &id) { - textarea(name, cls, id); - w(body); - ctextarea(); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::tfoot() { - write_tag(); - - return _tag->start("tfoot"); -} - -Ref<_HTMLTag> _HTMLBuilder::th() { - write_tag(); - - return _tag->start("th"); -} - -Ref<_HTMLTag> _HTMLBuilder::thead() { - write_tag(); - - return _tag->start("thead"); -} - -Ref<_HTMLTag> _HTMLBuilder::time() { - write_tag(); - - return _tag->start("time"); -} - -Ref<_HTMLTag> _HTMLBuilder::title() { - write_tag(); - - return _tag->start("title"); -} - -Ref<_HTMLTag> _HTMLBuilder::tr() { - write_tag(); - - return _tag->start("tr"); -} - -Ref<_HTMLTag> _HTMLBuilder::track() { - write_tag(); - - return _tag->start("track"); -} - -Ref<_HTMLTag> _HTMLBuilder::tt() { // Not supported in HTML5. - write_tag(); - - return _tag->start("tt"); -} - -Ref<_HTMLTag> _HTMLBuilder::u() { - write_tag(); - - return _tag->start("u"); -} - -Ref<_HTMLTag> _HTMLBuilder::ul() { - write_tag(); - - return _tag->start("ul"); -} - -Ref<_HTMLTag> _HTMLBuilder::var() { - write_tag(); - - return _tag->start("var"); -} - -Ref<_HTMLTag> _HTMLBuilder::video() { - write_tag(); - - return _tag->start("video"); -} - -Ref<_HTMLTag> _HTMLBuilder::wbr() { - write_tag(); - - return _tag->start("wbr"); -} - -// Closing _tags - -Ref<_HTMLBuilder> _HTMLBuilder::ca() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cabbr() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cacronym() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::caddress() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::capplet() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::carea() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::carticle() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::caside() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::caudio() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cb() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cbasefont() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cbdi() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cbdo() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cbig() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cblockquote() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cbody() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cbutton() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccanvas() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccaption() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccenter() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccite() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccode() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccol() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ccolgroup() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdata() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdatalist() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdd() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdel() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdetails() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdfn() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdialog() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdir() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdiv() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdl() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cdt() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cem() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cembed() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cfieldset() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cfigcaption() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cfigure() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cfont() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cfooter() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cform() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cframe() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cframeset() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ch1() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ch2() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ch3() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ch4() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ch5() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ch6() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::chead() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cheader() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::chr() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::chtml() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ci() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ciframe() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cimg() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cinput() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cins() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ckbd() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::clabel() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::clegend() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cli() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::clink() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cmain() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cmap() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cmark() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cmeta() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cmeter() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cnav() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cnoframes() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cnoscript() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cobjectt() { - write_tag(); - result += "
"; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::c_ol() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::coptgroup() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::coption() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::coutput() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cp() { - write_tag(); - result += "

"; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cparam() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cpicture() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cpre() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cprogress() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cq() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::crp() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::crt() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cruby() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cs() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csamp() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cscript() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csection() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cselect() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csmall() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csource() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cspan() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cstrike() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cstrong() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cstyle() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csub() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csummary() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csup() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csvg() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctable() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctbody() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctd() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctemplateh() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctextarea() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctfoot() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cth() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cthead() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctime() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctitle() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctr() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctrack() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctt() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cu() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cul() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cvar() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cvideo() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::cwbr() { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::form_get(const String &action, const String &cls, const String &id) { - write_tag(); - - _tag->start("form")->method_get(); - - _tag->fora(action); - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::form_post(const String &action, const String &cls, const String &id) { - write_tag(); - - _tag->start("form")->method_post(); - - _tag->action(action); - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLBuilder> _HTMLBuilder::form_postr(const String &action, Ref request, const String &cls, const String &id) { - form_post(action, cls, id); - csrf_tokenr(request); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::flabel(const String &pfor, const String &plabel, const String &cls, const String &id) { - Ref<_HTMLTag> t = label(); - - t->fora(pfor); - - if (cls != "") { - t->cls(cls); - } - - if (id != "") { - t->id(id); - } - - w(plabel); - - clabel(); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::input_button(const String &name, const String &value, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itbutton(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_checkbox(const String &name, const String &value, const bool checked, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itcheckbox(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - _tag->checked(checked); - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_color(const String &name, const String &value, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itcolor(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_date(const String &name, const String &value, const String &cls, const String &id, const String &date_min, const String &date_max, const String &date_step) { - write_tag(); - - _tag->start("input")->itdate(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (date_min != "") { - _tag->min(date_min); - } - - if (date_max != "") { - _tag->max(date_max); - } - - if (date_step != "") { - _tag->step(date_step); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_datetime_local(const String &name, const String &value, const String &cls, const String &id, const String &date_min, const String &date_max, const String &date_step) { - write_tag(); - - _tag->start("input")->itdatetime_local(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (date_min != "") { - _tag->min(date_min); - } - - if (date_max != "") { - _tag->max(date_max); - } - - if (date_step != "") { - _tag->step(date_step); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_email(const String &name, const String &value, const String &placeholder, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itemail(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (placeholder != "") { - _tag->placeholder(placeholder); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_file(const String &name, const String &accept, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itfile(); - - if (name != "") { - _tag->name(name); - } - - if (accept != "") { - _tag->accept(accept); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::input_image(const String &name, const String &src, const String &alt, const String &cls, const String &id, const int width, const int height) { - write_tag(); - - _tag->start("input")->itimage(); - - if (name != "") { - _tag->name(name); - } - - if (src != "") { - _tag->src(src); - } - - if (alt != "") { - _tag->alt(alt); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (width != 0) { - _tag->width(width); - } - - if (height != 0) { - _tag->height(height); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_month(const String &name, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itmonth(); - - if (name != "") { - _tag->name(name); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_number(const String &name, const String &vmin, const String &vmax, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itnumber(); - - if (name != "") { - _tag->name(name); - } - - if (vmin != "") { - _tag->min(vmin); - } - - if (vmax != "") { - _tag->max(vmax); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_password(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size) { - write_tag(); - - _tag->start("input")->itpassword(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (placeholder != "") { - _tag->placeholder(placeholder); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (minlength != "") { - _tag->minlengths(minlength); - } - - if (maxlength != "") { - _tag->maxlengths(maxlength); - } - - if (size != "") { - _tag->sizes(size); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_radio(const String &name, const String &value, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itradio(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_range(const String &name, const String &value, const String &vmin, const String &vmax, const String &vstep, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itrange(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (vmin != "") { - _tag->min(vmin); - } - - if (vmax != "") { - _tag->max(vmax); - } - - if (vstep != "") { - _tag->step(vstep); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLTag> _HTMLBuilder::input_reset(const String &name, const String &value, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itreset(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_search(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size, const String &pattern) { - write_tag(); - - _tag->start("input")->itsearch(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (placeholder != "") { - _tag->placeholder(placeholder); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (minlength != "") { - _tag->minlengths(minlength); - } - - if (maxlength != "") { - _tag->maxlengths(maxlength); - } - - if (size != "") { - _tag->sizes(size); - } - - if (pattern != "") { - _tag->pattern(pattern); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_submit(const String &value, const String &cls, const String &id) { - write_tag(); - - _tag->start("input")->itsubmit(); - - if (value != "") { - _tag->value(value); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_tel(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size, const String &pattern) { - write_tag(); - - _tag->start("input")->ittel(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (placeholder != "") { - _tag->placeholder(placeholder); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (minlength != "") { - _tag->minlengths(minlength); - } - - if (maxlength != "") { - _tag->maxlengths(maxlength); - } - - if (size != "") { - _tag->sizes(size); - } - - if (pattern != "") { - _tag->pattern(pattern); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_text(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size) { - write_tag(); - - _tag->start("input")->ittext(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (placeholder != "") { - _tag->placeholder(placeholder); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (minlength != "") { - _tag->minlengths(minlength); - } - - if (maxlength != "") { - _tag->maxlengths(maxlength); - } - - if (size != "") { - _tag->sizes(size); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_time(const String &name, const String &cls, const String &id, const String &vmin, const String &vmax, const String &vstep) { - write_tag(); - - _tag->start("input")->ittime(); - - if (name != "") { - _tag->name(name); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (vmin != "") { - _tag->min(vmin); - } - - if (vmax != "") { - _tag->max(vmax); - } - - if (vstep != "") { - _tag->step(vstep); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_url(const String &name, const String &value, const String &placeholder, const String &cls, const String &id, const String &minlength, const String &maxlength, const String &size) { - write_tag(); - - _tag->start("input")->iturl(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - if (placeholder != "") { - _tag->placeholder(placeholder); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (minlength != "") { - _tag->minlengths(minlength); - } - - if (maxlength != "") { - _tag->maxlengths(maxlength); - } - - if (size != "") { - _tag->sizes(size); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_week(const String &name, const String &cls, const String &id, const String &vmin, const String &vmax) { - write_tag(); - return _tag->start("input")->itweek(); - - if (name != "") { - _tag->name(name); - } - - if (cls != "") { - _tag->cls(cls); - } - - if (id != "") { - _tag->id(id); - } - - if (vmin != "") { - _tag->min(vmin); - } - - if (vmax != "") { - _tag->max(vmax); - } - - return _tag; -} - -Ref<_HTMLTag> _HTMLBuilder::input_hidden(const String &name, const String &value) { - write_tag(); - - _tag->start("input")->ithidden(); - - if (name != "") { - _tag->name(name); - } - - if (value != "") { - _tag->value(value); - } - - return _tag; -} - -Ref<_HTMLBuilder> _HTMLBuilder::csrf_token(const String &token) { - if (token == "") { - // don't waste html characters if it's an empty string anyway - return Ref<_HTMLBuilder>(this); - } - - input_hidden("csrf_token", token); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::csrf_tokenr(Ref request) { - return csrf_token(request->get_csrf_token()); -} - -Ref<_HTMLTag> _HTMLBuilder::tag(const String &p_tag, const bool p_simple) { - write_tag(); - - return _tag->start(p_tag, p_simple); -} - -Ref<_HTMLBuilder> _HTMLBuilder::ctag(const String &p_tag) { - write_tag(); - result += ""; - - return Ref<_HTMLBuilder>(this); -} - -void _HTMLBuilder::f() { - write_tag(); -} - -Ref<_HTMLBuilder> _HTMLBuilder::w(const String &val) { - write_tag(); - - result += val; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::wn(const double val, int p_decimals) { - write_tag(); - - result += String::num(val, p_decimals); - - return Ref<_HTMLBuilder>(this); -} -Ref<_HTMLBuilder> _HTMLBuilder::wns(const double val) { - write_tag(); - - result += String::num_scientific(val); - - return Ref<_HTMLBuilder>(this); -} -Ref<_HTMLBuilder> _HTMLBuilder::wr(const double val, const bool p_trailing) { - write_tag(); - - //TODO - //result += String::num_real(val, p_trailing); - - return Ref<_HTMLBuilder>(this); -} -Ref<_HTMLBuilder> _HTMLBuilder::wi(const int64_t val, const int base, const bool capitalize_hex) { - write_tag(); - - result += String::num_int64(val, base, capitalize_hex); - - return Ref<_HTMLBuilder>(this); -} -Ref<_HTMLBuilder> _HTMLBuilder::wui(const uint64_t val, const int base, const bool capitalize_hex) { - write_tag(); - - result += String::num_uint64(val, base, capitalize_hex); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::wbn(const bool val) { - write_tag(); - - //TODO - //result += String::bool_num(val); - - return Ref<_HTMLBuilder>(this); -} -Ref<_HTMLBuilder> _HTMLBuilder::wbs(const bool val) { - write_tag(); - - //TODO - //result += String::bool_str(val); - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::we(const String &val) { - print_error("_HTMLBuilder::write_excaped NYI!"); - - write_tag(); - - result += val; - - return Ref<_HTMLBuilder>(this); -} - -Ref<_HTMLBuilder> _HTMLBuilder::write_tag() { - if (_tag->has_data()) { - _tag->close(); - result += _tag->result; - _tag->reset(); - } - - return Ref<_HTMLBuilder>(this); -} - -_HTMLBuilder::_HTMLBuilder() { - _tag.instance(); - _tag->owner = this; -} - -_HTMLBuilder::~_HTMLBuilder() { - _tag->owner = nullptr; - _tag.unref(); -} - -void _HTMLBuilder::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_result"), &_HTMLBuilder::get_result); - ClassDB::bind_method(D_METHOD("set_result", "val"), &_HTMLBuilder::set_result); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "result"), "set_result", "get_result"); - - ClassDB::bind_method(D_METHOD("comment", "val"), &_HTMLBuilder::comment); - ClassDB::bind_method(D_METHOD("doctype", "val"), &_HTMLBuilder::doctype, ""); - - ClassDB::bind_method(D_METHOD("a", "href", "cls", "id"), &_HTMLBuilder::a, "", "", ""); - ClassDB::bind_method(D_METHOD("fa", "href", "body", "cls", "id"), &_HTMLBuilder::fa, "", ""); - - ClassDB::bind_method(D_METHOD("abbr"), &_HTMLBuilder::abbr); - ClassDB::bind_method(D_METHOD("acronym"), &_HTMLBuilder::acronym); - ClassDB::bind_method(D_METHOD("address"), &_HTMLBuilder::address); - ClassDB::bind_method(D_METHOD("applet"), &_HTMLBuilder::applet); - ClassDB::bind_method(D_METHOD("area"), &_HTMLBuilder::area); - - ClassDB::bind_method(D_METHOD("article"), &_HTMLBuilder::article); - ClassDB::bind_method(D_METHOD("aside"), &_HTMLBuilder::aside); - ClassDB::bind_method(D_METHOD("audio"), &_HTMLBuilder::audio); - ClassDB::bind_method(D_METHOD("b"), &_HTMLBuilder::b); - ClassDB::bind_method(D_METHOD("basefont"), &_HTMLBuilder::basefont); - - ClassDB::bind_method(D_METHOD("bdi"), &_HTMLBuilder::bdi); - ClassDB::bind_method(D_METHOD("bdo"), &_HTMLBuilder::bdo); - ClassDB::bind_method(D_METHOD("big"), &_HTMLBuilder::big); - ClassDB::bind_method(D_METHOD("blockquote"), &_HTMLBuilder::blockquote); - ClassDB::bind_method(D_METHOD("body"), &_HTMLBuilder::body); - - ClassDB::bind_method(D_METHOD("br"), &_HTMLBuilder::br); - ClassDB::bind_method(D_METHOD("button"), &_HTMLBuilder::button); - ClassDB::bind_method(D_METHOD("canvas"), &_HTMLBuilder::canvas); - ClassDB::bind_method(D_METHOD("caption"), &_HTMLBuilder::caption); - ClassDB::bind_method(D_METHOD("center"), &_HTMLBuilder::center); - ClassDB::bind_method(D_METHOD("cite"), &_HTMLBuilder::cite); - ClassDB::bind_method(D_METHOD("code"), &_HTMLBuilder::code); - - ClassDB::bind_method(D_METHOD("col"), &_HTMLBuilder::col); - ClassDB::bind_method(D_METHOD("colgroup"), &_HTMLBuilder::colgroup); - ClassDB::bind_method(D_METHOD("data"), &_HTMLBuilder::data); - ClassDB::bind_method(D_METHOD("datalist"), &_HTMLBuilder::datalist); - ClassDB::bind_method(D_METHOD("dd"), &_HTMLBuilder::dd); - ClassDB::bind_method(D_METHOD("del"), &_HTMLBuilder::del); - - ClassDB::bind_method(D_METHOD("details"), &_HTMLBuilder::details); - ClassDB::bind_method(D_METHOD("dfn"), &_HTMLBuilder::dfn); - ClassDB::bind_method(D_METHOD("dialog"), &_HTMLBuilder::dialog); - ClassDB::bind_method(D_METHOD("dir"), &_HTMLBuilder::dir); - - ClassDB::bind_method(D_METHOD("div", "cls", "id"), &_HTMLBuilder::div, "", ""); - ClassDB::bind_method(D_METHOD("fdiv", "body", "cls", "id"), &_HTMLBuilder::fdiv, "", ""); - - ClassDB::bind_method(D_METHOD("dl"), &_HTMLBuilder::dl); - ClassDB::bind_method(D_METHOD("dt"), &_HTMLBuilder::dt); - ClassDB::bind_method(D_METHOD("em"), &_HTMLBuilder::em); - ClassDB::bind_method(D_METHOD("embed"), &_HTMLBuilder::embed); - ClassDB::bind_method(D_METHOD("fieldset"), &_HTMLBuilder::fieldset); - ClassDB::bind_method(D_METHOD("figcaption"), &_HTMLBuilder::figcaption); - - ClassDB::bind_method(D_METHOD("figure"), &_HTMLBuilder::figure); - ClassDB::bind_method(D_METHOD("font"), &_HTMLBuilder::font); - ClassDB::bind_method(D_METHOD("footer"), &_HTMLBuilder::footer); - ClassDB::bind_method(D_METHOD("form"), &_HTMLBuilder::form); - ClassDB::bind_method(D_METHOD("frame"), &_HTMLBuilder::frame); - ClassDB::bind_method(D_METHOD("frameset"), &_HTMLBuilder::frameset); - - ClassDB::bind_method(D_METHOD("h1"), &_HTMLBuilder::h1); - ClassDB::bind_method(D_METHOD("h2"), &_HTMLBuilder::h2); - ClassDB::bind_method(D_METHOD("h3"), &_HTMLBuilder::h3); - ClassDB::bind_method(D_METHOD("h4"), &_HTMLBuilder::h4); - ClassDB::bind_method(D_METHOD("h5"), &_HTMLBuilder::h5); - ClassDB::bind_method(D_METHOD("h6"), &_HTMLBuilder::h6); - - ClassDB::bind_method(D_METHOD("head"), &_HTMLBuilder::head); - ClassDB::bind_method(D_METHOD("header"), &_HTMLBuilder::header); - ClassDB::bind_method(D_METHOD("hr"), &_HTMLBuilder::hr); - ClassDB::bind_method(D_METHOD("html"), &_HTMLBuilder::html); - - ClassDB::bind_method(D_METHOD("i"), &_HTMLBuilder::i); - ClassDB::bind_method(D_METHOD("iframe"), &_HTMLBuilder::iframe); - ClassDB::bind_method(D_METHOD("img"), &_HTMLBuilder::img); - ClassDB::bind_method(D_METHOD("input"), &_HTMLBuilder::input); - ClassDB::bind_method(D_METHOD("ins"), &_HTMLBuilder::ins); - ClassDB::bind_method(D_METHOD("kbd"), &_HTMLBuilder::kbd); - - ClassDB::bind_method(D_METHOD("label"), &_HTMLBuilder::label); - ClassDB::bind_method(D_METHOD("legend"), &_HTMLBuilder::legend); - ClassDB::bind_method(D_METHOD("li"), &_HTMLBuilder::li); - ClassDB::bind_method(D_METHOD("link"), &_HTMLBuilder::link); - ClassDB::bind_method(D_METHOD("main"), &_HTMLBuilder::main); - ClassDB::bind_method(D_METHOD("map"), &_HTMLBuilder::map); - ClassDB::bind_method(D_METHOD("mark"), &_HTMLBuilder::mark); - ClassDB::bind_method(D_METHOD("meta"), &_HTMLBuilder::meta); - ClassDB::bind_method(D_METHOD("meter"), &_HTMLBuilder::meter); - - ClassDB::bind_method(D_METHOD("nav"), &_HTMLBuilder::nav); - ClassDB::bind_method(D_METHOD("noframes"), &_HTMLBuilder::noframes); - ClassDB::bind_method(D_METHOD("noscript"), &_HTMLBuilder::noscript); - ClassDB::bind_method(D_METHOD("objectt"), &_HTMLBuilder::objectt); - ClassDB::bind_method(D_METHOD("ol"), &_HTMLBuilder::ol); - ClassDB::bind_method(D_METHOD("optgroup"), &_HTMLBuilder::optgroup); - - ClassDB::bind_method(D_METHOD("option", "val"), &_HTMLBuilder::option, ""); - ClassDB::bind_method(D_METHOD("foption", "value", "body", "selected"), &_HTMLBuilder::foption, false); - - ClassDB::bind_method(D_METHOD("output"), &_HTMLBuilder::output); - ClassDB::bind_method(D_METHOD("p"), &_HTMLBuilder::p); - ClassDB::bind_method(D_METHOD("param"), &_HTMLBuilder::param); - - ClassDB::bind_method(D_METHOD("picture"), &_HTMLBuilder::picture); - ClassDB::bind_method(D_METHOD("pre"), &_HTMLBuilder::pre); - ClassDB::bind_method(D_METHOD("progress"), &_HTMLBuilder::progress); - ClassDB::bind_method(D_METHOD("q"), &_HTMLBuilder::q); - ClassDB::bind_method(D_METHOD("rp"), &_HTMLBuilder::rp); - - ClassDB::bind_method(D_METHOD("rt"), &_HTMLBuilder::rt); - ClassDB::bind_method(D_METHOD("ruby"), &_HTMLBuilder::ruby); - ClassDB::bind_method(D_METHOD("s"), &_HTMLBuilder::s); - ClassDB::bind_method(D_METHOD("samp"), &_HTMLBuilder::samp); - ClassDB::bind_method(D_METHOD("script"), &_HTMLBuilder::script); - ClassDB::bind_method(D_METHOD("section"), &_HTMLBuilder::section); - - ClassDB::bind_method(D_METHOD("select", "name", "cls", "id"), &_HTMLBuilder::select, "", "", ""); - - ClassDB::bind_method(D_METHOD("small"), &_HTMLBuilder::small); - ClassDB::bind_method(D_METHOD("source"), &_HTMLBuilder::source); - ClassDB::bind_method(D_METHOD("span"), &_HTMLBuilder::span); - ClassDB::bind_method(D_METHOD("strike"), &_HTMLBuilder::strike); - - ClassDB::bind_method(D_METHOD("strong"), &_HTMLBuilder::strong); - ClassDB::bind_method(D_METHOD("style"), &_HTMLBuilder::style); - ClassDB::bind_method(D_METHOD("sub"), &_HTMLBuilder::sub); - ClassDB::bind_method(D_METHOD("summary"), &_HTMLBuilder::summary); - ClassDB::bind_method(D_METHOD("sup"), &_HTMLBuilder::sup); - - ClassDB::bind_method(D_METHOD("svg"), &_HTMLBuilder::svg); - ClassDB::bind_method(D_METHOD("table"), &_HTMLBuilder::table); - ClassDB::bind_method(D_METHOD("tbody"), &_HTMLBuilder::tbody); - ClassDB::bind_method(D_METHOD("td"), &_HTMLBuilder::td); - ClassDB::bind_method(D_METHOD("templateh"), &_HTMLBuilder::templateh); - - ClassDB::bind_method(D_METHOD("textarea", "name", "cls", "id"), &_HTMLBuilder::textarea, "", "", ""); - ClassDB::bind_method(D_METHOD("ftextarea", "name", "body", "cls", "id"), &_HTMLBuilder::ftextarea, "", ""); - - ClassDB::bind_method(D_METHOD("tfoot"), &_HTMLBuilder::tfoot); - ClassDB::bind_method(D_METHOD("th"), &_HTMLBuilder::th); - ClassDB::bind_method(D_METHOD("thead"), &_HTMLBuilder::thead); - - ClassDB::bind_method(D_METHOD("time"), &_HTMLBuilder::time); - ClassDB::bind_method(D_METHOD("title"), &_HTMLBuilder::title); - ClassDB::bind_method(D_METHOD("tra"), &_HTMLBuilder::tr); - ClassDB::bind_method(D_METHOD("track"), &_HTMLBuilder::track); - ClassDB::bind_method(D_METHOD("tt"), &_HTMLBuilder::tt); - - ClassDB::bind_method(D_METHOD("u"), &_HTMLBuilder::u); - ClassDB::bind_method(D_METHOD("ul"), &_HTMLBuilder::ul); - ClassDB::bind_method(D_METHOD("var"), &_HTMLBuilder::var); - ClassDB::bind_method(D_METHOD("video"), &_HTMLBuilder::video); - ClassDB::bind_method(D_METHOD("wbr"), &_HTMLBuilder::wbr); - - ClassDB::bind_method(D_METHOD("ca"), &_HTMLBuilder::ca); - ClassDB::bind_method(D_METHOD("cabbr"), &_HTMLBuilder::cabbr); - ClassDB::bind_method(D_METHOD("cacronym"), &_HTMLBuilder::cacronym); - ClassDB::bind_method(D_METHOD("caddress"), &_HTMLBuilder::caddress); - ClassDB::bind_method(D_METHOD("capplet"), &_HTMLBuilder::capplet); - ClassDB::bind_method(D_METHOD("carea"), &_HTMLBuilder::carea); - ClassDB::bind_method(D_METHOD("carticle"), &_HTMLBuilder::carticle); - - ClassDB::bind_method(D_METHOD("caside"), &_HTMLBuilder::caside); - ClassDB::bind_method(D_METHOD("caudio"), &_HTMLBuilder::caudio); - ClassDB::bind_method(D_METHOD("cb"), &_HTMLBuilder::cb); - ClassDB::bind_method(D_METHOD("cbasefont"), &_HTMLBuilder::cbasefont); - ClassDB::bind_method(D_METHOD("cbdi"), &_HTMLBuilder::cbdi); - ClassDB::bind_method(D_METHOD("cbdo"), &_HTMLBuilder::cbdo); - - ClassDB::bind_method(D_METHOD("cbig"), &_HTMLBuilder::cbig); - ClassDB::bind_method(D_METHOD("cblockquote"), &_HTMLBuilder::cblockquote); - ClassDB::bind_method(D_METHOD("cbody"), &_HTMLBuilder::cbody); - ClassDB::bind_method(D_METHOD("cbutton"), &_HTMLBuilder::cbutton); - ClassDB::bind_method(D_METHOD("ccanvas"), &_HTMLBuilder::ccanvas); - - ClassDB::bind_method(D_METHOD("ccaption"), &_HTMLBuilder::ccaption); - ClassDB::bind_method(D_METHOD("ccenter"), &_HTMLBuilder::ccenter); - ClassDB::bind_method(D_METHOD("ccite"), &_HTMLBuilder::ccite); - ClassDB::bind_method(D_METHOD("ccode"), &_HTMLBuilder::ccode); - ClassDB::bind_method(D_METHOD("ccol"), &_HTMLBuilder::ccol); - - ClassDB::bind_method(D_METHOD("ccolgroup"), &_HTMLBuilder::ccolgroup); - ClassDB::bind_method(D_METHOD("cdata"), &_HTMLBuilder::cdata); - ClassDB::bind_method(D_METHOD("cdatalist"), &_HTMLBuilder::cdatalist); - ClassDB::bind_method(D_METHOD("cdd"), &_HTMLBuilder::cdd); - ClassDB::bind_method(D_METHOD("cdel"), &_HTMLBuilder::cdel); - ClassDB::bind_method(D_METHOD("cdetails"), &_HTMLBuilder::cdetails); - - ClassDB::bind_method(D_METHOD("cdfn"), &_HTMLBuilder::cdfn); - ClassDB::bind_method(D_METHOD("cdialog"), &_HTMLBuilder::cdialog); - ClassDB::bind_method(D_METHOD("cdir"), &_HTMLBuilder::cdir); - ClassDB::bind_method(D_METHOD("cdiv"), &_HTMLBuilder::cdiv); - ClassDB::bind_method(D_METHOD("cdl"), &_HTMLBuilder::cdl); - ClassDB::bind_method(D_METHOD("cdt"), &_HTMLBuilder::cdt); - - ClassDB::bind_method(D_METHOD("cembed"), &_HTMLBuilder::cembed); - ClassDB::bind_method(D_METHOD("cfieldset"), &_HTMLBuilder::cfieldset); - ClassDB::bind_method(D_METHOD("cfigcaption"), &_HTMLBuilder::cfigcaption); - ClassDB::bind_method(D_METHOD("cfigure"), &_HTMLBuilder::cfigure); - ClassDB::bind_method(D_METHOD("cfont"), &_HTMLBuilder::cfont); - - ClassDB::bind_method(D_METHOD("cfooter"), &_HTMLBuilder::cfooter); - ClassDB::bind_method(D_METHOD("cform"), &_HTMLBuilder::cform); - ClassDB::bind_method(D_METHOD("cframe"), &_HTMLBuilder::cframe); - ClassDB::bind_method(D_METHOD("cframeset"), &_HTMLBuilder::cframeset); - ClassDB::bind_method(D_METHOD("ch1"), &_HTMLBuilder::ch1); - ClassDB::bind_method(D_METHOD("ch2"), &_HTMLBuilder::ch2); - - ClassDB::bind_method(D_METHOD("ch3"), &_HTMLBuilder::ch3); - ClassDB::bind_method(D_METHOD("ch4"), &_HTMLBuilder::ch4); - ClassDB::bind_method(D_METHOD("ch5"), &_HTMLBuilder::ch5); - ClassDB::bind_method(D_METHOD("ch6"), &_HTMLBuilder::ch6); - - ClassDB::bind_method(D_METHOD("chead"), &_HTMLBuilder::chead); - ClassDB::bind_method(D_METHOD("cheader"), &_HTMLBuilder::cheader); - ClassDB::bind_method(D_METHOD("chr"), &_HTMLBuilder::chr); - ClassDB::bind_method(D_METHOD("chtml"), &_HTMLBuilder::chtml); - - ClassDB::bind_method(D_METHOD("ci"), &_HTMLBuilder::ci); - ClassDB::bind_method(D_METHOD("ciframe"), &_HTMLBuilder::ciframe); - ClassDB::bind_method(D_METHOD("cimg"), &_HTMLBuilder::cimg); - ClassDB::bind_method(D_METHOD("cinput"), &_HTMLBuilder::cinput); - ClassDB::bind_method(D_METHOD("cins"), &_HTMLBuilder::cins); - ClassDB::bind_method(D_METHOD("ckbd"), &_HTMLBuilder::ckbd); - - ClassDB::bind_method(D_METHOD("clabel"), &_HTMLBuilder::clabel); - ClassDB::bind_method(D_METHOD("clegend"), &_HTMLBuilder::clegend); - ClassDB::bind_method(D_METHOD("cli"), &_HTMLBuilder::cli); - ClassDB::bind_method(D_METHOD("clink"), &_HTMLBuilder::clink); - - ClassDB::bind_method(D_METHOD("cmain"), &_HTMLBuilder::cmain); - ClassDB::bind_method(D_METHOD("cmap"), &_HTMLBuilder::cmap); - ClassDB::bind_method(D_METHOD("cmark"), &_HTMLBuilder::cmark); - ClassDB::bind_method(D_METHOD("cmeta"), &_HTMLBuilder::cmeta); - - ClassDB::bind_method(D_METHOD("cmeter"), &_HTMLBuilder::cmeter); - ClassDB::bind_method(D_METHOD("cnav"), &_HTMLBuilder::cnav); - ClassDB::bind_method(D_METHOD("cnoframes"), &_HTMLBuilder::cnoframes); - - ClassDB::bind_method(D_METHOD("cnoscript"), &_HTMLBuilder::cnoscript); - ClassDB::bind_method(D_METHOD("cobjectt"), &_HTMLBuilder::cobjectt); - ClassDB::bind_method(D_METHOD("c_ol"), &_HTMLBuilder::c_ol); - ClassDB::bind_method(D_METHOD("coptgroup"), &_HTMLBuilder::coptgroup); - ClassDB::bind_method(D_METHOD("coption"), &_HTMLBuilder::coption); - - ClassDB::bind_method(D_METHOD("coutput"), &_HTMLBuilder::coutput); - ClassDB::bind_method(D_METHOD("cp"), &_HTMLBuilder::cp); - ClassDB::bind_method(D_METHOD("cparam"), &_HTMLBuilder::cparam); - ClassDB::bind_method(D_METHOD("cpicture"), &_HTMLBuilder::cpicture); - ClassDB::bind_method(D_METHOD("cpre"), &_HTMLBuilder::cpre); - - ClassDB::bind_method(D_METHOD("cprogress"), &_HTMLBuilder::cprogress); - ClassDB::bind_method(D_METHOD("cq"), &_HTMLBuilder::cq); - ClassDB::bind_method(D_METHOD("crp"), &_HTMLBuilder::crp); - ClassDB::bind_method(D_METHOD("crt"), &_HTMLBuilder::crt); - ClassDB::bind_method(D_METHOD("cruby"), &_HTMLBuilder::cruby); - - ClassDB::bind_method(D_METHOD("cs"), &_HTMLBuilder::cs); - ClassDB::bind_method(D_METHOD("csamp"), &_HTMLBuilder::csamp); - ClassDB::bind_method(D_METHOD("cscript"), &_HTMLBuilder::cscript); - ClassDB::bind_method(D_METHOD("csection"), &_HTMLBuilder::csection); - ClassDB::bind_method(D_METHOD("cselect"), &_HTMLBuilder::cselect); - ClassDB::bind_method(D_METHOD("csmall"), &_HTMLBuilder::csmall); - - ClassDB::bind_method(D_METHOD("csource"), &_HTMLBuilder::csource); - ClassDB::bind_method(D_METHOD("cspan"), &_HTMLBuilder::cspan); - ClassDB::bind_method(D_METHOD("cstrike"), &_HTMLBuilder::cstrike); - ClassDB::bind_method(D_METHOD("cstrong"), &_HTMLBuilder::cstrong); - - ClassDB::bind_method(D_METHOD("cstyle"), &_HTMLBuilder::cstyle); - ClassDB::bind_method(D_METHOD("csub"), &_HTMLBuilder::csub); - ClassDB::bind_method(D_METHOD("csummary"), &_HTMLBuilder::csummary); - ClassDB::bind_method(D_METHOD("csup"), &_HTMLBuilder::csup); - - ClassDB::bind_method(D_METHOD("csvg"), &_HTMLBuilder::csvg); - ClassDB::bind_method(D_METHOD("ctable"), &_HTMLBuilder::ctable); - ClassDB::bind_method(D_METHOD("ctbody"), &_HTMLBuilder::ctbody); - ClassDB::bind_method(D_METHOD("ctd"), &_HTMLBuilder::ctd); - - ClassDB::bind_method(D_METHOD("ctemplateh"), &_HTMLBuilder::ctemplateh); - ClassDB::bind_method(D_METHOD("ctextarea"), &_HTMLBuilder::ctextarea); - ClassDB::bind_method(D_METHOD("ctfoot"), &_HTMLBuilder::ctfoot); - ClassDB::bind_method(D_METHOD("cth"), &_HTMLBuilder::cth); - ClassDB::bind_method(D_METHOD("cthead"), &_HTMLBuilder::cthead); - ClassDB::bind_method(D_METHOD("ctime"), &_HTMLBuilder::ctime); - ClassDB::bind_method(D_METHOD("ctitle"), &_HTMLBuilder::ctitle); - - ClassDB::bind_method(D_METHOD("ctr"), &_HTMLBuilder::ctr); - ClassDB::bind_method(D_METHOD("ctrack"), &_HTMLBuilder::ctrack); - ClassDB::bind_method(D_METHOD("ctt"), &_HTMLBuilder::ctt); - ClassDB::bind_method(D_METHOD("cu"), &_HTMLBuilder::cu); - - ClassDB::bind_method(D_METHOD("cul"), &_HTMLBuilder::cul); - ClassDB::bind_method(D_METHOD("cvar"), &_HTMLBuilder::cvar); - ClassDB::bind_method(D_METHOD("cvideo"), &_HTMLBuilder::cvideo); - ClassDB::bind_method(D_METHOD("cwbr"), &_HTMLBuilder::cwbr); - - ClassDB::bind_method(D_METHOD("form_get", "action", "cls", "id"), &_HTMLBuilder::form_get, "", "", ""); - ClassDB::bind_method(D_METHOD("form_post", "action", "cls", "id"), &_HTMLBuilder::form_post, "", "", ""); - ClassDB::bind_method(D_METHOD("form_postr", "action", "request", "cls", "id"), &_HTMLBuilder::form_postr, "", ""); - - ClassDB::bind_method(D_METHOD("input_button", "name", "value", "cls", "id"), &_HTMLBuilder::input_button, "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_checkbox", "name", "value", "checked", "cls", "id"), &_HTMLBuilder::input_checkbox, "", "", false, "", ""); - ClassDB::bind_method(D_METHOD("input_color", "name", "value", "cls", "id"), &_HTMLBuilder::input_color, "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_date", "name", "value", "cls", "id", "date_min", "date_max", "date_step"), &_HTMLBuilder::input_date, "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_datetime_local", "name", "value", "cls", "id", "date_min", "date_max", "date_step"), &_HTMLBuilder::input_datetime_local, "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_email", "name", "value", "placeholder ", "cls", "id"), &_HTMLBuilder::input_email, "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_file", "name", "accept ", "cls", "id"), &_HTMLBuilder::input_file, "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_image", "name", "src", "alt", "cls", "id", "width", "height"), &_HTMLBuilder::input_image, "", "", "", "", "", 0, 0); - ClassDB::bind_method(D_METHOD("input_month", "name", "cls", "id"), &_HTMLBuilder::input_month, "", "", ""); - ClassDB::bind_method(D_METHOD("input_number", "name", "vmin", "vmax", "cls", "id"), &_HTMLBuilder::input_number, "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_password", "name", "value", "placeholder", "cls", "id", "minlength", "maxlength", "size"), &_HTMLBuilder::input_password, "", "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_radio", "name", "value", "cls", "id"), &_HTMLBuilder::input_radio, "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_range", "name", "value", "vmin", "vmax", "vstep", "cls", "id"), &_HTMLBuilder::input_range, "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_reset", "name", "value", "cls", "id"), &_HTMLBuilder::input_reset, "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_search", "name", "value", "placeholder ", "cls", "id", "minlength", "maxlength", "size"), &_HTMLBuilder::input_search, "", "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_submit", "value", "cls", "id"), &_HTMLBuilder::input_submit, "", "", ""); - ClassDB::bind_method(D_METHOD("input_tel", "name", "value", "placeholder", "cls", "id", "minlength", "maxlength", "size"), &_HTMLBuilder::input_tel, "", "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_text", "name", "value", "placeholder", "cls", "id", "minlength", "maxlength", "size"), &_HTMLBuilder::input_text, "", "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_time", "name", "cls", "id", "vmin", "vmax", "vstep"), &_HTMLBuilder::input_time, "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_url", "name", "value", "placeholder ", "cls", "id", "minlength", "maxlength", "size"), &_HTMLBuilder::input_url, "", "", "", "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_week", "name", "cls", "id", "vmin", "vmax"), &_HTMLBuilder::input_week, "", "", "", "", ""); - ClassDB::bind_method(D_METHOD("input_hidden", "name", "value"), &_HTMLBuilder::input_hidden, "", ""); - - ClassDB::bind_method(D_METHOD("flabel", "pfor", "plabel", "cls", "id"), &_HTMLBuilder::flabel, "", ""); - - ClassDB::bind_method(D_METHOD("csrf_token", "token"), &_HTMLBuilder::csrf_token); - ClassDB::bind_method(D_METHOD("csrf_tokenr", "request"), &_HTMLBuilder::csrf_tokenr); - - ClassDB::bind_method(D_METHOD("tag", "tag", "simple"), &_HTMLBuilder::tag, false); - ClassDB::bind_method(D_METHOD("ctag", "tag"), &_HTMLBuilder::ctag); - - ClassDB::bind_method(D_METHOD("f"), &_HTMLBuilder::f); - - ClassDB::bind_method(D_METHOD("w", "val"), &_HTMLBuilder::w); - ClassDB::bind_method(D_METHOD("wn", "val", "decimals "), &_HTMLBuilder::wn, -1); - ClassDB::bind_method(D_METHOD("wns", "val"), &_HTMLBuilder::wns); - ClassDB::bind_method(D_METHOD("wr", "val", "trailing "), &_HTMLBuilder::wr, true); - ClassDB::bind_method(D_METHOD("wi", "val", "base", "capitalize_hex"), &_HTMLBuilder::wi, 10, false); - ClassDB::bind_method(D_METHOD("wui", "val", "base", "capitalize_hex"), &_HTMLBuilder::wui, 10, false); - ClassDB::bind_method(D_METHOD("wbn", "val"), &_HTMLBuilder::wbn); - ClassDB::bind_method(D_METHOD("wbs", "val"), &_HTMLBuilder::wbs); - ClassDB::bind_method(D_METHOD("we", "val"), &_HTMLBuilder::we); - - ClassDB::bind_method(D_METHOD("write_tag"), &_HTMLBuilder::write_tag); -} diff --git a/modules/web/html/html_builder_bind.h b/modules/web/html/html_builder_bind.h deleted file mode 100644 index d5948a9..0000000 --- a/modules/web/html/html_builder_bind.h +++ /dev/null @@ -1,544 +0,0 @@ -#ifndef HTML_BUILDER_BIND_H -#define HTML_BUILDER_BIND_H - -#include "core/object/object.h" -#include "core/string/ustring.h" - -#include "core/object/reference.h" - -class _HTMLBuilder; -class WebServerRequest; - -class _HTMLTag : public Reference { - GDCLASS(_HTMLTag, Reference) - -public: - bool get_simple() const; - void set_simple(const bool val); - - String get_result(); - void set_result(const String &str); - - Ref<_HTMLTag> str(const String &str); - Ref<_HTMLTag> style(const String &val); - Ref<_HTMLTag> href(const String &val); - Ref<_HTMLTag> cls(const String &val); - Ref<_HTMLTag> clsse(const String &val); //se -> skip empty - Ref<_HTMLTag> id(const String &val); - Ref<_HTMLTag> name(const String &val); - Ref<_HTMLTag> content(const String &val); - Ref<_HTMLTag> value(const String &val); - Ref<_HTMLTag> accept(const String &val); - Ref<_HTMLTag> src(const String &val); - Ref<_HTMLTag> alt(const String &val); - Ref<_HTMLTag> inputmode(const String &val); - Ref<_HTMLTag> list(const String &val); - - Ref<_HTMLTag> rows(const String &val); - Ref<_HTMLTag> cols(const String &val); - - Ref<_HTMLTag> enctype(const String &val); - Ref<_HTMLTag> enctype_multipart_form_data(); - - Ref<_HTMLTag> autocomplete(const String &val); - - Ref<_HTMLTag> autocomplete_off(); - Ref<_HTMLTag> autocomplete_on(); - Ref<_HTMLTag> autocomplete_name(); - Ref<_HTMLTag> autocomplete_name_honorific_prefix(); - Ref<_HTMLTag> autocomplete_name_given_name(); - Ref<_HTMLTag> autocomplete_name_additional_name(); - Ref<_HTMLTag> autocomplete_name_family_name(); - Ref<_HTMLTag> autocomplete_name_honorific_suffix(); - Ref<_HTMLTag> autocomplete_name_nickname(); - Ref<_HTMLTag> autocomplete_email(); - Ref<_HTMLTag> autocomplete_username(); - Ref<_HTMLTag> autocomplete_new_password(); - Ref<_HTMLTag> autocomplete_current_password(); - Ref<_HTMLTag> autocomplete_one_time_code(); - Ref<_HTMLTag> autocomplete_organization_title(); - Ref<_HTMLTag> autocomplete_organization(); - Ref<_HTMLTag> autocomplete_street_address(); - Ref<_HTMLTag> autocomplete_address_line1(); - Ref<_HTMLTag> autocomplete_address_line2(); - Ref<_HTMLTag> autocomplete_address_line3(); - Ref<_HTMLTag> autocomplete_address_level_1(); - Ref<_HTMLTag> autocomplete_address_level_2(); - Ref<_HTMLTag> autocomplete_address_level_3(); - Ref<_HTMLTag> autocomplete_address_level_4(); - Ref<_HTMLTag> autocomplete_country(); - Ref<_HTMLTag> autocomplete_country_name(); - Ref<_HTMLTag> autocomplete_postal_code(); - Ref<_HTMLTag> autocomplete_cc_name(); - Ref<_HTMLTag> autocomplete_cc_given_name(); - Ref<_HTMLTag> autocomplete_cc_additional_name(); - Ref<_HTMLTag> autocomplete_cc_family_name(); - Ref<_HTMLTag> autocomplete_cc_number(); - Ref<_HTMLTag> autocomplete_cc_exp(); - Ref<_HTMLTag> autocomplete_cc_exp_month(); - Ref<_HTMLTag> autocomplete_cc_exp_year(); - Ref<_HTMLTag> autocomplete_cc_csc(); - Ref<_HTMLTag> autocomplete_cc_type(); - Ref<_HTMLTag> autocomplete_transaction_currency(); - Ref<_HTMLTag> autocomplete_transaction_amount(); - Ref<_HTMLTag> autocomplete_language(); - Ref<_HTMLTag> autocomplete_bday(); - Ref<_HTMLTag> autocomplete_bday_day(); - Ref<_HTMLTag> autocomplete_bday_month(); - Ref<_HTMLTag> autocomplete_bday_year(); - Ref<_HTMLTag> autocomplete_sex(); - Ref<_HTMLTag> autocomplete_tel(); - Ref<_HTMLTag> autocomplete_tel_country_code(); - Ref<_HTMLTag> autocomplete_tel_national(); - Ref<_HTMLTag> autocomplete_tel_area_code(); - Ref<_HTMLTag> autocomplete_tel_local(); - Ref<_HTMLTag> autocomplete_tel_extension(); - Ref<_HTMLTag> autocomplete_impp(); - Ref<_HTMLTag> autocomplete_url(); - Ref<_HTMLTag> autocomplete_photo(); - - Ref<_HTMLTag> onclick(const String &val); - - Ref<_HTMLTag> checked(const bool val = true); - Ref<_HTMLTag> selected(const bool val = true); - Ref<_HTMLTag> autofocus(const bool val = true); - Ref<_HTMLTag> disabled(const bool val = true); - Ref<_HTMLTag> multiple(const bool val = true); - Ref<_HTMLTag> required(const bool val = true); - Ref<_HTMLTag> spellcheck(const bool val); - - Ref<_HTMLTag> max(const String &val); - Ref<_HTMLTag> min(const String &val); - Ref<_HTMLTag> step(const String &val); - Ref<_HTMLTag> step_any(); - - Ref<_HTMLTag> minlength(const int val); - Ref<_HTMLTag> minlengths(const String &val); - Ref<_HTMLTag> maxlength(const int val); - Ref<_HTMLTag> maxlengths(const String &val); - Ref<_HTMLTag> size(const int val); - Ref<_HTMLTag> sizes(const String &val); - - Ref<_HTMLTag> width(const int val); - Ref<_HTMLTag> widths(const String &val); - Ref<_HTMLTag> height(const int val); - Ref<_HTMLTag> heights(const String &val); - - Ref<_HTMLTag> pattern(const String &val); - - Ref<_HTMLTag> method(const String &val); - Ref<_HTMLTag> method_get(); - Ref<_HTMLTag> method_post(); - - Ref<_HTMLTag> action(const String &val); - Ref<_HTMLTag> type(const String &val); - Ref<_HTMLTag> placeholder(const String &val); - Ref<_HTMLTag> fora(const String &val); // for attrib -> for is reserved keyword - - Ref<_HTMLTag> rel(const String &val); - Ref<_HTMLTag> rel_stylesheet(); - Ref<_HTMLTag> rel_alternate(); - Ref<_HTMLTag> rel_author(); - Ref<_HTMLTag> rel_bookmark(); - Ref<_HTMLTag> rel_external(); - Ref<_HTMLTag> rel_help(); - Ref<_HTMLTag> rel_license(); - Ref<_HTMLTag> rel_next(); - Ref<_HTMLTag> rel_nofollow(); - Ref<_HTMLTag> rel_noopener(); - Ref<_HTMLTag> rel_noreferrer(); - Ref<_HTMLTag> rel_prev(); - Ref<_HTMLTag> rel_search(); - Ref<_HTMLTag> rel_tag(); - - Ref<_HTMLTag> charset(const String &val); - Ref<_HTMLTag> charset_utf_8(); - - Ref<_HTMLTag> itbutton(); - Ref<_HTMLTag> itcheckbox(); - Ref<_HTMLTag> itcolor(); - Ref<_HTMLTag> itdate(); - Ref<_HTMLTag> itdatetime_local(); - Ref<_HTMLTag> itemail(); - Ref<_HTMLTag> itfile(); - Ref<_HTMLTag> ithidden(); - Ref<_HTMLTag> itimage(); - Ref<_HTMLTag> itmonth(); - Ref<_HTMLTag> itnumber(); - Ref<_HTMLTag> itpassword(); - Ref<_HTMLTag> itradio(); - Ref<_HTMLTag> itrange(); - Ref<_HTMLTag> itreset(); - Ref<_HTMLTag> itsearch(); - Ref<_HTMLTag> itsubmit(); - Ref<_HTMLTag> ittel(); - Ref<_HTMLTag> ittext(); - Ref<_HTMLTag> ittime(); - Ref<_HTMLTag> iturl(); - Ref<_HTMLTag> itweek(); - - Ref<_HTMLTag> inputmode_none(); - Ref<_HTMLTag> inputmode_text(); - Ref<_HTMLTag> inputmode_decimal(); - Ref<_HTMLTag> inputmode_numeric(); - Ref<_HTMLTag> inputmode_tel(); - Ref<_HTMLTag> inputmode_search(); - Ref<_HTMLTag> inputmode_email(); - Ref<_HTMLTag> inputmode_url(); - - Ref<_HTMLTag> attrib(const String &attr, const String &val); - - Ref<_HTMLTag> start(const String &p_new_tag, const bool p_simple = false); - Ref<_HTMLTag> reset(); - Ref<_HTMLTag> close(); - - Ref<_HTMLBuilder> f(); - - bool has_data(); - - _HTMLTag(); - - _HTMLBuilder *owner; - bool simple; - String result; - -protected: - static void _bind_methods(); -}; - -class _HTMLBuilder : public Reference { - GDCLASS(_HTMLBuilder, Reference) - -public: - String get_result(); - void set_result(const String &str); - - Ref<_HTMLBuilder> comment(const String &val); - Ref<_HTMLTag> doctype(const String &val = ""); - - Ref<_HTMLTag> a(const String &href = "", const String &cls = "", const String &id = ""); - Ref<_HTMLBuilder> fa(const String &href, const String &body, const String &cls = "", const String &id = ""); - Ref<_HTMLTag> abbr(); - Ref<_HTMLTag> acronym(); // Not supported in HTML5. - Ref<_HTMLTag> address(); - Ref<_HTMLTag> applet(); // Not supported in HTML5. - Ref<_HTMLTag> area(); - Ref<_HTMLTag> article(); - Ref<_HTMLTag> aside(); - Ref<_HTMLTag> audio(); - Ref<_HTMLTag> b(); - Ref<_HTMLTag> basefont(); // Not supported in HTML5. - Ref<_HTMLTag> bdi(); - Ref<_HTMLTag> bdo(); - Ref<_HTMLTag> big(); // Not supported in HTML5. - Ref<_HTMLTag> blockquote(); - Ref<_HTMLTag> body(); - Ref<_HTMLTag> br(); - Ref<_HTMLTag> button(); - Ref<_HTMLTag> canvas(); - Ref<_HTMLTag> caption(); - Ref<_HTMLTag> center(); // Not supported in HTML5. - Ref<_HTMLTag> cite(); - Ref<_HTMLTag> code(); - Ref<_HTMLTag> col(); - Ref<_HTMLTag> colgroup(); - Ref<_HTMLTag> data(); - Ref<_HTMLTag> datalist(); - Ref<_HTMLTag> dd(); - Ref<_HTMLTag> del(); - Ref<_HTMLTag> details(); - Ref<_HTMLTag> dfn(); - Ref<_HTMLTag> dialog(); - Ref<_HTMLTag> dir(); // Not supported in HTML5. - Ref<_HTMLTag> div(const String &cls = "", const String &id = ""); - Ref<_HTMLBuilder> fdiv(const String &body, const String &cls = "", const String &id = ""); - Ref<_HTMLTag> dl(); - Ref<_HTMLTag> dt(); - Ref<_HTMLTag> em(); - Ref<_HTMLTag> embed(); - Ref<_HTMLTag> fieldset(); - Ref<_HTMLTag> figcaption(); - Ref<_HTMLTag> figure(); - Ref<_HTMLTag> font(); // Not supported in HTML5. - Ref<_HTMLTag> footer(); - Ref<_HTMLTag> form(); - Ref<_HTMLTag> frame(); // Not supported in HTML5. - Ref<_HTMLTag> frameset(); // Not supported in HTML5. - Ref<_HTMLTag> h1(); - Ref<_HTMLTag> h2(); - Ref<_HTMLTag> h3(); - Ref<_HTMLTag> h4(); - Ref<_HTMLTag> h5(); - Ref<_HTMLTag> h6(); - Ref<_HTMLTag> head(); - Ref<_HTMLTag> header(); - Ref<_HTMLTag> hr(); - Ref<_HTMLTag> html(); - - Ref<_HTMLTag> i(); - Ref<_HTMLTag> iframe(); - Ref<_HTMLTag> img(); - Ref<_HTMLTag> input(); - Ref<_HTMLTag> ins(); - Ref<_HTMLTag> kbd(); - Ref<_HTMLTag> label(); - Ref<_HTMLTag> legend(); - Ref<_HTMLTag> li(); - Ref<_HTMLTag> link(); - Ref<_HTMLTag> main(); - Ref<_HTMLTag> map(); - Ref<_HTMLTag> mark(); - Ref<_HTMLTag> meta(); - Ref<_HTMLTag> meter(); - - Ref<_HTMLTag> nav(); - Ref<_HTMLTag> noframes(); // Not supported in HTML5. - Ref<_HTMLTag> noscript(); - Ref<_HTMLTag> objectt(); //, Like "object tag". As having a method named object() can cause issues. - Ref<_HTMLTag> ol(); - Ref<_HTMLTag> optgroup(); - Ref<_HTMLTag> option(const String &value = ""); - Ref<_HTMLBuilder> foption(const String &value, const String &body, const bool selected = false); - Ref<_HTMLTag> output(); - Ref<_HTMLTag> p(); - Ref<_HTMLTag> param(); - Ref<_HTMLTag> picture(); - Ref<_HTMLTag> pre(); - Ref<_HTMLTag> progress(); - Ref<_HTMLTag> q(); - Ref<_HTMLTag> rp(); - - Ref<_HTMLTag> rt(); - Ref<_HTMLTag> ruby(); - Ref<_HTMLTag> s(); - Ref<_HTMLTag> samp(); - Ref<_HTMLTag> script(); - Ref<_HTMLTag> section(); - Ref<_HTMLTag> select(const String &name = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> small(); - Ref<_HTMLTag> source(); - Ref<_HTMLTag> span(); - Ref<_HTMLTag> strike(); // Not supported in HTML5 - Ref<_HTMLTag> strong(); - Ref<_HTMLTag> style(); - Ref<_HTMLTag> sub(); - Ref<_HTMLTag> summary(); - Ref<_HTMLTag> sup(); - - Ref<_HTMLTag> svg(); - Ref<_HTMLTag> table(); - Ref<_HTMLTag> tbody(); - Ref<_HTMLTag> td(); - Ref<_HTMLTag> templateh(); - Ref<_HTMLTag> textarea(const String &name = "", const String &cls = "", const String &id = ""); - Ref<_HTMLBuilder> ftextarea(const String &name, const String &body, const String &cls = "", const String &id = ""); - Ref<_HTMLTag> tfoot(); - Ref<_HTMLTag> th(); - Ref<_HTMLTag> thead(); - Ref<_HTMLTag> time(); - Ref<_HTMLTag> title(); - Ref<_HTMLTag> tr(); - Ref<_HTMLTag> track(); - Ref<_HTMLTag> tt(); // Not supported in HTML5. - Ref<_HTMLTag> u(); - Ref<_HTMLTag> ul(); - Ref<_HTMLTag> var(); - Ref<_HTMLTag> video(); - Ref<_HTMLTag> wbr(); - - // closing tags c prefix means close - // Note simple tags should not have these like
- // Note that I might have a few that shouldn't be here, those will be removed as I find them - Ref<_HTMLBuilder> ca(); - Ref<_HTMLBuilder> cabbr(); - Ref<_HTMLBuilder> cacronym(); - Ref<_HTMLBuilder> caddress(); - Ref<_HTMLBuilder> capplet(); - Ref<_HTMLBuilder> carea(); - Ref<_HTMLBuilder> carticle(); - Ref<_HTMLBuilder> caside(); - Ref<_HTMLBuilder> caudio(); - Ref<_HTMLBuilder> cb(); - Ref<_HTMLBuilder> cbasefont(); - Ref<_HTMLBuilder> cbdi(); - Ref<_HTMLBuilder> cbdo(); - Ref<_HTMLBuilder> cbig(); - Ref<_HTMLBuilder> cblockquote(); - Ref<_HTMLBuilder> cbody(); - Ref<_HTMLBuilder> cbutton(); - Ref<_HTMLBuilder> ccanvas(); - - Ref<_HTMLBuilder> ccaption(); - Ref<_HTMLBuilder> ccenter(); - Ref<_HTMLBuilder> ccite(); - Ref<_HTMLBuilder> ccode(); - Ref<_HTMLBuilder> ccol(); - Ref<_HTMLBuilder> ccolgroup(); - Ref<_HTMLBuilder> cdata(); - Ref<_HTMLBuilder> cdatalist(); - Ref<_HTMLBuilder> cdd(); - Ref<_HTMLBuilder> cdel(); - Ref<_HTMLBuilder> cdetails(); - Ref<_HTMLBuilder> cdfn(); - Ref<_HTMLBuilder> cdialog(); - Ref<_HTMLBuilder> cdir(); - Ref<_HTMLBuilder> cdiv(); - Ref<_HTMLBuilder> cdl(); - Ref<_HTMLBuilder> cdt(); - - Ref<_HTMLBuilder> cem(); - Ref<_HTMLBuilder> cembed(); - Ref<_HTMLBuilder> cfieldset(); - Ref<_HTMLBuilder> cfigcaption(); - Ref<_HTMLBuilder> cfigure(); - Ref<_HTMLBuilder> cfont(); - Ref<_HTMLBuilder> cfooter(); - Ref<_HTMLBuilder> cform(); - Ref<_HTMLBuilder> cframe(); - Ref<_HTMLBuilder> cframeset(); - Ref<_HTMLBuilder> ch1(); - Ref<_HTMLBuilder> ch2(); - Ref<_HTMLBuilder> ch3(); - Ref<_HTMLBuilder> ch4(); - Ref<_HTMLBuilder> ch5(); - Ref<_HTMLBuilder> ch6(); - Ref<_HTMLBuilder> chead(); - Ref<_HTMLBuilder> cheader(); - Ref<_HTMLBuilder> chr(); - Ref<_HTMLBuilder> chtml(); - - Ref<_HTMLBuilder> ci(); - Ref<_HTMLBuilder> ciframe(); - Ref<_HTMLBuilder> cimg(); - Ref<_HTMLBuilder> cinput(); - Ref<_HTMLBuilder> cins(); - Ref<_HTMLBuilder> ckbd(); - Ref<_HTMLBuilder> clabel(); - Ref<_HTMLBuilder> clegend(); - Ref<_HTMLBuilder> cli(); - Ref<_HTMLBuilder> clink(); - Ref<_HTMLBuilder> cmain(); - Ref<_HTMLBuilder> cmap(); - Ref<_HTMLBuilder> cmark(); - Ref<_HTMLBuilder> cmeta(); - Ref<_HTMLBuilder> cmeter(); - - Ref<_HTMLBuilder> cnav(); - Ref<_HTMLBuilder> cnoframes(); - Ref<_HTMLBuilder> cnoscript(); - Ref<_HTMLBuilder> cobjectt(); - Ref<_HTMLBuilder> c_ol(); - Ref<_HTMLBuilder> coptgroup(); - Ref<_HTMLBuilder> coption(); - Ref<_HTMLBuilder> coutput(); - Ref<_HTMLBuilder> cp(); - Ref<_HTMLBuilder> cparam(); - Ref<_HTMLBuilder> cpicture(); - Ref<_HTMLBuilder> cpre(); - Ref<_HTMLBuilder> cprogress(); - Ref<_HTMLBuilder> cq(); - Ref<_HTMLBuilder> crp(); - - Ref<_HTMLBuilder> crt(); - Ref<_HTMLBuilder> cruby(); - Ref<_HTMLBuilder> cs(); - Ref<_HTMLBuilder> csamp(); - Ref<_HTMLBuilder> cscript(); - Ref<_HTMLBuilder> csection(); - Ref<_HTMLBuilder> cselect(); - Ref<_HTMLBuilder> csmall(); - Ref<_HTMLBuilder> csource(); - Ref<_HTMLBuilder> cspan(); - Ref<_HTMLBuilder> cstrike(); - Ref<_HTMLBuilder> cstrong(); - Ref<_HTMLBuilder> cstyle(); - Ref<_HTMLBuilder> csub(); - Ref<_HTMLBuilder> csummary(); - Ref<_HTMLBuilder> csup(); - - Ref<_HTMLBuilder> csvg(); - Ref<_HTMLBuilder> ctable(); - Ref<_HTMLBuilder> ctbody(); - Ref<_HTMLBuilder> ctd(); - Ref<_HTMLBuilder> ctemplateh(); - Ref<_HTMLBuilder> ctextarea(); - Ref<_HTMLBuilder> ctfoot(); - Ref<_HTMLBuilder> cth(); - Ref<_HTMLBuilder> cthead(); - Ref<_HTMLBuilder> ctime(); - Ref<_HTMLBuilder> ctitle(); - Ref<_HTMLBuilder> ctr(); - Ref<_HTMLBuilder> ctrack(); - Ref<_HTMLBuilder> ctt(); - Ref<_HTMLBuilder> cu(); - Ref<_HTMLBuilder> cul(); - Ref<_HTMLBuilder> cvar(); - Ref<_HTMLBuilder> cvideo(); - Ref<_HTMLBuilder> cwbr(); - - Ref<_HTMLTag> form_get(const String &action = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> form_post(const String &action = "", const String &cls = "", const String &id = ""); - // will add a csrf token from request - Ref<_HTMLBuilder> form_postr(const String &action, Ref request, const String &cls = "", const String &id = ""); - - Ref<_HTMLTag> input_button(const String &name = "", const String &value = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_checkbox(const String &name = "", const String &value = "", const bool checked = false, const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_color(const String &name = "", const String &value = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_date(const String &name = "", const String &value = "", const String &cls = "", const String &id = "", const String &date_min = "", const String &date_max = "", const String &date_step = ""); - Ref<_HTMLTag> input_datetime_local(const String &name = "", const String &value = "", const String &cls = "", const String &id = "", const String &date_min = "", const String &date_max = "", const String &date_step = ""); - Ref<_HTMLTag> input_email(const String &name = "", const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_file(const String &name = "", const String &accept = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_image(const String &name = "", const String &src = "", const String &alt = "", const String &cls = "", const String &id = "", const int width = 0, const int height = 0); - Ref<_HTMLTag> input_month(const String &name = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_number(const String &name = "", const String &vmin = "", const String &vmax = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_password(const String &name = "", const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = ""); - Ref<_HTMLTag> input_radio(const String &name = "", const String &value = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_range(const String &name = "", const String &value = "", const String &vmin = "", const String &vmax = "", const String &vstep = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_reset(const String &name = "", const String &value = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_search(const String &name = "", const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = "", const String &pattern = ""); - Ref<_HTMLTag> input_submit(const String &value = "", const String &cls = "", const String &id = ""); - Ref<_HTMLTag> input_tel(const String &name = "", const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = "", const String &pattern = ""); - Ref<_HTMLTag> input_text(const String &name = "", const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = ""); - Ref<_HTMLTag> input_time(const String &name = "", const String &cls = "", const String &id = "", const String &vmin = "", const String &vmax = "", const String &vstep = ""); - Ref<_HTMLTag> input_url(const String &name = "", const String &value = "", const String &placeholder = "", const String &cls = "", const String &id = "", const String &minlength = "", const String &maxlength = "", const String &size = ""); - Ref<_HTMLTag> input_week(const String &name = "", const String &cls = "", const String &id = "", const String &vmin = "", const String &vmax = ""); - Ref<_HTMLTag> input_hidden(const String &name = "", const String &value = ""); - - Ref<_HTMLBuilder> flabel(const String &pfor, const String &plabel, const String &cls = "", const String &id = ""); - - Ref<_HTMLBuilder> csrf_token(const String &token); - Ref<_HTMLBuilder> csrf_tokenr(Ref request); - - Ref<_HTMLTag> tag(const String &p_tag, const bool p_simple = false); - Ref<_HTMLBuilder> ctag(const String &p_tag); - - void f(); - - // write - Ref<_HTMLBuilder> w(const String &val); - - Ref<_HTMLBuilder> wn(const double val, int p_decimals = -1); - Ref<_HTMLBuilder> wns(const double val); - Ref<_HTMLBuilder> wr(const double val, const bool p_trailing = true); - Ref<_HTMLBuilder> wi(const int64_t val, const int base = 10, const bool capitalize_hex = false); - Ref<_HTMLBuilder> wui(const uint64_t val, const int base = 10, const bool capitalize_hex = false); - Ref<_HTMLBuilder> wbn(const bool val); - Ref<_HTMLBuilder> wbs(const bool val); - - // write_escaped - Ref<_HTMLBuilder> we(const String &val); - - Ref<_HTMLBuilder> write_tag(); - - _HTMLBuilder(); - virtual ~_HTMLBuilder(); - - String result; - -protected: - static void _bind_methods(); - - Ref<_HTMLTag> _tag; -}; - -#endif diff --git a/modules/web/html/html_parser.cpp b/modules/web/html/html_parser.cpp deleted file mode 100644 index dcc09f9..0000000 --- a/modules/web/html/html_parser.cpp +++ /dev/null @@ -1,872 +0,0 @@ -#include "html_parser.h" - -#include "core/error/error_macros.h" -#include "core/log/logger.h" -#include "core/object/class_db.h" - -String HTMLParserAttribute::get_attribute() { - return _attribute; -} -void HTMLParserAttribute::set_attribute(const String &val) { - _attribute = val; -} - -String HTMLParserAttribute::get_data() { - return _data; -} -void HTMLParserAttribute::set_data(const String &val) { - _data = val; -} - -bool HTMLParserAttribute::get_single() { - return _single; -} -void HTMLParserAttribute::set_single(const bool &val) { - _single = val; -} - -bool HTMLParserAttribute::match_attrib(const String &attrib) { - return _attribute == attrib; -} -bool HTMLParserAttribute::match_data(const String &d) { - return _data == d; -} -bool HTMLParserAttribute::match_all_data(const Vector &d) { - // todo - return false; -} -bool HTMLParserAttribute::match_all_data_bind(const PoolStringArray &d) { - // todo - return false; -} -bool HTMLParserAttribute::contains_data(const String &d) { - return _data.find(d) != -1; -} - -String HTMLParserAttribute::convert_to_string() const { - if (_single) { - return _attribute; - } - - if (_data.find("\"") == -1) { - return _attribute + "=\"" + _data + "\""; - } else { - return _attribute + "=\'" + _data + "\'"; - } -} - -void HTMLParserAttribute::print() const { - PLOG_MSG(convert_to_string()); -} - -HTMLParserAttribute::HTMLParserAttribute() { - _single = false; -} - -HTMLParserAttribute::~HTMLParserAttribute() { -} - -void HTMLParserAttribute::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_attribute"), &HTMLParserAttribute::get_attribute); - ClassDB::bind_method(D_METHOD("set_attribute", "val"), &HTMLParserAttribute::set_attribute); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "attribute"), "set_attribute", "get_attribute"); - - ClassDB::bind_method(D_METHOD("get_data"), &HTMLParserAttribute::get_data); - ClassDB::bind_method(D_METHOD("set_data", "val"), &HTMLParserAttribute::set_data); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "data"), "set_data", "get_data"); - - ClassDB::bind_method(D_METHOD("get_single"), &HTMLParserAttribute::get_single); - ClassDB::bind_method(D_METHOD("set_single", "val"), &HTMLParserAttribute::set_single); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "single"), "set_single", "get_single"); - - ClassDB::bind_method(D_METHOD("match_attrib", "attrib"), &HTMLParserAttribute::match_attrib); - ClassDB::bind_method(D_METHOD("match_data", "data"), &HTMLParserAttribute::match_data); - ClassDB::bind_method(D_METHOD("match_all_data", "data"), &HTMLParserAttribute::match_all_data_bind); - ClassDB::bind_method(D_METHOD("contains_data", "data"), &HTMLParserAttribute::contains_data); - - ClassDB::bind_method(D_METHOD("convert_to_string"), &HTMLParserAttribute::convert_to_string); - ClassDB::bind_method(D_METHOD("print"), &HTMLParserAttribute::print); -}; - -int HTMLParserTag::get_type() { - return _type; -} -void HTMLParserTag::set_type(const int &val) { - _type = val; -} - -String HTMLParserTag::get_tag() { - return _tag; -} -void HTMLParserTag::set_tag(const String &val) { - _tag = val; -} - -String HTMLParserTag::get_data() { - return _data; -} -void HTMLParserTag::set_data(const String &val) { - _data = val; -} - -void HTMLParserTag::add_child_tag(const Ref &tag) { - _tags.push_back(tag); -} -void HTMLParserTag::remote_child_tag(const int index) { - ERR_FAIL_INDEX(index, _tags.size()); - - _tags.remove(index); -} -Ref HTMLParserTag::get_child_tag(const int index) { - ERR_FAIL_INDEX_V(index, _tags.size(), Ref()); - - return _tags[index]; -} -int HTMLParserTag::get_child_tag_count() const { - return _tags.size(); -} -void HTMLParserTag::clear_child_tags() { - _tags.clear(); -} - -Vector HTMLParserTag::get_child_tags() { - Vector r; - for (int i = 0; i < _tags.size(); i++) { - r.push_back(_tags[i].get_ref_ptr()); - } - return r; -} - -void HTMLParserTag::set_child_tags(const Vector &val) { - _tags.clear(); - for (int i = 0; i < val.size(); i++) { - Ref e = Ref(val[i]); - _tags.push_back(e); - } -} - -void HTMLParserTag::add_child_attribute(const Ref &tag) { - _attributes.push_back(tag); -} -void HTMLParserTag::remote_child_attribute(const int index) { - ERR_FAIL_INDEX(index, _tags.size()); - - _attributes.remove(index); -} -Ref HTMLParserTag::get_child_attribute(const int index) { - ERR_FAIL_INDEX_V(index, _tags.size(), Ref()); - - return _attributes[index]; -} -int HTMLParserTag::get_child_attribute_count() const { - return _attributes.size(); -} -void HTMLParserTag::clear_child_attributes() { - _attributes.clear(); -} - -Vector HTMLParserTag::get_attributes() { - Vector r; - for (int i = 0; i < _attributes.size(); i++) { - r.push_back(_attributes[i].get_ref_ptr()); - } - return r; -} - -void HTMLParserTag::set_attributes(const Vector &val) { - _attributes.clear(); - for (int i = 0; i < val.size(); i++) { - Ref e = Ref(val[i]); - _attributes.push_back(e); - } -} - -Ref HTMLParserTag::get_first(const String &t) { - if (_tag == t) { - return Ref(this); - } - - for (int i = 0; i < _tags.size(); ++i) { - Ref ht = _tags.write[i]->get_first(t); - - if (ht.is_valid()) { - return ht; - } - } - - return Ref(); -} - -Ref HTMLParserTag::get_firstc(const String &t, const String &attrib, const String &val) { - if (_tag == t) { - if (has_attributec(attrib, val)) { - return Ref(this); - } - } - - for (int i = 0; i < _tags.size(); ++i) { - Ref ht = _tags.write[i]->get_firstc(t, attrib, val); - - if (ht.is_valid()) { - return ht; - } - } - - return Ref(); -} - -String HTMLParserTag::get_attribute_value(const String &attrib) { - Ref a = get_attribute(attrib); - - if (a.is_valid()) { - return a->get_data(); - } - - return ""; -} - -Ref HTMLParserTag::get_attribute(const String &attrib) { - for (int i = 0; i < _attributes.size(); ++i) { - Ref a = _attributes[i]; - - if (a->match_attrib(attrib)) { - return a; - } - } - - return Ref(); -} - -bool HTMLParserTag::has_attribute(const String &attrib) { - for (int i = 0; i < _attributes.size(); ++i) { - Ref a = _attributes[i]; - - if (a->match_attrib(attrib)) { - return true; - } - } - - return false; -} - -Ref HTMLParserTag::get_attributec(const String &attrib, const String &contains_val) { - for (int i = 0; i < _attributes.size(); ++i) { - Ref a = _attributes[i]; - - if (a->match_attrib(attrib) && a->contains_data(contains_val)) { - return a; - } - } - - return Ref(); -} - -bool HTMLParserTag::has_attributec(const String &attrib, const String &contains_val) { - for (int i = 0; i < _attributes.size(); ++i) { - Ref a = _attributes[i]; - - if (a->match_attrib(attrib) && a->contains_data(contains_val)) { - return true; - } - } - - return false; -} - -void HTMLParserTag::process() { - if (_type != HTMLParserTag::HTML_PARSER_TAG_TYPE_NONE) { - return; - } - - if (_data.length() < 2) { - return; - } - - ERR_FAIL_COND(_data[0] != '<'); - ERR_FAIL_COND(_data[_data.length() - 1] != '>'); - - int start_index = 1; - if (_data[1] == '/') { - ++start_index; - - _type = HTMLParserTag::HTML_PARSER_TAG_TYPE_CLOSING_TAG; - } else if (_data[1] == '!') { - if (_data.length() < 8) { - return; - } - - // test for comment. - ++start_index; - if (_data[2] == '-' && _data[3] == '-') { - _type = HTMLParserTag::HTML_PARSER_TAG_TYPE_COMMENT; - - int comment_start_index = _data.find_char(' ', 3); - - if (comment_start_index == -1) { - comment_start_index = 4; - } - - _tag = _data.substr(comment_start_index, _data.length() - comment_start_index - 3); - } - - if (_data.length() < 11) { - return; - } - - // test for doctype. - if (_data.substr(2, 8).to_lower() != "doctype ") { - return; - } - - _type = HTMLParserTag::HTML_PARSER_TAG_TYPE_DOCTYPE; - - _tag = _data.substr(2 + 8, _data.length() - 2 - 8 - 1); - } else { - String tag_text; - - if (_data[_data.length() - 2] == '/') { - // will catch all that looks like
- // tags that look like
will be caught later in a post process, in a way - // which also tries to catch erroneously not closed tags that supposed to be closed - _type = HTMLParserTag::HTML_PARSER_TAG_TYPE_SELF_CLOSING_TAG; - - tag_text = _data.substr(1, _data.length() - 3); - } else { - _type = HTMLParserTag::HTML_PARSER_TAG_TYPE_OPENING_TAG; - - tag_text = _data.substr(1, _data.length() - 2); - } - - int fspc_index = tag_text.find_char(' '); - - if (fspc_index == -1) { - // no args - _tag = tag_text; - return; - } - - // grab the tag itself - _tag = tag_text.substr(0, fspc_index); - - if (fspc_index + 1 == tag_text.length()) { - // no args, but had a space like
- return; - } - - String args = tag_text.substr(fspc_index + 1, tag_text.length() - fspc_index - 1); - parse_args(args); - } - - int tag_end_index = _data.find_char(' ', start_index); - - if (tag_end_index == -1) { - // simple tag - _tag = _data.substr(start_index, _data.length() - start_index - 1); - return; - } -} - -void HTMLParserTag::parse_args(const String &args) { - _attributes.clear(); - - int i = 0; - while (i < args.length()) { - if (args[i] == ' ') { - //"trim" - ++i; - continue; - } - - int equals_index = args.find_char('=', i); - - Ref a; - a.instance(); - - if (equals_index == -1) { - a->set_attribute(args.substr(i, args.length() - i)); - a->set_single(true); - _attributes.push_back(a); - - return; - } - - a->set_attribute(args.substr(i, equals_index - i)); - - // todo - // a.trim(); - - int next_char_index = equals_index + 1; - - if (next_char_index >= args.length()) { - // an attribute looks like this "... attrib=" - _attributes.push_back(a); - return; - } - - // skip spaces - while (args[next_char_index] == ' ') { - ++next_char_index; - - if (next_char_index >= args.length()) { - // an attribute looks like this "... attrib= " - _attributes.push_back(a); - return; - } - } - - char c = args[next_char_index]; - char find_char = ' '; - - if (c == '"' || c == '\'') { - ++next_char_index; - find_char = c; - } - - int end_index = args.find_char(find_char, next_char_index); - - if (end_index == -1) { - // missing closing ' or " if c is ' or " - // else missing parameter - - a->set_data(args.substr(next_char_index, args.length() - next_char_index - 1)); - _attributes.push_back(a); - return; - } - - a->set_data(args.substr(next_char_index, end_index - next_char_index)); - _attributes.push_back(a); - - i = end_index + 1; - } -} - -String HTMLParserTag::convert_to_string(const int level) const { - String s; - - s += String(" ").repeat(level); - - if (_type == HTML_PARSER_TAG_TYPE_CONTENT) { - s += _data + "\n"; - - if (_tags.size() != 0) { - s += String(" ").repeat(level); - s += "(!CONTENT TAG HAS TAGS!)\n"; - - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(level + 1) + "\n"; - } - } - } else if (_type == HTML_PARSER_TAG_TYPE_OPENING_TAG) { - int ln = level + 1; - - s += "<" + _tag; - - for (int i = 0; i < _attributes.size(); ++i) { - s += " " + _attributes[i]->convert_to_string(); - } - - s += ">\n"; - - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(ln); - } - - s += String(" ").repeat(level); - - s += "\n"; - } else if (_type == HTML_PARSER_TAG_TYPE_CLOSING_TAG) { - // HTMLParserTag should handle this automatically - // it's here for debugging purposes though - s += ""; - - if (_tags.size() != 0) { - s += String(" ").repeat(level); - s += "(!CLOSING TAG HAS TAGS!)\n"; - - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(level + 1) + "\n"; - } - } - } else if (_type == HTML_PARSER_TAG_TYPE_SELF_CLOSING_TAG) { - s += "<" + _tag; - - for (int i = 0; i < _attributes.size(); ++i) { - s += " " + _attributes[i]->convert_to_string(); - } - - s += "/>\n"; - - if (_tags.size() != 0) { - s += String(" ").repeat(level); - s += "(!SELF CLOSING TAG HAS TAGS!)\n"; - - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(level + 1) + "\n"; - } - } - } else if (_type == HTML_PARSER_TAG_TYPE_COMMENT) { - s += "\n"; - - if (_tags.size() != 0) { - s += String(" ").repeat(level); - s += "(!COMMENT TAG HAS TAGS!)\n"; - - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(level + 1) + "\n"; - } - } - } else if (_type == HTML_PARSER_TAG_TYPE_DOCTYPE) { - s += _data + "\n"; - - if (_tags.size() != 0) { - s += String(" ").repeat(level); - s += "(!DOCTYPE TAG HAS TAGS!)\n"; - - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(level + 1) + "\n"; - } - } - } else if (_type == HTML_PARSER_TAG_TYPE_NONE) { - s += _data + "\n"; - for (int i = 0; i < _tags.size(); ++i) { - s += _tags[i]->convert_to_string(level) + "\n"; - s += String(" ").repeat(level); - } - } - - return s; -} -void HTMLParserTag::print() const { - PLOG_MSG(convert_to_string()); -} - -HTMLParserTag::HTMLParserTag() { - _type = HTMLParserTag::HTML_PARSER_TAG_TYPE_NONE; -} - -HTMLParserTag::~HTMLParserTag() { - _tags.clear(); - _attributes.clear(); -} - -void HTMLParserTag::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_type"), &HTMLParserTag::get_type); - ClassDB::bind_method(D_METHOD("set_type", "val"), &HTMLParserTag::set_type); - ADD_PROPERTY(PropertyInfo(Variant::INT, "type"), "set_type", "get_type"); - - ClassDB::bind_method(D_METHOD("get_tag"), &HTMLParserTag::get_tag); - ClassDB::bind_method(D_METHOD("set_tag", "val"), &HTMLParserTag::set_tag); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "tag"), "set_tag", "get_tag"); - - ClassDB::bind_method(D_METHOD("get_data"), &HTMLParserTag::get_data); - ClassDB::bind_method(D_METHOD("set_data", "val"), &HTMLParserTag::set_data); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "data"), "set_data", "get_data"); - - ClassDB::bind_method(D_METHOD("add_child_tag", "tag"), &HTMLParserTag::add_child_tag); - ClassDB::bind_method(D_METHOD("remote_child_tag", "index"), &HTMLParserTag::remote_child_tag); - ClassDB::bind_method(D_METHOD("get_child_tag", "index"), &HTMLParserTag::get_child_tag); - ClassDB::bind_method(D_METHOD("get_child_tag_count"), &HTMLParserTag::get_child_tag_count); - ClassDB::bind_method(D_METHOD("clear_child_tags"), &HTMLParserTag::clear_child_tags); - - ClassDB::bind_method(D_METHOD("get_child_tags"), &HTMLParserTag::get_child_tags); - ClassDB::bind_method(D_METHOD("set_child_tags", "val"), &HTMLParserTag::set_child_tags); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "child_tags", PROPERTY_HINT_NONE, "23/20:HTMLParserTag", PROPERTY_USAGE_DEFAULT, "HTMLParserTag"), "set_child_tags", "get_child_tags"); - - ClassDB::bind_method(D_METHOD("add_child_attribute", "tag"), &HTMLParserTag::add_child_attribute); - ClassDB::bind_method(D_METHOD("remote_child_attribute", "index"), &HTMLParserTag::remote_child_attribute); - ClassDB::bind_method(D_METHOD("get_child_attribute", "index"), &HTMLParserTag::get_child_attribute); - ClassDB::bind_method(D_METHOD("get_child_attribute_count"), &HTMLParserTag::get_child_attribute_count); - ClassDB::bind_method(D_METHOD("clear_child_attributes"), &HTMLParserTag::clear_child_attributes); - - ClassDB::bind_method(D_METHOD("get_attributes"), &HTMLParserTag::get_attributes); - ClassDB::bind_method(D_METHOD("set_attributes", "val"), &HTMLParserTag::set_attributes); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "attributes", PROPERTY_HINT_NONE, "23/20:HTMLParserAttribute", PROPERTY_USAGE_DEFAULT, "HTMLParserAttribute"), "set_attributes", "get_attributes"); - - ClassDB::bind_method(D_METHOD("get_first", "t"), &HTMLParserTag::get_first); - ClassDB::bind_method(D_METHOD("get_firstc", "t", "attrib", "val"), &HTMLParserTag::get_firstc); - - ClassDB::bind_method(D_METHOD("get_attribute_value", "attrib"), &HTMLParserTag::get_attribute_value); - - ClassDB::bind_method(D_METHOD("get_attribute", "attrib"), &HTMLParserTag::get_attribute); - ClassDB::bind_method(D_METHOD("has_attribute", "attrib"), &HTMLParserTag::has_attribute); - - ClassDB::bind_method(D_METHOD("get_attributec", "attrib", "contains_val"), &HTMLParserTag::get_attributec); - ClassDB::bind_method(D_METHOD("has_attributec", "attrib", "contains_val"), &HTMLParserTag::has_attributec); - - ClassDB::bind_method(D_METHOD("process"), &HTMLParserTag::process); - ClassDB::bind_method(D_METHOD("parse_args", "args"), &HTMLParserTag::parse_args); - - ClassDB::bind_method(D_METHOD("convert_to_string", "level"), &HTMLParserTag::convert_to_string, 0); - ClassDB::bind_method(D_METHOD("print"), &HTMLParserTag::print); - - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_NONE); - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_OPENING_TAG); - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_CLOSING_TAG); - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_SELF_CLOSING_TAG); - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_COMMENT); - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_DOCTYPE); - BIND_ENUM_CONSTANT(HTML_PARSER_TAG_TYPE_CONTENT); -} - -Ref HTMLParser::get_root() { - return _root; -} - -void HTMLParser::parse(const String &data) { - Vector> tags; - - //