-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHTMLWriterIntf.pas
More file actions
828 lines (802 loc) · 52.6 KB
/
HTMLWriterIntf.pas
File metadata and controls
828 lines (802 loc) · 52.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
unit HTMLWriterIntf;
{$REGION 'License'}
{
Copyright (C) 2010 Nick Hodges
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
}
{$ENDREGION}
interface
uses
HTMLWriterUtils
, Classes
, SysUtils
, LoadSaveIntf
;
type
/// <summary>An interface for creating HTML. IHTMLWriter uses the fluent interface. It can be used to create either
/// complete HTML documents or chunks of HTML. By using the fluent interface, you can link together number of methods
/// to create a complete document.</summary>
/// <remarks>
/// <para>Most methods begin with either "Open" or "Add". Methods that start with "Open" will
/// add <tag> to the HTML stream, leaving it ready for the addition of attributes or other content. The
/// system will automatically close the tag when necessary.</para>
/// <para>Methods that start with "Add" will normally take paramenters and then add content within a complete tag
/// pair. For example, a call to AddBoldText('blah') will result in <b>blah</b> being added to
/// the HTML stream.</para>
/// <para>Some things to note:</para>
/// <list type="bullet">
/// <item>Any tag that is opened will need to be closed via CloseTag</item>
/// <item>Any tag that is added via a AddXXXX call will close itself.</item>
/// <item>The rule to follow: Close what you open. Additions take care of themselves.</item>
/// <item>Certain tags like <meta> and <base> can only be added inside
/// at <head> tag.</item>
/// <item>Tags such as <td>, <tr> can only be added inside of
/// a <table> tag.</item>
/// <item>The same is true for list items inside lists.</item>
/// </list>
/// </remarks>
IHTMLWriter = interface(ILoadSave)
['{7D6CC975-3FAB-453C-8BAB-45D6E55DE376}']
function GetAttribute(const Name, Value: string): IHTMLWriter;
function GetErrorLevels: THTMLErrorLevels;
procedure SetErrorLevels(const Value: THTMLErrorLevels);
function GetHTML: TStringBuilder;
function AddTag(aString: string; aCloseTagType: TCloseTagType = ctNormal; aCanAddAttributes: TCanHaveAttributes = chaCanHaveAttributes): IHTMLWriter;
/// <summary>Opens a<head> tag to the document. </summary>
function OpenHead: IHTMLWriter;
/// <summary>Opens a <meta> tag.</summary>
/// <exception cref="EHeadTagRequiredHTMLException">Raised if an attempt is made to call this method
/// when not inside a <head> tag.</exception>
/// <remarks>Note that this method can only be called from within <head> tag. If it is called from
/// anywhere else, it will raise an exception.</remarks>
function OpenMeta: IHTMLWriter;
/// <summary>Opens a <base /> tag.</summary>
/// <exception cref="EHeadTagRequiredHTMLException">Raised if this tag is added outside of the <head>
/// tag.</exception>
/// <remarks>This tag will always be closed with the '/>' tag. In addition, this tag can only be added inside of
/// a <head> tag.</remarks>
function OpenBase: IHTMLWriter;
/// <summary>Opens a <basefont> tag.</summary>
/// <remarks>This tag is deprecated in HTML 4.01 and HTML5.</remarks>
function OpenBaseFont: IHTMLWriter;
/// <summary>Adds a <base /> tag to the HTML.</summary>
/// <remarks>Note: This method can only be called inside an open <head> tag.</remarks>
function AddBase(aTarget: TTargetType; aFrameName: string = ''): IHTMLWriter; overload;
/// <summary>Creates a <base> tag with an HREF="" attribute.</summary>
/// <param name="aHREF">The HREF to be added to the <base> tag as an attribute.</param>
function AddBase(aHREF: string): IHTMLWriter; overload;
/// <summary>Opens a <title> tag.</summary>
function OpenTitle: IHTMLWriter;
/// <summary>Adds a <title> tag including the passed in text.</summary>
/// <param name="aTitleText">The text to be placed inside the <title></title> tag</param>
/// <remarks>There is no need to close this tag manually. All "AddXXXX" methods close themselves.</remarks>
function AddTitle(aTitleText: string): IHTMLWriter;
/// <summary>Adds a <meta> tag with name and content attributes.</summary>
/// <param name="aName">The value for the name attribute.</param>
/// <param name="aContent">The value for the content attribute.</param>
function AddMetaNamedContent(aName: string; aContent: string): IHTMLWriter;
/// <summary>Opens a <body> tag.</summary>
function OpenBody: IHTMLWriter;
/// <summary>Opens a <p> tag. </summary>
function OpenParagraph: IHTMLWriter;
/// <summary>Opens a <p> tag and gives it the passed in style="" attribute</summary>
/// <param name="aStyle">The CSS-based text to be included in the style attribute for the <p> tag.</param>
function OpenParagraphWithStyle(aStyle: string): IHTMLWriter;
/// <summary>Opens a <p> tag with an id="" attribute.</summary>
/// <param name="aID">The value for the id attribute.</param>
function OpenParagraphWithID(aID: string): IHTMLWriter;
/// <summary>Opens a <span> tag.</summary>
function OpenSpan: IHTMLWriter;
/// <summary>Opens a <div> tag.</summary>
function OpenDiv: IHTMLWriter;
/// <summary>Opens a <blockquote> tag.</summary>
function OpenBlockQuote: IHTMLWriter;
/// <summary>Adds the passed in text to the HTML inside of a <p> tag.</summary>
/// <param name="aString">The text to be added into the <p> tag.</param>
function AddParagraphText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text into a <p> tag and adds in the given Style attribute.</summary>
/// <param name="aString">The text to be added within the <p> tag.</param>
/// <param name="aStyle">The value for the Style attribute to be added to the <p> tag.</param>
function AddParagraphTextWithStyle(aString: string; aStyle: string): IHTMLWriter;
/// <summary>Adds the passed in text into a <p> tag with an id="" attribute.</summary>
/// <param name="aString">The text to be added within the <p> tag.</param>
/// <param name="aID">The value for the id attribute.</param>
function AddParagraphTextWithID(aString: string; aID: string): IHTMLWriter;
/// <summary>Adds the passed in text into a <p> tag with a class="" attribute.</summary>
/// <param name="aString">The text to be added within the <p> tag.</param>
/// <param name="aClass">The value for the class attribute.</param>
function AddParagraphTextWithClass(aString: string; aClass: string): IHTMLWriter;
/// <summary>Adds text inside of a <span> tag.</summary>
/// <param name="aString">The text to be added inside of the <span></span> tag.</param>
function AddSpanText(aString: string): IHTMLWriter;
/// <summary>Adds text inside a <span> tag with a style="" attribute.</summary>
/// <param name="aString">The text to be added inside the <span> tag.</param>
/// <param name="aStyle">The CSS style value for the style attribute.</param>
function AddSpanTextWithStyle(aString: string; aStyle: string): IHTMLWriter;
/// <summary>Adds text inside a <span> tag with an id="" attribute.</summary>
/// <param name="aString">The text to be added inside the <span> tag.</param>
/// <param name="aID">The value for the id attribute.</param>
function AddSpanTextWithID(aString: string; aID: string): IHTMLWriter;
/// <summary>Adds text inside a <span> tag with a class="" attribute.</summary>
/// <param name="aString">The text to be added inside the <span> tag.</param>
/// <param name="aID">The value for the class attribute.</param>
function AddSpanTextWithClass(aString: string; aID: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <div></div> tag.</summary>
/// <param name="aString">The text to be added inside the <div></div> tag</param>
function AddDivText(aString: string): IHTMLWriter;
/// <summary>Creates a <div> tag with a "style=" attribute.</summary>
/// <param name="aString">The text to be placed in the <div> tag.</param>
/// <param name="aStyle">A string representing the CSS style information for the <div> tag.</param>
function AddDivTextWithStyle(aString: string; aStyle: string): IHTMLWriter;
/// <summary>Creates a <div> tag with a "id=" attribute.</summary>
/// <param name="aString">The text to be placed in the <div> tag.</param>
/// <param name="aID">As string containing the id value for the <div> tag.</param>
function AddDivTextWithID(aString: string; aID: string): IHTMLWriter;
/// <summary>Creates a <div> tag with a "class=" attribute.</summary>
/// <param name="aString">The text to be placed in the <div> tag.</param>
/// <param name="aID">As string containing the class value for the <div> tag.</param>
function AddDivTextWithClass(aString: string; aClass: string): IHTMLWriter;
/// <summary>Opens up a <b> tag. Once a tag is open, it can be added to as desired.</summary>
function OpenBold: IHTMLWriter;
/// <summary>Opens up a <i> tag. Once a tag is open, it can be added to as desired.</summary>
function OpenItalic: IHTMLWriter;
/// <summary>Opens up a <u> tag. Once a tag is open, it can be added to as desired.</summary>
function OpenUnderline: IHTMLWriter;
/// <summary>Opens a <em> tag.</summary>
function OpenEmphasis: IHTMLWriter;
/// <summary>Opens a <strong> tag.</summary>
function OpenStrong: IHTMLWriter;
/// <summary>Opens a <pre> tag.</summary>
function OpenPre: IHTMLWriter;
/// <summary>Opens a <cite> tag.</summary>
function OpenCite: IHTMLWriter;
/// <summary>Opens a <acronym> tag.</summary>
function OpenAcronym: IHTMLWriter;
/// <summary>Opens an <abbr> tag.</summary>
function OpenAbbreviation: IHTMLWriter;
/// <summary>Opens an <addr> tag</summary>
function OpenAddress: IHTMLWriter;
/// <summary>Opens a <bdo> tag.</summary>
function OpenBDO: IHTMLWriter;
/// <summary>Opens a <big> tag.</summary>
function OpenBig: IHTMLWriter;
/// <summary>Opens a <center> tag.</summary>
function OpenCenter: IHTMLWriter;
/// <summary>Opens a <code> tag.</summary>
function OpenCode: IHTMLWriter;
/// <summary>Opens a <del> tag.</summary>
function OpenDelete: IHTMLWriter;
/// <summary>Opens a <dfn> tag.</summary>
function OpenDefinition: IHTMLWriter;
/// <summary>Opens a <font> tag.</summary>
function OpenFont: IHTMLWriter;
/// <summary>Opens a <kbd> tag</summary>
function OpenKeyboard: IHTMLWriter;
/// <summary>Opens a <q> tag. </summary>
function OpenQuotation: IHTMLWriter;
/// <summary>Opens a <sample> tag.</summary>
function OpenSample: IHTMLWriter;
/// <summary>Opens a <small> tag.</summary>
function OpenSmall: IHTMLWriter;
/// <summary>Opens a <strike> tag.</summary>
function OpenStrike: IHTMLWriter;
/// <summary>Opens a <tt> tag.</summary>
function OpenTeletype: IHTMLWriter;
/// <summary>Opens a <var> tag.</summary>
function OpenVariable: IHTMLWriter;
/// <summary>Opens a <ins> tag.</summary>
function OpenInsert: IHTMLWriter;
/// <summary>Adds a <b></b> containing the passed text</summary>
/// <param name="aString">The text to be placed within the bold tag.</param>
function AddBoldText(aString: string): IHTMLWriter;
/// <summary>Adds a <i></i> containing the passed text</summary>
/// <param name="aString">The text to be placed within the italic tag.</param>
function AddItalicText(aString: string): IHTMLWriter;
/// <summary>
/// Adds a <u></u> containing the passed text
/// </summary>
/// <param name="aString">
/// The text to be placed within the underline tag. <br />
/// </param>
function AddUnderlinedText(aString: string): IHTMLWriter;
/// <summary>Adds the passed text inside of a <em></em> tag</summary>
/// <param name="aString">The text to be added inside the Emphasis tag.</param>
function AddEmphasisText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <strong></strong> tag.</summary>
/// <param name="aString">The text to be added to the strong tag.</param>
function AddStrongText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <pre></pre> tag</summary>
/// <param name="aString">The text to be added inside a preformatted tag</param>
function AddPreformattedText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <cite<</cite> tag</summary>
/// <param name="aString">The text to be added inside the Citation tag.</param>
function AddCitationText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text inside of a <blockquote></blockquote> tag.</summary>
/// <param name="aString">The text to be included inside the block quote tag.</param>
function AddBlockQuoteText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to an <acronym></acronym> tag.</summary>
/// <param name="aString">The string that will be included in the Acronym tag.</param>
function AddAcronymText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text inside a <abbr></abbr> tag.</summary>
/// <param name="aString">The text to be added inside the Abbreviation tag.</param>
function AddAbbreviationText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <addr></addr> tag.</summary>
/// <param name="aString">The text to be included in the Address tag.</param>
function AddAddressText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <bdo></bdo> tag.</summary>
/// <param name="aString">The text to be added inside the Bi-Directional tag.</param>
function AddBDOText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <big></big> tag.</summary>
/// <param name="aString">The text to eb added to the Big tag.</param>
function AddBigText(aString: string): IHTMLWriter;
/// <summary>Addes the passed in text to a <center></center> tag.</summary>
/// <param name="aString">The text to be added to the Center tag.</param>
function AddCenterText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <code></code> tag.</summary>
/// <param name="aString">The text to be added to the Code tag.</param>
function AddCodeText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <del></del> tag.</summary>
/// <param name="aString">The text to be added to the Delete tag.</param>
function AddDeleteText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <dfn></dfn> tag.</summary>
/// <param name="aString">The text to be added inside of the Definition tag.</param>
function AddDefinitionText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <font></font> tag.</summary>
/// <param name="aString">The text to be included in the Font tag.</param>
function AddFontText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <kbd></kbd> tag.</summary>
/// <param name="aString">The text to be added to the Keyboard tag.</param>
function AddKeyboardText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <q></q> tag</summary>
/// <param name="aString">The string that will be included inside the quotation tag.</param>
function AddQuotationText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <samp></samp> tag.</summary>
/// <param name="aString">The text to be inserted into the sample tag.</param>
function AddSampleText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <small></small> tag</summary>
/// <param name="aString">The text to be included in a small tag.</param>
function AddSmallText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text inside a <strike></strike> tag</summary>
/// <param name="aString">The text to be included in the strike tag.</param>
function AddStrikeText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <tt></tt> tag.</summary>
/// <param name="aString">The text to be added into the teletype tag.</param>
function AddTeletypeText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <var></var> tag</summary>
/// <param name="aString">The text to be passed to the variable tag.</param>
function AddVariableText(aString: string): IHTMLWriter;
/// <summary>Adds the passed in text to a <ins></ins> tag</summary>
/// <param name="aString">The text to be passed to the insert tag.</param>
function AddInsertText(aString: string): IHTMLWriter;
/// <summary>Opens a <h1> tag.</summary>
function OpenHeading1: IHTMLWriter;
/// <summary>Opens a <h2> tag.</summary>
function OpenHeading2: IHTMLWriter;
/// <summary>Opens a <h3> tag.</summary>
function OpenHeading3: IHTMLWriter;
/// <summary>Opens a <h4> tag.</summary>
function OpenHeading4: IHTMLWriter;
/// <summary>Opens a <h5> tag.</summary>
function OpenHeading5: IHTMLWriter;
/// <summary>Opens a <h6> tag.</summary>
function OpenHeading6: IHTMLWriter;
/// <summary>Inserts a <h1></h1> tag and places the given text in it.</summary>
/// <param name="aString">The text to be placed inside the heading tag.</param>
function AddHeading1Text(aString: string): IHTMLWriter;
/// <summary>Inserts a <h2></h2> tag and places the given text in it.</summary>
/// <param name="aString">The text to be placed inside the heading tag.</param>
function AddHeading2Text(aString: string): IHTMLWriter;
/// <summary>Inserts a <h3></h3> tag and places the given text in it.</summary>
/// <param name="aString">The text to be placed inside the heading tag.</param>
function AddHeading3Text(aString: string): IHTMLWriter;
/// <summary>Inserts a <h4></h4> tag and places the given text in it.</summary>
/// <param name="aString">The text to be placed inside the heading tag.</param>
function AddHeading4Text(aString: string): IHTMLWriter;
/// <summary>Inserts a <h5></h5> tag and places the given text in it.</summary>
/// <param name="aString">The text to be placed inside the heading tag.</param>
function AddHeading5Text(aString: string): IHTMLWriter;
/// <summary>Inserts a <h6></h6> tag and places the given text in it.</summary>
/// <param name="aString">The text to be placed inside the heading tag.</param>
function AddHeading6Text(aString: string): IHTMLWriter;
/// <summary>Addes a style="" attribute to the current HTML.</summary>
/// <param name="aStyle">The string that contains the styling information in CSS format.</param>
/// <exception cref="EHTMLWriterOpenTagRequiredException">Raised if this method is called while a tag is not open.</exception>
/// <remarks>This method can only be called when a tag is open and ready to take attributes.</remarks>
function AddStyle(aStyle: string): IHTMLWriter;
/// <summary>Adds a class="" attribute to the current tag.</summary>
/// <param name="aClass">The name of the class to be added in the attribute.</param>
/// <exception cref="EHTMLWriterOpenTagRequiredException">Raised if this method is called while a tag is not open.</exception>
/// <remarks>This method can only be called when a tag is open and ready to take attributes.</remarks>
function AddClass(aClass: string): IHTMLWriter;
/// <summary>Adds an id="" attribute to the current tag.</summary>
/// <param name="aID">The string containing the ID to be included with the attribute.</param>
/// <exception cref="EHTMLWriterOpenTagRequiredException">Raised if this method is called while a tag is not open.</exception>
/// <remarks>This method can only be called when a tag is open and ready to take attributes.</remarks>
function AddID(aID: string): IHTMLWriter;
/// <summary>Adds an attribute to the current tag. The tag must have its bracket open. </summary>
/// <param name="aString">The name of the attribute to be added. If this is the only parameter passed in,
/// then this string should contain the entire attribute string.</param>
/// <param name="aValue">Optional parameter. If this value is passed, then the first parameter become the
/// <i>name</i>, and this one the <i>value</i>, in a <i>name=value</i> pair.</param>
/// <exception cref="EHTMLWriterOpenTagRequiredException">Raised when this method is called on a tag that doesn't
/// have it's bracket open.</exception>
function AddAttribute(aString: string; aValue: string = ''): IHTMLWriter;
/// <summary>Adds a <br /> tag</summary>
/// <param name="aClearValue">An optional parameter that determines if a clear attribute will be added. The
/// default value is not to include the clear attribute.</param>
/// <param name="aUseCloseSlash">An optional parameter that determines if the tag will close with a />.
/// The default is to do so.</param>
function AddLineBreak(const aClearValue: TClearValue = cvNoValue; aUseEmptyTag: TIsEmptyTag = ietIsEmptyTag): IHTMLWriter;
/// <summary>Adds an <hr> tag to the HTML</summary>
/// <param name="aAttributes">Attributes that should be added to the <hr> tag.</param>
/// <param name="aUseEmptyTag">Determines if the <hr> tag should be rendered as <hr /></param>
function AddHardRule(const aAttributes: string = ''; aUseEmptyTag: TIsEmptyTag = ietIsEmptyTag): IHTMLWriter;
/// <summary>Adds a Carriage Return and a Line Feed to the HTML.</summary>
function CRLF: IHTMLWriter;
/// <summary>Adds spaces to the HTML stream</summary>
/// <param name="aNumberofSpaces">An integer indicating how many spaces should be added to the HTML.</param>
function Indent(aNumberofSpaces: integer): IHTMLWriter;
/// <summary>Opens a <comment> tag</summary>
function OpenComment: IHTMLWriter;
/// <summary>Adds any text to the HTML. </summary>
/// <param name="aString">The string to be added</param>
/// <remarks>AddText will close the current tag and then add the text passed in the string parameter</remarks>
function AddText(aString: string): IHTMLWriter;
/// <summary>AddRawText will inject the passed in string directly into the HTML. </summary>
/// <param name="aString">The text to be added to the HTML</param>
/// <remarks>AddRawText will not make any other changes to open tags or open brackets. It just injects
/// the passed text directly onto the HTML.</remarks>
function AddRawText(aString: string): IHTMLWriter;
/// <summary>Returns a string containing the current HTML for the
/// HTMLWriter</summary>
/// <remarks>This property will return the HTML in whatever state it is
/// in when called. This may mean that brackets or even tags are
/// open, attributes hanging undone, etc. </remarks>
function AsHTML: string;
/// <summary>Adds a comment to the HTML stream</summary>
/// <param name="aCommentText">The text to be added inside the comment</param>
function AddComment(aCommentText: string): IHTMLWriter;
/// <summary>Opens a <script> tag</summary>
function OpenScript: IHTMLWriter;
/// <summary>Adds the passed in script text to a <script></script> tag.</summary>
/// <param name="aScriptText">The script text to be added inside the Script tag.</param>
function AddScript(aScriptText: string): IHTMLWriter;
/// <summary>Opens a <noscript> tag</summary>
function OpenNoScript: IHTMLWriter;
/// <summary>Opens a <link /> tag.</summary>
function OpenLink: IHTMLWriter;
/// <summary>Closes an open tag.</summary>
/// <param name="aUseCRLF">Determines if CRLF should be added after the closing of the tag.</param>
/// <exception cref="ETryingToCloseClosedTag">Raised if you try to close a tag when no tag is open.</exception>
function CloseTag(aUseCRLF: TUseCRLFOptions = ucoNoCRLF): IHTMLWriter;
/// <summary>Closes an open comment tag.</summary>
function CloseComment: IHTMLWriter;
/// <summary>Closes an open <list> tag</summary>
function CloseList: IHTMLWriter;
/// <summary>Closes an open <table> tag.</summary>
function CloseTable: IHTMLWriter;
/// <summary>Closes and open <form> tag.</summary>
function CloseForm: IHTMLWriter;
/// <summary>Closes and open <html> tag.</summary>
function CloseDocument: IHTMLWriter;
/// <summary>Opens in <img> tag.</summary>
/// <remarks>This tag will always be closed by " />"</remarks>
function OpenImage: IHTMLWriter; overload;
/// <summary>Opens an <img> tag and adds the 'src' parameter.</summary>
/// <param name="aImageSource">The URL of the image to be displayed</param>
function OpenImage(aImageSource: string): IHTMLWriter; overload;
/// <summary>Adds a complete <img /> tag with the given source.</summary>
/// <param name="aImageSource">The URL of the image to be displayed.</param>
function AddImage(aImageSource: string): IHTMLWriter;
/// <summary>Opens an <a> tag.</summary>
function OpenAnchor: IHTMLWriter; overload;
/// <summary>Opens an <a> tag with a name attribute.</summary>
/// <param name="aName">The value for the name attribute.</param>
function OpenAnchor(aName: string): IHTMLWriter; overload;
/// <summary>Opens an <a> tag with an href attribute and adds text content.</summary>
/// <param name="aHREF">The URL for the href attribute.</param>
/// <param name="aText">The text to be displayed inside the anchor tag.</param>
function OpenAnchor(const aHREF: string; aText: string): IHTMLWriter; overload;
/// <summary>Adds a complete <a></a> tag with href and text content.</summary>
/// <param name="aHREF">The URL for the href attribute.</param>
/// <param name="aText">The text to be displayed inside the anchor tag.</param>
function AddAnchor(const aHREF: string; aText: string): IHTMLWriter; overload;
/// <summary>Opens a <table> tag</summary>
/// <remarks>You cannot use other table related tags (<tr>, <td>, etc.) until a <table> tag is
/// open.</remarks>
function OpenTable: IHTMLWriter; overload;
/// <summary>Opens a <table> tag and adds the 'border' attribute</summary>
function OpenTable(aBorder: integer): IHTMLWriter; overload;
{$REGION 'Documentation'}
/// <summary>
/// Opens a <table> tag with border and cellpadding attributes
/// </summary>
/// <param name="aBorder">
/// The value to be added as the border attribute
/// </param>
/// <param name="aCellPadding">
/// The value to be added as the cellpadding attribute
/// </param>
{$ENDREGION}
function OpenTable(aBorder: integer; aCellPadding: integer): IHTMLWriter; overload;
/// <summary>Opens a <table> tag with border, cellpadding, and cellspacing attributes.</summary>
/// <param name="aBorder">The value for the border attribute.</param>
/// <param name="aCellPadding">The value for the cellpadding attribute.</param>
/// <param name="aCellSpacing">The value for the cellspacing attribute.</param>
function OpenTable(aBorder: integer; aCellPadding: integer; aCellSpacing: integer): IHTMLWriter; overload;
/// <summary>Opens a <table> tag with border, cellpadding, cellspacing, and width attributes.</summary>
/// <param name="aBorder">The value for the border attribute.</param>
/// <param name="aCellPadding">The value for the cellpadding attribute.</param>
/// <param name="aCellSpacing">The value for the cellspacing attribute.</param>
/// <param name="aWidth">The width specification for the table.</param>
function OpenTable(aBorder: integer; aCellPadding: integer; aCellSpacing: integer; aWidth: THTMLWidth): IHTMLWriter; overload;
/// <summary>Opens a <tr> tag.</summary>
function OpenTableRow: IHTMLWriter;
/// <summary>Opens a <td> tag.</summary>
/// <remarks>This method can only be called when a <tr> tag is open.</remarks>
function OpenTableData: IHTMLWriter;
{$REGION 'Documentation'}
/// <summary>
/// Opens a <th> tag
/// </summary>
{$ENDREGION}
function OpenTableHeader: IHTMLWriter;
/// <summary>Opens a <thead> tag.</summary>
/// <remarks>This method can only be called inside a <table> tag.</remarks>
function OpenTableHead: IHTMLWriter;
/// <summary>Opens a <tbody> tag.</summary>
/// <remarks>This method can only be called inside a <table> tag.</remarks>
function OpenTableBody: IHTMLWriter;
/// <summary>Opens a <tfoot> tag.</summary>
/// <remarks>This method can only be called inside a <table> tag.</remarks>
function OpenTableFoot: IHTMLWriter;
/// <summary>Adds the given text inside of a <td> tag.</summary>
/// <exception cref="ENotInTableTagException">Raised when an attempt is made to add something in a table when the appropriate tag is not open.</exception>
/// <remarks>This tag can only be added while a table row <tr> tag is open. Otherwise, an exception is raised.</remarks>
function AddTableData(aText: string): IHTMLWriter;
{$REGION 'Documentation'}
/// <summary>
/// Opens a <caption> tag
/// </summary>
{$ENDREGION}
function OpenCaption: IHTMLWriter;
/// <summary>Opens a <colgroup> tag.</summary>
/// <remarks>This method can only be called inside a <table> tag before any table content.</remarks>
function OpenColGroup: IHTMLWriter;
/// <summary>Opens a <col /> tag.</summary>
/// <remarks>This method can only be called inside a <table> tag before any table content.</remarks>
function OpenCol: IHTMLWriter;
/// <summary>Opens a <form> tag.</summary>
/// <param name="aActionURL">The URL for the action attribute. If empty, no action attribute is added.</param>
/// <param name="aMethod">The HTTP method for the form (GET or POST).</param>
function OpenForm(aActionURL: string = ''; aMethod: TFormMethod = fmGet): IHTMLWriter;
/// <summary>Opens an <input /> tag.</summary>
/// <remarks>This method can only be called inside a <form> tag.</remarks>
function OpenInput: IHTMLWriter; overload;
/// <summary>Opens an <input /> tag with type and optional name attributes.</summary>
/// <param name="aType">The input type (text, password, checkbox, etc.).</param>
/// <param name="aName">The optional name attribute value.</param>
/// <remarks>This method can only be called inside a <form> tag.</remarks>
function OpenInput(aType: TInputType; aName: string = ''): IHTMLWriter; overload;
{$REGION 'Documentation'}
/// <summary>
/// Opens a <button> tag
/// </summary>
/// <param name="aName">
/// Required attribute.� Value given for the 'name' attribute.� All
/// buttons must be named.
/// </param>
{$ENDREGION}
function OpenButton(aName: string): IHTMLWriter;
{$REGION 'Documentation'}
/// <summary>
/// Opens a <label> tag
/// </summary>
{$ENDREGION}
function OpenLabel: IHTMLWriter; overload;
/// <summary>Opens a <label> tag with a for="" attribute.</summary>
/// <param name="aFor">The ID of the form element this label is associated with.</param>
function OpenLabel(aFor: string): IHTMLWriter; overload;
/// <summary>Opens a <select> tag with a name attribute.</summary>
/// <param name="aName">The name attribute value for the select element.</param>
/// <remarks>This method can only be called inside a <form> tag.</remarks>
function OpenSelect(aName: string): IHTMLWriter;
/// <summary>Opens an <option> tag.</summary>
/// <remarks>This method can only be called inside a <select> tag.</remarks>
function OpenOption: IHTMLWriter;
/// <summary>Creates and opens a <textarea> tag.</summary>
/// <param name="aName">A unique identifier given to the tag.</param>
/// <param name="aText">The text to be added inside the <textarea> tag.</param>
function OpenTextArea(aName: string; aCols: integer; aRows: integer): IHTMLWriter;
/// <summary>Opens an <optgroup> tag with a label attribute.</summary>
/// <param name="aLabel">The label for the option group.</param>
/// <remarks>This method can only be called inside a <select> tag.</remarks>
function OpenOptGroup(aLabel: string): IHTMLWriter;
/// <summary>Opens a <fieldset> tag.</summary>
function OpenFieldSet: IHTMLWriter;
/// <summary>Opens a <legend> tag.</summary>
/// <remarks>This method will raise an exception if called outside of an open <fieldset> tag.</remarks>
function OpenLegend: IHTMLWriter;
/// <summary>Adds the passed in text to a <legend></legend> tag</summary>
/// <param name="aText">The text to be included in the Legend tag.</param>
function AddLegend(aText: string): IHTMLWriter;
/// <summary>Opens an <iframe> tag.</summary>
function OpenIFrame: IHTMLWriter; overload;
/// <summary>Opens an <iframe> tag and adds a url parameter</summary>
/// <param name="aURL">The value to be added with the url parameter.</param>
function OpenIFrame(aURL: string): IHTMLWriter; overload;
/// <summary>Opens an <iframe> tag with URL, width, and height attributes.</summary>
/// <param name="aURL">The URL to be displayed in the iframe.</param>
/// <param name="aWidth">The width of the iframe.</param>
/// <param name="aHeight">The height of the iframe in pixels.</param>
function OpenIFrame(aURL: string; aWidth: THTMLWidth; aHeight: integer): IHTMLWriter; overload;
/// <summary>Adds a complete <iframe></iframe> tag with a URL and alternate text.</summary>
/// <param name="aURL">The URL to be displayed in the iframe.</param>
/// <param name="aAlternateText">The text displayed if the iframe cannot be rendered.</param>
function AddIFrame(aURL: string; aAlternateText: string): IHTMLWriter; overload;
/// <summary>Adds a complete <iframe></iframe> tag with URL, alternate text, width, and height.</summary>
/// <param name="aURL">The URL to be displayed in the iframe.</param>
/// <param name="aAlternateText">The text displayed if the iframe cannot be rendered.</param>
/// <param name="aWidth">The width of the iframe.</param>
/// <param name="aHeight">The height of the iframe in pixels.</param>
function AddIFrame(aURL: string; aAlternateText: string; aWidth: THTMLWidth; aHeight: integer): IHTMLWriter; overload;
/// <summary>Opens an unordered list tag (<ul>)</summary>
/// <param name="aBulletShape">An optional parameter indicating the bullet type that the list should use.</param>
/// <seealso cref="TBulletShape">TBulletShape</seealso>
function OpenUnorderedList(aBulletShape: TBulletShape = bsNone): IHTMLWriter;
/// <summary>Opens an ordered list tag (<ol>)</summary>
/// <param name="aNumberType">An optional parameter indicating the numbering type that the list should use.</param>
/// <seealso cref="TNumberType">TNumberType</seealso>
function OpenOrderedList(aNumberType: TNumberType = ntNone): IHTMLWriter;
/// <summary>Opens a list item (<li>) inside of a list.</summary>
function OpenListItem: IHTMLWriter;
/// <summary>Adds a List item (<li>) with the given text</summary>
/// <param name="aText">The text to be added to the list item.</param>
function AddListItem(aText: string): IHTMLWriter;
/// <summary>Opens a <frameset> tag.</summary>
/// <remarks>This tag is not part of the HTML5 specification.</remarks>
function OpenFrameset: IHTMLWriter;
/// <summary>Opens a <frame> tag.</summary>
/// <exception cref="ENotInFrameSetHTMLException">Raised if this is called outside of a <frameset>
/// tag.</exception>
/// <remarks>This tag is not part of the HTML5 specification.</remarks>
function OpenFrame: IHTMLWriter;
/// <summary>Opens a <noframes> tag.</summary>
/// <remarks>This tag is not part of the HTML5 specification.</remarks>
function OpenNoFrames: IHTMLWriter;
/// <summary>Opens a <map /> tag</summary>
function OpenMap: IHTMLWriter;
/// <summary>Opens an <area /> tag</summary>
function OpenArea(aAltText: string): IHTMLWriter;
/// <summary>Opens an <object> tag</summary>
function OpenObject: IHTMLWriter;
/// <summary>Opens a <param> tag</summary>
/// <param name="aName">The name for the parameter</param>
/// <param name="aValue">The value to be assigned to the paramter</param>
/// <remarks>This tag can only be used inside of an <object> tag.</remarks>
/// <exception cref="ENotInObjectTagException">Raised if this method is called outside of an <object>
/// tag</exception>
function OpenParam(aName: string; aValue: string = ''): IHTMLWriter; // name parameter is required
/// <summary>Opens a <dl> (definition list) tag.</summary>
function OpenDefinitionList: IHTMLWriter;
/// <summary>Opens a <dt> (definition term) tag.</summary>
/// <remarks>This method can only be called inside a <dl> tag.</remarks>
function OpenDefinitionTerm: IHTMLWriter;
/// <summary>Opens a <dd> (definition item) tag.</summary>
/// <remarks>This method can only be called after a <dt> or another <dd> tag.</remarks>
function OpenDefinitionItem: IHTMLWriter;
// HTML5 Semantic Structure Elements
/// <summary>Opens an <article> tag.</summary>
function OpenArticle: IHTMLWriter;
/// <summary>Adds the passed in text inside an <article></article> tag.</summary>
/// <param name="aString">The text to be added inside the article tag.</param>
function AddArticleText(aString: string): IHTMLWriter;
/// <summary>Opens an <aside> tag.</summary>
function OpenAside: IHTMLWriter;
/// <summary>Adds the passed in text inside an <aside></aside> tag.</summary>
/// <param name="aString">The text to be added inside the aside tag.</param>
function AddAsideText(aString: string): IHTMLWriter;
/// <summary>Opens a <details> tag.</summary>
function OpenDetails: IHTMLWriter;
/// <summary>Adds the passed in text inside a <details></details> tag.</summary>
/// <param name="aString">The text to be added inside the details tag.</param>
function AddDetailsText(aString: string): IHTMLWriter;
/// <summary>Opens a <figcaption> tag.</summary>
function OpenFigCaption: IHTMLWriter;
/// <summary>Adds the passed in text inside a <figcaption></figcaption> tag.</summary>
/// <param name="aString">The text to be added inside the figcaption tag.</param>
function AddFigCaptionText(aString: string): IHTMLWriter;
/// <summary>Opens a <figure> tag.</summary>
function OpenFigure: IHTMLWriter;
/// <summary>Adds the passed in text inside a <figure></figure> tag.</summary>
/// <param name="aString">The text to be added inside the figure tag.</param>
function AddFigureText(aString: string): IHTMLWriter;
/// <summary>Opens a <footer> tag.</summary>
function OpenFooter: IHTMLWriter;
/// <summary>Adds the passed in text inside a <footer></footer> tag.</summary>
/// <param name="aString">The text to be added inside the footer tag.</param>
function AddFooterText(aString: string): IHTMLWriter;
/// <summary>Opens a <header> tag.</summary>
function OpenHeader: IHTMLWriter;
/// <summary>Adds the passed in text inside a <header></header> tag.</summary>
/// <param name="aString">The text to be added inside the header tag.</param>
function AddHeaderText(aString: string): IHTMLWriter;
/// <summary>Opens a <main> tag.</summary>
function OpenMain: IHTMLWriter;
/// <summary>Adds the passed in text inside a <main></main> tag.</summary>
/// <param name="aString">The text to be added inside the main tag.</param>
function AddMainText(aString: string): IHTMLWriter;
/// <summary>Opens a <nav> tag.</summary>
function OpenNav: IHTMLWriter;
/// <summary>Adds the passed in text inside a <nav></nav> tag.</summary>
/// <param name="aString">The text to be added inside the nav tag.</param>
function AddNavText(aString: string): IHTMLWriter;
/// <summary>Opens a <section> tag.</summary>
function OpenSection: IHTMLWriter;
/// <summary>Adds the passed in text inside a <section></section> tag.</summary>
/// <param name="aString">The text to be added inside the section tag.</param>
function AddSectionText(aString: string): IHTMLWriter;
/// <summary>Opens a <summary> tag.</summary>
function OpenSummary: IHTMLWriter;
/// <summary>Adds the passed in text inside a <summary></summary> tag.</summary>
/// <param name="aString">The text to be added inside the summary tag.</param>
function AddSummaryText(aString: string): IHTMLWriter;
/// <summary>Opens a <dialog> tag.</summary>
function OpenDialog: IHTMLWriter;
/// <summary>Adds the passed in text inside a <dialog></dialog> tag.</summary>
/// <param name="aString">The text to be added inside the dialog tag.</param>
function AddDialogText(aString: string): IHTMLWriter;
// HTML5 Text-Level Semantic Elements
/// <summary>Opens a <mark> tag.</summary>
function OpenMark: IHTMLWriter;
/// <summary>Adds the passed in text inside a <mark></mark> tag.</summary>
/// <param name="aString">The text to be added inside the mark tag.</param>
function AddMarkText(aString: string): IHTMLWriter;
/// <summary>Opens a <bdi> tag.</summary>
function OpenBdi: IHTMLWriter;
/// <summary>Adds the passed in text inside a <bdi></bdi> tag.</summary>
/// <param name="aString">The text to be added inside the bdi tag.</param>
function AddBdiText(aString: string): IHTMLWriter;
/// <summary>Opens a <ruby> tag.</summary>
function OpenRuby: IHTMLWriter;
/// <summary>Adds the passed in text inside a <ruby></ruby> tag.</summary>
/// <param name="aString">The text to be added inside the ruby tag.</param>
function AddRubyText(aString: string): IHTMLWriter;
/// <summary>Opens a <rt> tag.</summary>
function OpenRt: IHTMLWriter;
/// <summary>Adds the passed in text inside a <rt></rt> tag.</summary>
/// <param name="aString">The text to be added inside the rt tag.</param>
function AddRtText(aString: string): IHTMLWriter;
/// <summary>Opens a <rp> tag.</summary>
function OpenRp: IHTMLWriter;
/// <summary>Adds the passed in text inside a <rp></rp> tag.</summary>
/// <param name="aString">The text to be added inside the rp tag.</param>
function AddRpText(aString: string): IHTMLWriter;
/// <summary>Opens a <time> tag.</summary>
function OpenTime: IHTMLWriter;
/// <summary>Adds the passed in text inside a <time></time> tag.</summary>
/// <param name="aString">The text to be added inside the time tag.</param>
function AddTimeText(aString: string): IHTMLWriter;
/// <summary>Opens an <output> tag.</summary>
function OpenOutput: IHTMLWriter;
/// <summary>Adds the passed in text inside an <output></output> tag.</summary>
/// <param name="aString">The text to be added inside the output tag.</param>
function AddOutputText(aString: string): IHTMLWriter;
/// <summary>Adds a <wbr /> tag.</summary>
function AddWordBreak: IHTMLWriter;
// HTML5 Media Elements
/// <summary>Opens an <audio> tag.</summary>
function OpenAudio: IHTMLWriter; overload;
/// <summary>Opens an <audio> tag with a src attribute.</summary>
/// <param name="aSource">The URL of the audio source.</param>
function OpenAudio(aSource: string): IHTMLWriter; overload;
/// <summary>Opens a <video> tag.</summary>
function OpenVideo: IHTMLWriter; overload;
/// <summary>Opens a <video> tag with a src attribute.</summary>
/// <param name="aSource">The URL of the video source.</param>
function OpenVideo(aSource: string): IHTMLWriter; overload;
/// <summary>Opens a <video> tag with src, width, and height attributes.</summary>
/// <param name="aSource">The URL of the video source.</param>
/// <param name="aWidth">The width of the video in pixels.</param>
/// <param name="aHeight">The height of the video in pixels.</param>
function OpenVideo(aSource: string; aWidth: integer; aHeight: integer): IHTMLWriter; overload;
/// <summary>Opens a <source> tag (void element).</summary>
function OpenSourceElement: IHTMLWriter;
/// <summary>Adds a <source /> tag with src and type attributes.</summary>
/// <param name="aSource">The URL of the media source.</param>
/// <param name="aType">The MIME type of the media source.</param>
function AddSourceElement(aSource: string; aType: string): IHTMLWriter;
/// <summary>Opens a <track> tag (void element).</summary>
function OpenTrack: IHTMLWriter;
/// <summary>Opens a <canvas> tag.</summary>
function OpenCanvas: IHTMLWriter; overload;
/// <summary>Opens a <canvas> tag with width and height attributes.</summary>
/// <param name="aWidth">The width of the canvas in pixels.</param>
/// <param name="aHeight">The height of the canvas in pixels.</param>
function OpenCanvas(aWidth: integer; aHeight: integer): IHTMLWriter; overload;
// HTML5 Attribute Helpers
/// <summary>Adds a role="" attribute to the current tag.</summary>
/// <param name="aRole">The WAI-ARIA role value.</param>
function AddRole(aRole: string): IHTMLWriter;
/// <summary>Adds a data-{aName}="{aValue}" custom data attribute to the current tag.</summary>
/// <param name="aName">The data attribute name (without the "data-" prefix).</param>
/// <param name="aValue">The data attribute value.</param>
function AddDataAttribute(aName: string; aValue: string): IHTMLWriter;
/// <summary>Adds an aria-{aName}="{aValue}" accessibility attribute to the current tag.</summary>
/// <param name="aName">The ARIA attribute name (without the "aria-" prefix).</param>
/// <param name="aValue">The ARIA attribute value.</param>
function AddAriaAttribute(aName: string; aValue: string): IHTMLWriter;
/// <summary>Adds a placeholder="" attribute to the current tag.</summary>
/// <param name="aPlaceholder">The placeholder text to display.</param>
function AddPlaceholder(aPlaceholder: string): IHTMLWriter;
// HTML5 Boolean Attribute Helpers
/// <summary>Adds the required boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "required" attribute with no value.</remarks>
function AddRequired: IHTMLWriter;
/// <summary>Adds the disabled boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "disabled" attribute with no value.</remarks>
function AddDisabled: IHTMLWriter;
/// <summary>Adds the autofocus boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "autofocus" attribute with no value.</remarks>
function AddAutofocus: IHTMLWriter;
/// <summary>Adds the hidden boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "hidden" attribute with no value.</remarks>
function AddHidden: IHTMLWriter;
/// <summary>Adds the readonly boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "readonly" attribute with no value.</remarks>
function AddReadonly: IHTMLWriter;
/// <summary>Adds the multiple boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "multiple" attribute with no value.</remarks>
function AddMultiple: IHTMLWriter;
/// <summary>Adds the novalidate boolean attribute to the current tag.</summary>
/// <remarks>Produces a bare "novalidate" attribute with no value.</remarks>
function AddNovalidate: IHTMLWriter;
// HTML5 Additional Elements
/// <summary>Opens a <picture> tag.</summary>
function OpenPicture: IHTMLWriter;
/// <summary>Adds a <picture> tag containing an <img> child element with src and alt attributes.</summary>
/// <param name="aImageSrc">The URL of the image source.</param>
/// <param name="aAltText">The alternative text for the image.</param>
function AddPictureImg(aImageSrc: string; aAltText: string): IHTMLWriter;
/// <summary>Opens a <template> tag.</summary>
function OpenTemplate: IHTMLWriter;
/// <summary>Opens an <embed> tag (void element).</summary>
function OpenEmbed: IHTMLWriter;
/// <summary>Adds an <embed /> tag with src and type attributes.</summary>
/// <param name="aSource">The URL of the embedded content.</param>
/// <param name="aType">The MIME type of the embedded content.</param>
function AddEmbed(aSource: string; aType: string): IHTMLWriter;
// HTML5 Convenience Combo Methods
/// <summary>Adds a <figure> containing an <img> and <figcaption>.</summary>
/// <param name="aImageSrc">The URL of the image source.</param>
/// <param name="aCaptionText">The text for the figcaption element.</param>
function AddFigure(aImageSrc: string; aCaptionText: string): IHTMLWriter;
/// <summary>Adds a <details> containing a <summary> and detail text.</summary>
/// <param name="aSummaryText">The text for the summary element.</param>
/// <param name="aDetailsText">The detail text content.</param>
function AddDetailsSummary(aSummaryText: string; aDetailsText: string): IHTMLWriter;
// HTML5 Form Elements
/// <summary>Opens a <datalist> tag.</summary>
function OpenDatalist: IHTMLWriter;
/// <summary>Opens a <progress> tag.</summary>
function OpenProgress: IHTMLWriter; overload;
/// <summary>Opens a <progress> tag with value and max attributes.</summary>
/// <param name="aValue">The current progress value.</param>
/// <param name="aMax">The maximum value.</param>
function OpenProgress(aValue: integer; aMax: integer): IHTMLWriter; overload;
/// <summary>Opens a <meter> tag.</summary>
function OpenMeter: IHTMLWriter; overload;
/// <summary>Opens a <meter> tag with value, min, and max attributes.</summary>
/// <param name="aValue">The current meter value.</param>
/// <param name="aMin">The minimum value.</param>
/// <param name="aMax">The maximum value.</param>
function OpenMeter(aValue: integer; aMin: integer; aMax: integer): IHTMLWriter; overload;
property Attribute[const Name: string; const Value: string]: IHTMLWriter read GetAttribute; default;
/// <summary>Property determining the level of error reporting that the class should provide.</summary>
property ErrorLevels: THTMLErrorLevels read GetErrorLevels write SetErrorLevels;
property HTML: TStringBuilder read GetHTML;
end;
implementation
end.