AutoConnectStyle documentation

pull/110/head
Hieromon Ikasamo 5 years ago
parent 7667db0038
commit e0785e14ca
  1. 135
      mkdocs/acelements.md
  2. 199
      mkdocs/apielements.md
  3. 7
      mkdocs/changelog.md

@ -9,12 +9,18 @@ Representative HTML elements for making the custom Web page are provided as Auto
- [AutoConnectInput](#autoconnectinput): Labeled text input box
- [AutoConnectRadio](#autoconnectradio): Labeled radio button
- [AutoConnectSelect](#autoconnectselect): Selection list
- [AutoConnectStyle](#autoconnectstyle): Custom CSS code
- [AutoConnectSubmit](#autoconnectsubmit): Submit button
- [AutoConnectText](#autoconnecttext): Style attributed text
## Layout on a custom Web page
The elements of the page created by AutoConnectElements are aligned vertically exclude the [AutoConnectRadio](#autoconnectradio). You can specify the direction to arrange the radio buttons as AutoConnectRadio vertically or horizontally. This basic layout depends on the CSS of the AutoConnect menu so you can not change drastically.
AutoConnect will not actively be involved in the layout of custom Web pages generated from AutoConnectElements. However, each element has [an attribute to arrange placement](#post) on a custom web page by horizontally or vertically.
## Custom CSS for a custom Web page
All custom Web page styles are limited to the built-in unique CSS embedded in the library code. Direct modification of the CSS affects AutoConnect behavior. You can use dedicated elements to relatively safely modify the style of your custom Web page.
The [AutoConnectStyle](#autoconnectstyle) will insert the raw CSS code into the style block in HTML of the custom Web page.
## Form and AutoConnectElements
@ -32,7 +38,7 @@ AutoConnectElement is a base class for other element classes and has common attr
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectElement(const char* name, const char* value)
AutoConnectElement(const char* name, const char* value, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -43,6 +49,29 @@ Each element has a name. The **name** is the String data type. You can identify
The **value** is the string which is a source to generate an HTML code. Characteristics of Value vary depending on the element. The value of AutoConnectElement is native HTML code. A string of value is output as HTML as it is.
### <i class="fa fa-caret-right"></i> post
The **post** specifies a tag to add behind the HTML code generated from the element. Its purpose is to place elements on the custom Web page as intended by the user sketch.
AutoConnect will not actively be involved in the layout of custom Web pages generated from AutoConnectElements. Each element follows behind the previous one, with the exception of some elements. You can use the **post** value to arrange vertically or horizontal when the elements do not have the intended position on the custom Web Page specifying the following enumeration value as **ACPosterior_t** type for the **post**.
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
The default interpretation of the post value is specific to each element.
AutoConnectElements | Default interpretation of the post value
----|----
AutoConnectElement | AC_Tag_None
AutoConnectButton | AC_Tag_None
AutoConnectCheckBox | AC_Tag_BR
AutoConnectFile | AC_Tag_BR
AutoConnectInput | AC_Tag_BR
AutoConnectRadio | AC_Tag_BR
AutoConnectSelect | AC_Tag_BR
AutoConnectSubmit | AC_Tag_None
AutoConnectText | AC_Tag_None
### <i class="fa fa-caret-right"></i> type
The **type** indicates the type of the element and represented as the *ACElement_t* enumeration type in the sketch. Since AutoConnectElement also acts as a variant of other elements, it can be applied to handle elements collectively. At that time, the type can be referred to by the [**typeOf()**](apielements.md#typeof) function. The following example changes the font color of all [AutoConnectText](#autoconnecttext) elements of a custom Web page to gray.
@ -68,6 +97,7 @@ The enumerators for *ACElement_t* are as follows:
- AutoConnectInput: **AC_Input**
- AutoConnectRadio: **AC_Radio**
- AutoConnectSelect: **AC_Select**
- AutoConnectStyle: **AC_Style**
- AutoConnectSubmit: **AC_Submit**
- AutoConnectText: **AC_Text**
- Uninitialized element: **AC_Unknown**
@ -100,7 +130,7 @@ AutoConnectButton generates an HTML `#!html <button type="button">` tag and loca
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectButton(const char* name, const char* value, const String& action)
AutoConnectButton(const char* name, const char* value, const String& action, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -131,6 +161,10 @@ ACButton(Button, "COPY", "CopyText()");
ACElement(TextCopy, scCopyText);
```
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_None`.
## AutoConnectCheckbox
AutoConnectCheckbox generates an HTML `#!html <input type="checkbox">` tag and a `#!html <label>` tag. It places horizontally on a custom Web page by default.
@ -143,7 +177,7 @@ AutoConnectCheckbox generates an HTML `#!html <input type="checkbox">` tag and a
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectCheckbox(const char* name, const char* value, const char* label, const bool checked)
AutoConnectCheckbox(const char* name, const char* value, const char* label, const bool checked, const ACPosition_t labelPosition, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -163,9 +197,20 @@ Only <i class="far fa-square"></i> will be displayed if a label is not specified
A checked is a Boolean value and indicates the checked status of the checkbox. The value of the checked checkbox element is packed in the query string and sent.
### <i class="fa fa-caret-right"></i> labelPosition
The position of the label belonging to the checkbox can be specified around the element. The labelPosition specifies the position of the label to generate with **ACPostion_t** enumeration value. The default value is `AC_Behind`.
- **`AC_Infront`** : Place a label in front of the check box.
- **`AC_Behind`** : Place a label behind the check box.
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_BR`.
## AutoConnectFile
AutoConnectFile generates asn HTML `#!html <input type="file">` tag and a `#!html <label>` tag. AutoConnectFile enables file upload from the client through the web browser to ESP8266/ESP32 module. You can select the flash in the module, external SD device or any output destination as the storage of the uploaded file.
AutoConnectFile generates an HTML `#!html <input type="file">` tag and a `#!html <label>` tag. AutoConnectFile enables file upload from the client through the web browser to ESP8266/ESP32 module. You can select the flash in the module, external SD device or any output destination as the storage of the uploaded file.
<i class="fa fa-eye"></i> **Sample**<br>
<small>**`AutoConnectFile file("file", "", "Upload:", AC_File_FS)`**</small>
@ -175,7 +220,7 @@ AutoConnectFile generates asn HTML `#!html <input type="file">` tag and a `#!htm
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectFile(const char* name, const char* value, const char* label, const ACFile_t store)
AutoConnectFile(const char* name, const char* value, const char* label, const ACFile_t store, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -201,6 +246,10 @@ Specifies the destination to save the uploaded file. The destination can be spec
!!! note "Built-in uploader is ready."
AutoConnect already equips the built-in uploader for saving to the SPIFFS as AC_File_FS and the external SD as AC_File_SD. It is already implemented inside AutoConnect and will store uploaded file automatically.
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_BR`.
## AutoConnectInput
AutoConnectInput generates an HTML `#!html <input type="text">` tag and a `#!html <label>` tag. It can also have a placeholder. The value of the input box is passed to the destination in the query string and can be retrieved programmatically. You can also update from the sketches.
@ -213,7 +262,7 @@ AutoConnectInput generates an HTML `#!html <input type="text">` tag and a `#!htm
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectInput(const char* name, const char* value, const char* label, const char* pattern, const char* placeholder)
AutoConnectInput(const char* name, const char* value, const char* label, const char* pattern, const char* placeholder, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -247,6 +296,10 @@ A `pattern` specifies a [regular expression](https://www.w3schools.com/js/js_reg
A placeholder is an option string. Specification of a placeholder will generate a `placeholder` attribute for the input tag.
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_BR`.
## AutoConnectRadio
AutoConnectRadio generates few HTML `#!html <input type="radio">` tags as grouped and the same number of `#!html <label>` tags. AutoConnectRadio can keep the value of a radio button as a collection. The grouped values will be placed in the custom Web page to select only one exclusively.
@ -259,7 +312,7 @@ AutoConnectRadio generates few HTML `#!html <input type="radio">` tags as groupe
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectRadio(const char* name, std::vector<String> const& values, const char* label, const ACArrange_t order, const uint8_t checked)
AutoConnectRadio(const char* name, std::vector<String> const& values, const char* label, const ACArrange_t order, const uint8_t checked, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -287,6 +340,32 @@ A label will place in the left or the top according to the **order**.
A `checked` specifies the index number (1-based) of the **values** to be checked. If this parameter is not specified neither item is checked.
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_BR`.
## AutoConnectStyle
AutoConnectStyle inserts the string given by the **value** into the style block of a custom Web page as it is raw.
!!! warning "The validity as CSS will not be checked"
AutoConnectStyle does not do syntax checking and semantic analysis of value. Insert the specified string into the style block of the custom Web page without processing it.
Therefore, specifying the wrong CSS will modulate the behavior of the custom Web page.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectStyle(const char* name, const char* value)
```
### <i class="fa fa-caret-right"></i> name
It is the `name` of the AutoConnectStyle element and is useful only to access this element from the sketch. It does not affect the generated HTML code.
### <i class="fa fa-caret-right"></i> value
The raw CSS code. It is not necessary to write `<style>` `</style>` tags.
## AutoConnectSelect
AutoConnectSelect generates an HTML `#!html <select>` tag (drop-down list) and few `#!html <option>` tags.
@ -299,7 +378,7 @@ AutoConnectSelect generates an HTML `#!html <select>` tag (drop-down list) and f
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectSelect(const char* name, std::vector<String> const& options, const char* label, const uint8_t selected)
AutoConnectSelect(const char* name, std::vector<String> const& options, const char* label, const uint8_t selected, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -318,6 +397,10 @@ A `label` is an optional string. A label is always arranged on the left side of
A `selected` is an optional value. Specifies that an option should be pre-selected when the page loads.
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_BR`.
## AutoConnectSubmit
AutoConnectSubmit generates an HTML `#!html <input type="button">` tag attached `#!html onclick` attribute. The native code of the `#!html onclick` attribute is the submission of the form with the **POST** method.
@ -330,7 +413,7 @@ AutoConnectSubmit generates an HTML `#!html <input type="button">` tag attached
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectSubmit(const char* name, const char* value, const char* uri)
AutoConnectSubmit(const char* name, const char* value, const char* uri, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -349,6 +432,10 @@ The query string of the form data sent with AutoConnectSubmit contains the URI o
\_acuri=**CALLER_URI**
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_None`.
## AutoConnectText
AutoConnectText generates an HTML `#!html <div>` tag. A `#!html style` attribute will be attached if a [style](#style) parameter is passed.
@ -361,7 +448,7 @@ AutoConnectText generates an HTML `#!html <div>` tag. A `#!html style` attribute
### <i class="fa fa-edit"></i> Constructor
```cpp
AutoConnectText(const char* name, const char* value, const char* style, const char* format)
AutoConnectText(const char* name, const char* value, const char* style, const char* format, const ACPosterior_t post)
```
### <i class="fa fa-caret-right"></i> name
@ -378,7 +465,11 @@ A `style` specifies the qualification style to give to the content and can use t
### <i class="fa fa-caret-right"></i> format
A `format` is a pointer to a null-terminated multibyte string specifying how to interpret the value. It specifies the conversion format when outputting values. The format string conforms to C-style printf library functions, but depends on the espressif sdk implementation. The conversion specification is valid only in **%s** format. (Left and Right justification, width are also valid.)
A `format` is a pointer to a null-terminated multi byte string specifying how to interpret the value. It specifies the conversion format when outputting values. The format string conforms to C-style printf library functions, but depends on the Espressif's SDK implementation. The conversion specification is valid only in **%s** format. (Left and Right justification, width are also valid.)
### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element. The default values is `AC_Tag_None`.
## How to coding for the elements
@ -388,23 +479,25 @@ Variables of each AutoConnetElement can be declared with macros. By using the ma
[^2]: The square brackets in the syntax are optional parameters, the stroke is a selection parameter, the bold fonts are literal.
ACElement ( *name* <small>\[</small> , *value* <small>\]</small> )
ACElement ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACButton ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *action* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACButton ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *action* <small>\]</small> )
ACCheckbox ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , <small>**true**</small> | <small>**false**</small> <small>\]</small> <small>\[</small> , <small>**AC_Infront**</small> | <small>**AC_Behind**</small> <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACCheckbox ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , **true** | **false** <small>\]</small> )
ACFile ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , <small>**AC\_File\_FS**</small> | <small>**AC\_File\_SD**</small> | <small>**AC\_File\_Extern**</small> <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACFile ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , **AC\_File\_FS** | **AC\_File\_SD** | **AC\_File\_Extern** <small>\]</small> )
ACInput ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , *pattern* <small>\]</small> <small>\[</small> , *placeholder* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACInput ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , *pattern* <small>\]</small> <small>\[</small> , *placeholder* <small>\]</small> )
ACRadio ( *name* <small>\[</small> , *values* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , <small>**AC\_Horizontal</small>** | <small>**AC\_Vertical**</small> <small>\]</small> <small>\[</small> , *checked* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACRadio ( *name* <small>\[</small> , *values* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , **AC\_Horizontal** | **AC\_Vertical** <small>\]</small> <small>\[</small> , *checked* <small>\]</small> )
ACSelect ( *name* <small>\[</small> , *options* <small>\]</small> <small>\[</small> , *label* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACSelect ( *name* <small>\[</small> , *options* <small>\]</small> <small>\[</small> , *label* <small>\]</small> )
ACStyle ( *name* <small>\[</small> , *value* <small>\]</small> )
ACSubmit ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *uri* <small>\]</small> )
ACSubmit ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *uri* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
ACText ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *style* <small>\]</small> <small>\[</small> , *format* <small>\]</small> )
ACText ( *name* <small>\[</small> , *value* <small>\]</small> <small>\[</small> , *style* <small>\]</small> <small>\[</small> , *format* <small>\]</small> <small>\[</small> , <small>**AC\_Tag\_None**</small> | <small>**AC\_Tag\_BR**</small> | <small>**AC\_Tag\_P**</small> <small>\]</small> )
!!! memo "Declaration macro usage"
For example, *AutoConnectText* can be declared using macros.

@ -3,13 +3,14 @@
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectButton(const char* name = "", const char* value = "", const String& action = String())
AutoConnectButton(const char* name = "", const char* value = "", const String& action = String(), const ACPosterior_t post = AC_Tag_None)
```
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">value</span><span class="apidesc">Value of the element.</span></dd>
<dd><span class="apidef">action</span><span class="apidesc">Native code of the action script executed when the button is clicked.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -40,6 +41,19 @@ The element name.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> value
Value of the element.
@ -66,7 +80,7 @@ Returns type of AutoConnectElement.
### <i class="fa fa-code"></i> Constructor
```cpp
explicit AutoConnectCheckboxBasis(const char* name = "", const char* value = "", const char* label = "", const bool checked = false)
explicit AutoConnectCheckboxBasis(const char* name = "", const char* value = "", const char* label = "", const bool checked = false, const ACPosterior_t post = AC_Tag_BR)
```
<dl class="apidl">
<dt>**Parameters**</dt>
@ -74,6 +88,7 @@ Returns type of AutoConnectElement.
<dd><span class="apidef">value</span><span class="apidesc">Value of the element.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">A label string prefixed to the checkbox.</span></dd>
<dd><span class="apidef">check</span><span class="apidesc">Checked state of the checkbox.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -110,6 +125,19 @@ The element name.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> value
Value of the element. It becomes a value attribute of an HTML `#!html <input type="checkbox">` tag.
@ -136,12 +164,13 @@ Returns type of AutoConnectElement.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectElement(const char* name = "", const char* value = "")
AutoConnectElement(const char* name = "", const char* value = "", const ACPosterior_t post = AC_Tag_None)
```
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">value</span><span class="apidesc">Value of the element.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -170,6 +199,19 @@ Value of the element. It is output as HTML as it is as a source for generating H
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf
@ -191,7 +233,7 @@ AutoConnectElement& as<T>(void)
Casts the reference to the AutoConnectElement the specified type.
<dl class="apidl">
<dt>**Parameter**</dt>
<dd><span class="apidef">T</span><span class="apidesc">The element type. AutoConnectElements type such as [AutoConnectButton](apielements.md#autoconnectbutton), [AutoConnectCheckbox](apielements.md#autoconnectcheckbox), [AutoConnectFile](apielements.md#autoconnectfile), [AutoConnectInput](apielements.md#autoconnectinput), [AutoConnectRadio](apielements.md#autoconnectradio), [AutoConnectSelect](apielements.md#autoconnectselect), [AutoConnectSubmit](apielements.md#autoconnectsubmit), [AutoConnectText](apielements.md#autoconnecttext).</span></dd>
<dd><span class="apidef">T</span><span class="apidesc">The element type. AutoConnectElements type such as [AutoConnectButton](apielements.md#autoconnectbutton), [AutoConnectCheckbox](apielements.md#autoconnectcheckbox), [AutoConnectFile](apielements.md#autoconnectfile), [AutoConnectInput](apielements.md#autoconnectinput), [AutoConnectRadio](apielements.md#autoconnectradio), [AutoConnectSelect](apielements.md#autoconnectselect), [AutoConnectStyle](apielements.md#autoconnectstyle),[AutoConnectSubmit](apielements.md#autoconnectsubmit), [AutoConnectText](apielements.md#autoconnecttext).</span></dd>
<dt>**Return value**</dt>
<dd>A reference to the AutoConnectElement with actual type.</dd>
</dl>
@ -201,7 +243,7 @@ Casts the reference to the AutoConnectElement the specified type.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectFile(const char* name = "", const char* value = "", const char* label = "", const ACFile_t store = AC_File_FS)
AutoConnectFile(const char* name = "", const char* value = "", const char* label = "", const ACFile_t store = AC_File_FS, const ACPosterior_t post = AC_Tag_BR)
```
<dl class="apidl">
<dt>**Parameters**</dt>
@ -209,7 +251,7 @@ AutoConnectFile(const char* name = "", const char* value = "", const char* label
<dd><span class="apidef">value</span><span class="apidesc">File name to be upload.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">store</span><span class="apidesc">The **ACFile_t** enumerator that represents the media to save the uploaded file.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -246,6 +288,19 @@ The element name.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> size
Size of the uploading file.
@ -293,7 +348,7 @@ Returns type of AutoConnectFile.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectInput(const char* name = "", const char* value = "", const char* label = "", const char* pattern = "", const char* placeholder = "")
AutoConnectInput(const char* name = "", const char* value = "", const char* label = "", const char* pattern = "", const char* placeholder = "", const ACPosterior_t post = AC_Tag_BR)
```
<dl class="apidl">
<dt>**Parameters**</dt>
@ -302,6 +357,7 @@ AutoConnectInput(const char* name = "", const char* value = "", const char* labe
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">pattern</span><span class="apidesc">Regular expression string for checking data format.</span></dd>
<dd><span class="apidef">placeholder</span><span class="apidesc">A placeholder string.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -354,6 +410,19 @@ A placeholder is an option string. Specification of a placeholder will generate
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> isValid
@ -384,7 +453,7 @@ Returns type of AutoConnectElement.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectRadio(const char* name = "", std::vector<String> const& values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0)
AutoConnectRadio(const char* name = "", std::vector<String> const& values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0, const ACPosterior_t post = AC_Tag_BR)
```
<dl class="apidl">
<dt>**Parameters**</dt>
@ -393,6 +462,7 @@ AutoConnectRadio(const char* name = "", std::vector<String> const& values = {},
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">order</span><span class="apidesc">The direction to arrange the radio buttons.</span></dd>
<dd><span class="apidef">checked</span><span class="apidesc">An index to be checked in the radio buttons.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -441,6 +511,19 @@ Specifies the direction to arrange the radio buttons. A label will place in the
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> values
An array of String type for the radio button options. It is an initialization list can be used. The `#!html <input type="radio">` tags will be generated from each entry in the values.
@ -537,7 +620,7 @@ Returns current checked option of the radio buttons.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectSelect(const char* name = "", std::vector<String> const& options = {}, const char* label = "", const uint8_t selected = 0)
AutoConnectSelect(const char* name = "", std::vector<String> const& options = {}, const char* label = "", const uint8_t selected = 0, const ACPosterior_t post = AC_Tag_BR)
```
<dl class="apidl">
<dt>**Parameters**</dt>
@ -545,6 +628,7 @@ AutoConnectSelect(const char* name = "", std::vector<String> const& options = {}
<dd><span class="apidef">options</span><span class="apidesc">An array of options of the select element. Specifies a [std::vector](https://en.cppreference.com/w/cpp/container/vector) object.</span></dd>
<dd><span class="apidef">label</span><span class="apidesc">Label string.</span></dd>
<dd><span class="apidef">selected</span><span class="apidesc">An option should be pre-selected when the page loads.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -581,6 +665,19 @@ An array of String type for the selection options. It is an initialization list
<dd><span class="apidef">std::vector&lt;String&gt;</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> selected
A `selected` is an optional value. Specifies 1-based index value of an options array that an option should be pre-selected when the page loads.
@ -672,18 +769,71 @@ Returns current selected option of the select list.
<dd>A String of an option current selected. If there is no select option, a null string returned.</dd>
</dl>
## AutoConnectStyle
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectStyle(const char* name = "", const char* value = "")
```
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">value</span><span class="apidesc">Raw CSS code to insert into a style block in a custom web page to generate.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> enable
Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> name
The element name.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> value
Raw CSS code to insert into a style block in a custom web page to generate.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf
```cpp
ACElement_t typeOf(void)
```
Returns type of AutoConnectElement.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>AC_Style</dd>
</dl>
## AutoConnectSubmit
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectSubmit(const char* name = "", const char* value ="", char* uri = "")
AutoConnectSubmit(const char* name = "", const char* value ="", char* uri = "", const ACPosterior_t post = AC_Tag_None)
```
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">name</span><span class="apidesc">The element name.</span></dd>
<dd><span class="apidef">value</span><span class="apidesc">The name of the submit button as an HTML `#!html <input type="button">` tag, it will also be the label of the button.</span></dd>
<dd><span class="apidef">uri</span><span class="apidesc">Destination URI.</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -704,6 +854,19 @@ The element name.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> uri
Destination URI.
@ -738,7 +901,7 @@ Returns type of AutoConnectElement.
### <i class="fa fa-code"></i> Constructor
```cpp
AutoConnectText(const char* name = "", const char* value = "", const char* style = "", const char* format = "")
AutoConnectText(const char* name = "", const char* value = "", const char* style = "", const char* format = "", const ACPosterior_t post = AC_Tag_None)
```
<dl class="apidl">
<dt>**Parameters**</dt>
@ -746,6 +909,7 @@ AutoConnectText(const char* name = "", const char* value = "", const char* style
<dd><span class="apidef">value</span><span class="apidesc">String of content for the text element.</span></dd>
<dd><span class="apidef">style</span><span class="apidesc">A style code with CSS format that qualifiers the text.</span></dd>
<dd><span class="apidef">format</span><span class="apidesc">A pointer to a null-terminated multibyte string specifying how to interpret the value. It specifies the conversion format when outputting values. The format string conforms to C-style printf library functions</span></dd>
<dd><span class="apidef">post</span><span class="apidesc">Specifies the tag to be output afterward the element.</span></dd>
</dl>
### <i class="fa fa-code"></i> Public member variables
@ -774,6 +938,19 @@ The element name.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> post
Specifies a tag to add behind the HTML code generated from the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">ACPosterior_t</span><span class="apidesc">
- **`AC_Tag_None`** : No generate additional tags.
- **`AC_Tag_BR`** : Add a `<br>` tag to the end of the element.
- **`AC_Tag_P`** : Include the element in the `<p> ~ </p>` tag.
</span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> style
A style code with CSS format that qualifiers the text.

@ -1,3 +1,10 @@
#### [0.9.11] July 13, 2019
- Supports new element as AutoConnectSytle that can insert the custom CSS into AutoConnectAux page.
- Supports that `<br>` tags can now be added to each element.
- Supports that able to place the checkbox label forward or backward.
- Supports flicker signal output according to the status of WiFi_mode.
- Fixed bug in AutoConnectCredential when offset is >256.
#### [0.9.10] June 12, 2019
- Fixed the unable to get AutoConnectElemets values in the sketch with ESP8266 arduino core 2.5.2.

Loading…
Cancel
Save