~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/fcl-xml/src/dom_html.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    This file is part of the Free Component Library
 
3
 
 
4
    Implementation of DOM HTML interfaces
 
5
    Copyright (c) 2002 by
 
6
      Areca Systems GmbH / Sebastian Guenther, sg@freepascal.org
 
7
 
 
8
    See the file COPYING.FPC, included in this distribution,
 
9
    for details about the copyright.
 
10
 
 
11
    This program is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 
 
15
 **********************************************************************}
 
16
 
 
17
{ Please note that this is a very early version, most properties and methods
 
18
  are not implemented yet. }
 
19
 
 
20
 
 
21
unit DOM_HTML;
 
22
 
 
23
interface
 
24
 
 
25
uses DOM;
 
26
 
 
27
type
 
28
 
 
29
  THTMLDocument = class;
 
30
  THTMLFormElement = class;
 
31
  THTMLTableCaptionElement = class;
 
32
  THTMLTableSectionElement = class;
 
33
 
 
34
  THTMLCollection = class
 
35
  public
 
36
    property Length: Cardinal;  // !!!: ro
 
37
    function Item(Index: Cardinal): TDOMNode;
 
38
    function NamedItem(const Index: DOMString): TDOMNode;
 
39
  end;
 
40
 
 
41
  THTMLOptionsCollection = class
 
42
  public
 
43
    property Length: Cardinal;  // !!!: ro
 
44
    function Item(Index: Cardinal): TDOMNode;
 
45
    function NamedItem(const Index: DOMString): TDOMNode;
 
46
  end;
 
47
 
 
48
  THTMLElement = class(TDOMElement)
 
49
  private
 
50
    function GetID: DOMString;
 
51
    procedure SetID(const Value: DOMString);
 
52
    function GetTitle: DOMString;
 
53
    procedure SetTitle(const Value: DOMString);
 
54
    function GetLang: DOMString;
 
55
    procedure SetLang(const Value: DOMString);
 
56
    function GetDir: DOMString;
 
57
    procedure SetDir(const Value: DOMString);
 
58
    function GetClassName: DOMString;
 
59
    procedure SetClassName(const Value: DOMString);
 
60
  protected
 
61
    constructor Create(AOwner: THTMLDocument; const ATagName: DOMString);
 
62
  public
 
63
    property ID: DOMString read GetID write SetID;
 
64
    property Title: DOMString read GetTitle write SetTitle;
 
65
    property Lang: DOMString read GetLang write SetLang;
 
66
    property Dir: DOMString read GetDir write SetDir;
 
67
    property ClassName: DOMString read GetClassName write SetClassName;
 
68
  end;
 
69
 
 
70
  THTMLHtmlElement = class(THTMLElement)
 
71
  private
 
72
    function GetVersion: DOMString;
 
73
    procedure SetVersion(const Value: DOMString);
 
74
  public
 
75
    property Version: DOMString read GetVersion write SetVersion;
 
76
  end;
 
77
 
 
78
  THTMLHeadElement = class(THTMLElement)
 
79
  private
 
80
    function GetProfile: DOMString;
 
81
    procedure SetProfile(const Value: DOMString);
 
82
  public
 
83
    property Profile: DOMString read GetProfile write SetProfile;
 
84
  end;
 
85
 
 
86
  THTMLLinkElement = class(THTMLElement)
 
87
  public
 
88
    property Disabled: Boolean; // !!!: rw
 
89
    property Charset: DOMString;        // !!!: rw
 
90
    property HRef: DOMString;   // !!!: rw
 
91
    property HRefLang: DOMString;       // !!!: rw
 
92
    property Media: DOMString;  // !!!: rw
 
93
    property Rel: DOMString;    // !!!: rw
 
94
    property Rev: DOMString;    // !!!: rw
 
95
    property Target: DOMString; // !!!: rw
 
96
    property HTMLType: DOMString;       // !!!: rw
 
97
  end;
 
98
 
 
99
  THTMLTitleElement = class(THTMLElement)
 
100
  public
 
101
    property Text: DOMString;   // !!!: rw
 
102
  end;
 
103
 
 
104
  THTMLMetaElement = class(THTMLElement)
 
105
  public
 
106
    property Content: DOMString;        // !!!: rw
 
107
    property HTTPEqiv: DOMString;       // !!!: rw
 
108
    property Name: DOMString;   // !!!: rw
 
109
    property Scheme: DOMString; // !!!: rw
 
110
  end;
 
111
 
 
112
  THTMLBaseElement = class(THTMLElement)
 
113
  public
 
114
    property HRef: DOMString;   // !!!: rw
 
115
    property Target: DOMString; // !!!: rw
 
116
  end;
 
117
 
 
118
  THTMLIsIndexElement = class(THTMLElement)
 
119
  public
 
120
    property Form: THTMLFormElement;    // !!!: ro
 
121
    property Prompt: DOMString; // !!!: rw
 
122
  end;
 
123
 
 
124
  THTMLStyleElement = class(THTMLElement)
 
125
  public
 
126
    property Disabled: Boolean; // !!!: rw
 
127
    property Media: DOMString;  // !!!: rw
 
128
    property HTMLType: DOMString;       // !!!: rw
 
129
  end;
 
130
 
 
131
  THTMLBodyElement = class(THTMLElement)
 
132
  public
 
133
    property ALink: DOMString;  // !!!: rw
 
134
    property Background: DOMString;     // !!!: rw
 
135
    property BgColor: DOMString;        // !!!: rw
 
136
    property Link: DOMString;   // !!!: rw
 
137
    property Text: DOMString;   // !!!: rw
 
138
    property VLink: DOMString;  // !!!: rw
 
139
  end;
 
140
 
 
141
  THTMLFormElement = class(THTMLElement)
 
142
  public
 
143
    property Elements: THTMLCollection; // !!!: ro
 
144
    property Length: Integer;   // !!!: ro
 
145
    property Name: DOMString;   // !!!: rw
 
146
    property AcceptCharset: DOMString;  // !!!: rw
 
147
    property Action: DOMString; // !!!: rw
 
148
    property EncType: DOMString;        // !!!: rw
 
149
    property Method: DOMString; // !!!: rw
 
150
    property Target: DOMString; // !!!: rw
 
151
    procedure Submit; virtual; abstract;
 
152
    procedure Reset; virtual; abstract;
 
153
  end;
 
154
 
 
155
  THTMLSelectElement = class(THTMLElement)
 
156
  public
 
157
    property HTMLType: DOMString;       // !!!: ro
 
158
    property SelectedIndex: Integer;    // !!!: rw
 
159
    property Value: DOMString;  // !!!: rw
 
160
    property Length: Cardinal;  // !!!: rw
 
161
    property Form: THTMLFormElement;    // !!!: ro
 
162
    property Options: THTMLOptionsCollection;   // !!!: ro
 
163
    property Disabled: Boolean; // !!!: rw
 
164
    property Multiple: Boolean; // !!!: rw
 
165
    property Name: DOMString;   // !!!: rw
 
166
    property Size: Integer;     // !!!: rw
 
167
    property TabIndex: Integer; // !!!: rw
 
168
    procedure Add(Element, Before: THTMLElement);
 
169
    procedure Remove(Index: Integer);
 
170
    procedure Blur; virtual; abstract;
 
171
    procedure Focus; virtual; abstract;
 
172
  end;
 
173
 
 
174
  THTMLOptGroupElement = class(THTMLElement)
 
175
  public
 
176
    property Disabled: Boolean; // !!!: rw
 
177
    property GroupLabel: DOMString;     // !!!: rw
 
178
  end;
 
179
 
 
180
  THTMLOptionElement = class(THTMLElement)
 
181
  public
 
182
    property Form: THTMLFormElement;    // !!!: ro
 
183
    property DefaultSelected: Boolean;  // !!!: rw
 
184
    property Text: DOMString;   // !!!: ro
 
185
    property Index: Integer;    // !!!: ro
 
186
    property Disabled: Boolean; // !!!: rw
 
187
    property OptionLabel: DOMString;    // !!!: rw
 
188
    property Selected: Boolean; // !!!: rw
 
189
    property Value: DOMString;  // !!!: rw
 
190
  end;
 
191
 
 
192
  THTMLInputElement = class(THTMLElement)
 
193
  public
 
194
    property DefaultValue: DOMString;   // !!!: rw
 
195
    property DefaultChecked: Boolean;   // !!!: rw
 
196
    property Form: THTMLFormElement;    // !!!: ro
 
197
    property Accept: DOMString; // !!!: rw
 
198
    property AccessKey: DOMString;      // !!!: rw
 
199
    property Align: DOMString;  // !!!: rw
 
200
    property Alt: DOMString;    // !!!: rw
 
201
    property Checked: Boolean;  // !!!: rw
 
202
    property Disabled: Boolean; // !!!: rw
 
203
    property MaxLength: Integer;        // !!!: rw
 
204
    property Name: DOMString;   // !!!: rw
 
205
    property ReadOnly: Boolean; // !!!: rw
 
206
    property Size: Cardinal;    // !!!: rw
 
207
    property Src: DOMString;    // !!!: rw
 
208
    property TabIndex: Integer; // !!!: rw
 
209
    property HTMLType: DOMString;       // !!!: rw
 
210
    property UseMap: DOMString; // !!!: rw
 
211
    property Value: DOMString;  // !!!: rw
 
212
    procedure Blur; virtual; abstract;
 
213
    procedure Focus; virtual; abstract;
 
214
    procedure Select; virtual; abstract;
 
215
    procedure Click; virtual; abstract;
 
216
  end;
 
217
 
 
218
  THTMLTextAreaElement = class(THTMLElement)
 
219
  public
 
220
    property DefaultValue: DOMString;   // !!!: rw
 
221
    property Form: THTMLFormElement;    // !!!: ro
 
222
    property AccessKey: DOMString;      // !!!: rw
 
223
    property Cols: Integer;     // !!!: rw
 
224
    property Disabled: Boolean; // !!!: rw
 
225
    property Name: DOMString;   // !!!: rw
 
226
    property ReadOnly: Boolean; // !!!: rw
 
227
    property Rows: Integer;     // !!!: rw
 
228
    property TabIndex: Integer; // !!!: rw
 
229
    property HTMLType: DOMString;       // !!!: rw
 
230
    property Value: DOMString;  // !!!: rw
 
231
    procedure Blur; virtual; abstract;
 
232
    procedure Focus; virtual; abstract;
 
233
    procedure Select; virtual; abstract;
 
234
  end;
 
235
 
 
236
  THTMLButtonElement = class(THTMLElement)
 
237
  public
 
238
    property Form: THTMLFormElement;    // !!!: ro
 
239
    property AccessKey: DOMString;      // !!!: rw
 
240
    property Disabled: Boolean; // !!!: rw
 
241
    property Name: DOMString;   // !!!: rw
 
242
    property TabIndex: Integer; // !!!: rw
 
243
    property HTMLType: DOMString;       // !!!: rw
 
244
    property Value: DOMString;  // !!!: rw
 
245
  end;
 
246
 
 
247
  THTMLLabelElement = class(THTMLElement)
 
248
  public
 
249
    property Form: THTMLFormElement;    // !!!: ro
 
250
    property AccessKey: DOMString;      // !!!: rw
 
251
    property HtmlFor: DOMString;        // !!!: rw
 
252
  end;
 
253
 
 
254
  THTMLFieldSetElement = class(THTMLElement)
 
255
  public
 
256
    property Form: THTMLFormElement;    // !!!: ro
 
257
  end;
 
258
 
 
259
  THTMLLegendElement = class(THTMLElement)
 
260
  public
 
261
    property Form: THTMLFormElement;    // !!!: ro
 
262
    property AccessKey: DOMString;      // !!!: rw
 
263
    property Align: DOMString;  // !!!: rw
 
264
  end;
 
265
 
 
266
  THTMLUListElement = class(THTMLElement)
 
267
  public
 
268
    property Compact: Boolean;  // !!!: rw
 
269
    property HTMLType: DOMString;       // !!!: rw
 
270
  end;
 
271
 
 
272
  THTMLOListElement = class(THTMLElement)
 
273
  public
 
274
    property Compact: Boolean;  // !!!: rw
 
275
    property Start: Integer;    // !!!: rw
 
276
    property HTMLType: DOMString;       // !!!: rw
 
277
  end;
 
278
 
 
279
  THTMLDListElement = class(THTMLElement)
 
280
  public
 
281
    property Compact: Boolean;  // !!!: rw
 
282
  end;
 
283
 
 
284
  THTMLDirectoryElement = class(THTMLElement)
 
285
  public
 
286
    property Compact: Boolean;  // !!!: rw
 
287
  end;
 
288
 
 
289
  THTMLMenuElement = class(THTMLElement)
 
290
  public
 
291
    property Compact: Boolean;  // !!!: rw
 
292
  end;
 
293
 
 
294
  THTMLLIElement = class(THTMLElement)
 
295
  public
 
296
    property HTMLType: DOMString;       // !!!: rw
 
297
    property Value: Integer;    // !!!: rw
 
298
  end;
 
299
 
 
300
  THTMLDivElement = class(THTMLElement)
 
301
  public
 
302
    property Align: DOMString;  // !!!: rw
 
303
  end;
 
304
 
 
305
  THTMLParagraphElement = class(THTMLElement)
 
306
  public
 
307
    property Align: DOMString;  // !!!: rw
 
308
  end;
 
309
 
 
310
  THTMLHeadingElement = class(THTMLElement)
 
311
  public
 
312
    property Align: DOMString;  // !!!: rw
 
313
  end;
 
314
 
 
315
  THTMLQuoteElement = class(THTMLElement)
 
316
  public
 
317
    property Cite: DOMString;   // !!!: rw
 
318
  end;
 
319
 
 
320
  THTMLPreElement = class(THTMLElement)
 
321
  public
 
322
    property Width: Integer;    // !!!: rw
 
323
  end;
 
324
 
 
325
  THTMLBREElement = class(THTMLElement)
 
326
  public
 
327
    property Clear: DOMString;  // !!!: rw
 
328
  end;
 
329
 
 
330
  THTMLBaseFontElement = class(THTMLElement)
 
331
  public
 
332
    property Color: DOMString;  // !!!: rw
 
333
    property Face: DOMString;   // !!!: rw
 
334
    property Size: Integer;     // !!!: rw
 
335
  end;
 
336
 
 
337
  THTMLFontElement = class(THTMLElement)
 
338
  public
 
339
    property Color: DOMString;  // !!!: rw
 
340
    property Face: DOMString;   // !!!: rw
 
341
    property Size: Integer;     // !!!: rw
 
342
  end;
 
343
 
 
344
  THTMLHRElement = class(THTMLElement)
 
345
  public
 
346
    property Align: DOMString;  // !!!: rw
 
347
    property NoShade: Boolean;  // !!!: rw
 
348
    property Size: DOMString;   // !!!: rw
 
349
    property Width: DOMString;  // !!!: rw
 
350
  end;
 
351
 
 
352
  THTMLModElement = class(THTMLElement)
 
353
  public
 
354
    property Cite: DOMString;   // !!!: rw
 
355
    property DateTime: DOMString;       // !!!: rw
 
356
  end;
 
357
 
 
358
  THTMLAnchorElement = class(THTMLElement)
 
359
  public
 
360
    property AccessKey: DOMString;      // !!!: rw
 
361
    property Charset: DOMString;        // !!!: rw
 
362
    property Coords: DOMString; // !!!: rw
 
363
    property HRef: DOMString;   // !!!: rw
 
364
    property HRefLang: DOMString;       // !!!: rw
 
365
    property Name: DOMString;   // !!!: rw
 
366
    property Rel: DOMString;    // !!!: rw
 
367
    property Rev: DOMString;    // !!!: rw
 
368
    property Shape: DOMString;  // !!!: rw
 
369
    property TabIndex: Integer; // !!!: rw
 
370
    property Target: DOMString; // !!!: rw
 
371
    property HTMLType: DOMString;       // !!!: rw
 
372
    procedure Blur; virtual; abstract;
 
373
    procedure Focus; virtual; abstract;
 
374
  end;
 
375
 
 
376
  THTMLImageElement = class(THTMLElement)
 
377
  public
 
378
    property Name: DOMString;   // !!!: rw
 
379
    property Align: DOMString;  // !!!: rw
 
380
    property Alt: DOMString;    // !!!: rw
 
381
    property Border: DOMString; // !!!: rw
 
382
    property Height: Integer;   // !!!: rw
 
383
    property HSpace: Integer;   // !!!: rw
 
384
    property IsMap: Boolean;    // !!!: rw
 
385
    property LongDesc: DOMString;       // !!!: rw
 
386
    property Src: Integer;      // !!!: rw
 
387
    property UseMap: DOMString; // !!!: rw
 
388
    property VSpace: Integer;   // !!!: rw
 
389
    property Width: Integer;    // !!!: rw
 
390
  end;
 
391
 
 
392
  THTMLObjectElement = class(THTMLElement)
 
393
  public
 
394
    property Form: THTMLFormElement;    // !!!: ro
 
395
    property Code: DOMString;   // !!!: rw
 
396
    property Align: DOMString;  // !!!: rw
 
397
    property Archive: DOMString;        // !!!: rw
 
398
    property Border: DOMString; // !!!: rw
 
399
    property CodeBase: DOMString;       // !!!: rw
 
400
    property CodeType: DOMString;       // !!!: rw
 
401
    property Data: DOMString;   // !!!: rw
 
402
    property Declare: Boolean;  // !!!: rw
 
403
    property Height: DOMString; // !!!: rw
 
404
    property HSpace: Integer;   // !!!: rw
 
405
    property Name: DOMString;   // !!!: rw
 
406
    property StandBy: DOMString;        // !!!: rw
 
407
    property TabIndex: Integer; // !!!: rw
 
408
    property HTMLType: DOMString;       // !!!: rw
 
409
    property UseMap: DOMString; // !!!: rw
 
410
    property VSpace: Integer;   // !!!: rw
 
411
    property Width: Integer;    // !!!: rw
 
412
    property ContentDocument: TDOMDocument;     // !!!: ro
 
413
  end;
 
414
 
 
415
  THTMLParamElement = class(THTMLElement)
 
416
  public
 
417
    property Name: DOMString;   // !!!: rw
 
418
    property HTMLType: DOMString;       // !!!: rw
 
419
    property Value: DOMString;  // !!!: rw
 
420
    property ValueType: DOMString;      // !!!: rw
 
421
  end;
 
422
 
 
423
  THTMLAppletElement = class(THTMLElement)
 
424
  public
 
425
    property Align: DOMString;  // !!!: rw
 
426
    property Alt: DOMString;    // !!!: rw
 
427
    property Archive: DOMString;        // !!!: rw
 
428
    property Code: DOMString;   // !!!: rw
 
429
    property CodeBase: DOMString;       // !!!: rw
 
430
    property Height: DOMString; // !!!: rw
 
431
    property HSpace: Integer;   // !!!: rw
 
432
    property Name: DOMString;   // !!!: rw
 
433
    property AppletObject: DOMString;   // !!!: rw
 
434
    property VSpace: Integer;   // !!!: rw
 
435
    property Width: Integer;    // !!!: rw
 
436
  end;
 
437
 
 
438
  THTMLMapElement = class(THTMLElement)
 
439
  public
 
440
    property Areas: THTMLCollection;    // !!!: ro
 
441
    property Name: DOMString;   // !!!: rw
 
442
  end;
 
443
 
 
444
  THTMLAreaElement = class(THTMLElement)
 
445
  public
 
446
    property AccessKey: DOMString;      // !!!: rw
 
447
    property Alt: DOMString;    // !!!: rw
 
448
    property Coords: DOMString; // !!!: rw
 
449
    property HRef: DOMString;   // !!!: rw
 
450
    property NoHRef: Boolean;   // !!!: rw
 
451
    property Shape: DOMString;  // !!!: rw
 
452
    property TabIndex: Integer; // !!!: rw
 
453
    property Target: DOMString; // !!!: rw
 
454
  end;
 
455
 
 
456
  THTMLScriptElement = class(THTMLElement)
 
457
  public
 
458
    property Text: DOMString;   // !!!: rw
 
459
    property HtmlFor: DOMString;        // !!!: rw
 
460
    property Event: DOMString;  // !!!: rw
 
461
    property Charset: DOMString;        // !!!: rw
 
462
    property Defer: Boolean;    // !!!: rw
 
463
    property Src: DOMString;    // !!!: rw
 
464
    property HTMLType: DOMString;       // !!!: rw
 
465
  end;
 
466
 
 
467
  THTMLTableElement = class(THTMLElement)
 
468
  public
 
469
    property Caption: THTMLTableCaptionElement; // !!!: rw
 
470
    property THead: THTMLTableSectionElement;   // !!!: rw
 
471
    property TFoot: THTMLTableSectionElement;   // !!!: rw
 
472
    property Rows: THTMLCollection;     // !!!: ro
 
473
    property TBodies: THTMLCollection;  // !!!: ro
 
474
    property Align: DOMString;  // !!!: rw
 
475
    property BgColor: DOMString;        // !!!: rw
 
476
    property Border: DOMString; // !!!: rw
 
477
    property CellPadding: DOMString;    // !!!: rw
 
478
    property CellSpacing: DOMString;    // !!!: rw
 
479
    property Frame: DOMString;  // !!!: rw
 
480
    property Rules: DOMString;  // !!!: rw
 
481
    property Summary: DOMString;        // !!!: rw
 
482
    property Width: DOMString;  // !!!: rw
 
483
    function CreateTHead: THTMLElement;
 
484
    procedure DeleteTHead;
 
485
    function CreateTFoot: THTMLElement;
 
486
    procedure DeleteTFoot;
 
487
    function CreateCaption: THTMLElement;
 
488
    procedure DeleteCaption;
 
489
    function InsertRow(Index: Integer): THTMLElement;
 
490
    procedure DeleteRow(Index: Integer);
 
491
  end;
 
492
 
 
493
  THTMLTableCaptionElement = class(THTMLElement)
 
494
  public
 
495
    property Align: DOMString;  // !!!: rw
 
496
  end;
 
497
 
 
498
  THTMLTableColElement = class(THTMLElement)
 
499
  public
 
500
    property Align: DOMString;  // !!!: rw
 
501
    property Ch: DOMString;     // !!!: rw
 
502
    property ChOff: DOMString;  // !!!: rw
 
503
    property Span: Integer;     // !!!: rw
 
504
    property VAlign: DOMString; // !!!: rw
 
505
    property Width: DOMString;  // !!!: rw
 
506
  end;
 
507
 
 
508
  THTMLTableSectionElement = class(THTMLElement)
 
509
  public
 
510
    property Align: DOMString;  // !!!: rw
 
511
    property Ch: DOMString;     // !!!: rw
 
512
    property ChOff: DOMString;  // !!!: rw
 
513
    property VAlign: DOMString; // !!!: rw
 
514
    property Rows: THTMLCollection;     // !!!: ro
 
515
    function InsertRow(Index: Integer): THTMLElement;
 
516
    procedure DeleteRow(Index: Integer);
 
517
  end;
 
518
 
 
519
  THTMLTableRowElement = class(THTMLElement)
 
520
  public
 
521
    property RowIndex: Integer; // !!!: ro
 
522
    property SectionRowIndex: Integer;  // !!!: ro
 
523
    property Cells: THTMLCollection;    // !!!: ro
 
524
    property Align: DOMString;  // !!!: rw
 
525
    property BgColor: DOMString;        // !!!: rw
 
526
    property Ch: DOMString;     // !!!: rw
 
527
    property ChOff: DOMString;  // !!!: rw
 
528
    property VAlign: DOMString; // !!!: rw
 
529
    function InsertCell(Index: Integer): THTMLElement;
 
530
    procedure DeleteCell(Index: Integer);
 
531
  end;
 
532
 
 
533
  THTMLTableCellElement = class(THTMLElement)
 
534
  public
 
535
    property CellIndex: Integer;        // !!!: ro
 
536
    property Abbr: DOMString;   // !!!: rw
 
537
    property Align: DOMString;  // !!!: rw
 
538
    property Axis: DOMString;   // !!!: rw
 
539
    property BgColor: DOMString;        // !!!: rw
 
540
    property Ch: DOMString;     // !!!: rw
 
541
    property ChOff: DOMString;  // !!!: rw
 
542
    property ColSpan: Integer;  // !!!: rw
 
543
    property Headers: DOMString;        // !!!: rw
 
544
    property Height: DOMString; // !!!: rw
 
545
    property NoWrap: Boolean;   // !!!: rw
 
546
    property RowSpan: Integer;  // !!!: rw
 
547
    property Scope: DOMString;  // !!!: rw
 
548
    property VAlign: DOMString; // !!!: rw
 
549
    property Width: DOMString;  // !!!: rw
 
550
  end;
 
551
 
 
552
  THTMLFrameSetElement = class(THTMLElement)
 
553
  public
 
554
    property Cols: DOMString;   // !!!: rw
 
555
    property Rows: DOMString;   // !!!: rw
 
556
  end;
 
557
 
 
558
  THTMLFrameElement = class(THTMLElement)
 
559
  public
 
560
    property FrameBorder: DOMString;    // !!!: rw
 
561
    property LongDesc: DOMString;       // !!!: rw
 
562
    property MarginHeight: DOMString;   // !!!: rw
 
563
    property MarginWidth: DOMString;    // !!!: rw
 
564
    property Name: DOMString;   // !!!: rw
 
565
    property NoResize: Boolean; // !!!: rw
 
566
    property Scrolling: DOMString;      // !!!: rw
 
567
    property Src: DOMString;    // !!!: rw
 
568
    property ContentDocument: TDOMDocument;     // !!!: ro
 
569
  end;
 
570
 
 
571
  THTMLIFrameElement = class(THTMLElement)
 
572
  public
 
573
    property Align: DOMString;  // !!!: rw
 
574
    property FrameBorder: DOMString;    // !!!: rw
 
575
    property Height: DOMString; // !!!: rw
 
576
    property LongDesc: DOMString;       // !!!: rw
 
577
    property MarginHeight: DOMString;   // !!!: rw
 
578
    property MarginWidth: DOMString;    // !!!: rw
 
579
    property Name: DOMString;   // !!!: rw
 
580
    property Scrolling: DOMString;      // !!!: rw
 
581
    property Src: DOMString;    // !!!: rw
 
582
    property Width: DOMString;  // !!!: rw
 
583
    property ContentDocument: TDOMDocument;     // !!!: ro
 
584
  end;
 
585
 
 
586
  THTMLDocument = class(TXMLDocument)
 
587
  private
 
588
    function GetTitle: DOMString;
 
589
    procedure SetTitle(const Value: DOMString);
 
590
  public
 
591
    property Title: DOMString read GetTitle write SetTitle;
 
592
    property Referrer: DOMString;       // !!!: ro
 
593
    property Domain: DOMString; // !!!: ro
 
594
    property URL: DOMString;    // !!!: ro
 
595
    property Body: THTMLElement;        // !!!: rw
 
596
    property Images: THTMLCollection;   // !!!: ro
 
597
    property Applets: THTMLCollection;  // !!!: ro
 
598
    property Links: THTMLCollection;    // !!!: ro
 
599
    property Forms: THTMLCollection;    // !!!: ro
 
600
    property Anchors: THTMLCollection;  // !!!: ro
 
601
    property Cookie: DOMString;         // !!!: rw
 
602
 
 
603
    procedure Open; virtual; abstract;
 
604
    procedure Close; virtual; abstract;
 
605
    procedure Write(const AText: DOMString);
 
606
    procedure WriteLn(const AText: DOMString);
 
607
    function GetElementsByName(const ElementName: DOMString): TDOMNodeList;
 
608
 
 
609
    // Helper functions (not in DOM standard):
 
610
    function CreateElement(const tagName: DOMString): THTMLElement;
 
611
    function CreateSubElement: THTMLElement;
 
612
    function CreateSupElement: THTMLElement;
 
613
    function CreateSpanElement: THTMLElement;
 
614
    function CreateBDOElement: THTMLElement;
 
615
    function CreateTTElement: THTMLElement;
 
616
    function CreateIElement: THTMLElement;
 
617
    function CreateBElement: THTMLElement;
 
618
    function CreateUElement: THTMLElement;
 
619
    function CreateSElement: THTMLElement;
 
620
    function CreateStrikeElement: THTMLElement;
 
621
    function CreateBigElement: THTMLElement;
 
622
    function CreateSmallElement: THTMLElement;
 
623
    function CreateEmElement: THTMLElement;
 
624
    function CreateStrongElement: THTMLElement;
 
625
    function CreateDfnElement: THTMLElement;
 
626
    function CreateCodeElement: THTMLElement;
 
627
    function CreateSampElement: THTMLElement;
 
628
    function CreateKbdElement: THTMLElement;
 
629
    function CreateVarElement: THTMLElement;
 
630
    function CreateCiteElement: THTMLElement;
 
631
    function CreateAcronymElement: THTMLElement;
 
632
    function CreateAbbrElement: THTMLElement;
 
633
    function CreateDDElement: THTMLElement;
 
634
    function CreateDTElement: THTMLElement;
 
635
    function CreateNoFramesElement: THTMLElement;
 
636
    function CreateNoScriptElement: THTMLElement;
 
637
    function CreateAddressElement: THTMLElement;
 
638
    function CreateCenterElement: THTMLElement;
 
639
    function CreateHtmlElement: THTMLHtmlElement;
 
640
    function CreateHeadElement: THTMLHeadElement;
 
641
    function CreateLinkElement: THTMLLinkElement;
 
642
{    function CreateTitleElement: THTMLTitleElement;
 
643
    function CreateMetaElement: THTMLMetaElement;
 
644
    function CreateBaseElement: THTMLBaseElement;
 
645
    function CreateIsIndexElement: THTMLIsIndexElement;
 
646
    function CreateStyleElement: THTMLStyleElement;}
 
647
    function CreateBodyElement: THTMLBodyElement;
 
648
{    function CreateFormElement: THTMLFormElement;
 
649
    function CreateSelectElement: THTMLSelectElement;
 
650
    function CreateOptGroupElement: THTMLOptGroupElement;
 
651
    function CreateOptionElement: THTMLOptionElement;
 
652
    function CreateInputElement: THTMLInputElement;
 
653
    function CreateTextAreaElement: THTMLTextAreaElement;
 
654
    function CreateButtonElement: THTMLButtonElement;
 
655
    function CreateLabelElement: THTMLLabelElement;
 
656
    function CreateFieldSetElement: THTMLFieldSetElement;
 
657
    function CreateLegendElement: THTMLLegendElement;}
 
658
    function CreateUListElement: THTMLUListElement;
 
659
    function CreateOListElement: THTMLOListElement;
 
660
    function CreateDListElement: THTMLDListElement;
 
661
{    function CreateDirectoryElement: THTMLDirectoryElement;
 
662
    function CreateMenuElement: THTMLMenuElement;}
 
663
    function CreateLIElement: THTMLLIElement;
 
664
{    function CreateDivElement: THTMLDivElement;}
 
665
    function CreateParagraphElement: THTMLParagraphElement;
 
666
{    function CreateHeadingElement: THTMLHeadingElement;
 
667
    function CreateQuoteElement: THTMLQuoteElement;
 
668
    function CreatePreElement: THTMLPreElement;
 
669
    function CreateBRElement: THTMLBreElement;
 
670
    function CreateBaseFontElement: THTMLBaseFontElement;
 
671
    function CreateFontElement: THTMFontLElement;
 
672
    function CreateHRElement: THTMLHREElement;
 
673
    function CreateModElement: THTMLModElement;
 
674
    function CreateAnchorElement: THTMLAnchorElement;
 
675
    function CreateImageElement: THTMLImageElement;
 
676
    function CreateObjectElement: THTMLObjectElement;
 
677
    function CreateParamElement: THTMLParamElement;
 
678
    function CreateAppletElement: THTMLAppletElement;
 
679
    function CreateMapElement: THTMLMapElement;
 
680
    function CreateAreaElement: THTMLAreaElement;
 
681
    function CreateScriptElement: THTMLScriptElement;
 
682
    function CreateTableElement: THTMLTableElement;
 
683
    function CreateTableCaptionElement: THTMLTableCaptionElement;
 
684
    function CreateTableColElement: THTMLTableColElement;
 
685
    function CreateTableSectionElement: THTMLTableSectionElement;
 
686
    function CreateTableRowElement: THTMLTableRowElement;
 
687
    function CreateTableCellElement: THTMLTableCellElement;
 
688
    function CreateFrameSetElement: THTMLFrameSetElement;
 
689
    function CreateFrameElement: THTMLFrameElement;
 
690
    function CreateIFrameElement: THTMLIFrameElement;}
 
691
  end;
 
692
 
 
693
 
 
694
implementation
 
695
 
 
696
 
 
697
function THTMLCollection.Item(Index: Cardinal): TDOMNode;
 
698
begin
 
699
  Result := nil;
 
700
end;
 
701
 
 
702
function THTMLCollection.NamedItem(const Index: DOMString): TDOMNode;
 
703
begin
 
704
  Result := nil;
 
705
end;
 
706
 
 
707
 
 
708
function THTMLOptionsCollection.Item(Index: Cardinal): TDOMNode;
 
709
begin
 
710
  Result := nil;
 
711
end;
 
712
 
 
713
function THTMLOptionsCollection.NamedItem(const Index: DOMString): TDOMNode;
 
714
begin
 
715
  Result := nil;
 
716
end;
 
717
 
 
718
 
 
719
constructor THTMLElement.Create(AOwner: THTMLDocument; const ATagName: DOMString);
 
720
begin
 
721
  inherited Create(AOwner);
 
722
  FNodeName := ATagName;
 
723
end;
 
724
 
 
725
function THTMLElement.GetID: DOMString; begin Result := GetAttribute('id') end;
 
726
procedure THTMLElement.SetID(const Value: DOMString); begin SetAttribute('id', Value) end;
 
727
function THTMLElement.GetTitle: DOMString; begin Result := GetAttribute('title') end;
 
728
procedure THTMLElement.SetTitle(const Value: DOMString); begin SetAttribute('title', Value) end;
 
729
function THTMLElement.GetLang: DOMString; begin Result := GetAttribute('lang') end;
 
730
procedure THTMLElement.SetLang(const Value: DOMString); begin SetAttribute('lang', Value) end;
 
731
function THTMLElement.GetDir: DOMString; begin Result := GetAttribute('dir') end;
 
732
procedure THTMLElement.SetDir(const Value: DOMString); begin SetAttribute('dir', Value) end;
 
733
function THTMLElement.GetClassName: DOMString; begin  Result := GetAttribute('class') end;
 
734
procedure THTMLElement.SetClassName(const Value: DOMString); begin SetAttribute('class', Value) end;
 
735
 
 
736
 
 
737
function THTMLHtmlElement.GetVersion: DOMString; begin  Result := GetAttribute('version') end;
 
738
procedure THTMLHtmlElement.SetVersion(const Value: DOMString); begin SetAttribute('version', Value) end;
 
739
 
 
740
 
 
741
function THTMLHeadElement.GetProfile: DOMString; begin  Result := GetAttribute('profile') end;
 
742
procedure THTMLHeadElement.SetProfile(const Value: DOMString); begin SetAttribute('profile', Value) end;
 
743
 
 
744
 
 
745
procedure THTMLSelectElement.Add(Element, Before: THTMLElement);
 
746
begin
 
747
end;
 
748
 
 
749
procedure THTMLSelectElement.Remove(Index: Integer);
 
750
begin
 
751
end;
 
752
 
 
753
 
 
754
function THTMLTableElement.CreateTHead: THTMLElement;
 
755
begin
 
756
  Result := nil;
 
757
end;
 
758
 
 
759
procedure THTMLTableElement.DeleteTHead;
 
760
begin
 
761
end;
 
762
 
 
763
function THTMLTableElement.CreateTFoot: THTMLElement;
 
764
begin
 
765
  Result := nil;
 
766
end;
 
767
 
 
768
procedure THTMLTableElement.DeleteTFoot;
 
769
begin
 
770
end;
 
771
 
 
772
function THTMLTableElement.CreateCaption: THTMLElement;
 
773
begin
 
774
  Result := nil;
 
775
end;
 
776
 
 
777
procedure THTMLTableElement.DeleteCaption;
 
778
begin
 
779
end;
 
780
 
 
781
function THTMLTableElement.InsertRow(Index: Integer): THTMLElement;
 
782
begin
 
783
  Result := nil;
 
784
end;
 
785
 
 
786
procedure THTMLTableElement.DeleteRow(Index: Integer);
 
787
begin
 
788
end;
 
789
 
 
790
 
 
791
function THTMLTableSectionElement.InsertRow(Index: Integer): THTMLElement;
 
792
begin
 
793
  Result := nil;
 
794
end;
 
795
 
 
796
procedure THTMLTableSectionElement.DeleteRow(Index: Integer);
 
797
begin
 
798
end;
 
799
 
 
800
 
 
801
function THTMLTableRowElement.InsertCell(Index: Integer): THTMLElement;
 
802
begin
 
803
  Result := nil;
 
804
end;
 
805
 
 
806
procedure THTMLTableRowElement.DeleteCell(Index: Integer);
 
807
begin
 
808
end;
 
809
 
 
810
 
 
811
function THTMLDocument.GetTitle: DOMString;
 
812
var
 
813
  Node: TDOMNode;
 
814
begin
 
815
  Result := '';
 
816
  if not Assigned(DocumentElement) then
 
817
    exit;
 
818
  Node := DocumentElement.FirstChild;
 
819
  while Assigned(Node) and (Node.NodeName <> 'head') do
 
820
    Node := Node.NextSibling;
 
821
  if not Assigned(Node) then
 
822
    exit;
 
823
  Node := Node.FirstChild;
 
824
  while Assigned(Node) and (Node.NodeName <> 'title') do
 
825
    Node := Node.NextSibling;
 
826
  if not Assigned(Node) then
 
827
    exit;
 
828
  Node := Node.FirstChild;
 
829
  if Assigned(Node) and (Node.NodeType = TEXT_NODE) then
 
830
    Result := Node.NodeValue;
 
831
end;
 
832
 
 
833
procedure THTMLDocument.SetTitle(const Value: DOMString);
 
834
var
 
835
  Node: TDOMNode;
 
836
  TitleEl: TDOMElement;
 
837
begin
 
838
  if not Assigned(DocumentElement) then
 
839
    AppendChild(CreateHtmlElement);
 
840
  Node := DocumentElement.FirstChild;
 
841
  while Assigned(Node) and (Node.NodeName <> 'head') do
 
842
    Node := Node.NextSibling;
 
843
  if not Assigned(Node) then
 
844
  begin
 
845
    Node := CreateHeadElement;
 
846
    DocumentElement.InsertBefore(Node, DocumentElement.FirstChild);
 
847
  end;
 
848
  TitleEl := TDOMElement(Node.FirstChild);
 
849
  while Assigned(TitleEl) and (TitleEl.NodeName <> 'title') do
 
850
    TitleEl := TDOMElement(TitleEl.NextSibling);
 
851
  if not Assigned(TitleEl) then
 
852
  begin
 
853
    TitleEl := CreateElement('title');
 
854
    Node.AppendChild(TitleEl);
 
855
  end;
 
856
  while Assigned(TitleEl.FirstChild) do
 
857
    TitleEl.RemoveChild(TitleEl.FirstChild);
 
858
  TitleEl.AppendChild(CreateTextNode(Value));
 
859
end;
 
860
 
 
861
procedure THTMLDocument.Write(const AText: DOMString);
 
862
begin
 
863
end;
 
864
 
 
865
procedure THTMLDocument.WriteLn(const AText: DOMString);
 
866
begin
 
867
end;
 
868
 
 
869
function THTMLDocument.GetElementsByName(const ElementName: DOMString): TDOMNodeList;
 
870
begin
 
871
  Result := nil;
 
872
end;
 
873
 
 
874
function THTMLDocument.CreateElement(const tagName: DOMString): THTMLElement;
 
875
begin
 
876
  Result := THTMLElement.Create(Self, tagName);
 
877
end;
 
878
 
 
879
function THTMLDocument.CreateSubElement: THTMLElement; begin Result := CreateElement('sub') end;
 
880
function THTMLDocument.CreateSupElement: THTMLElement; begin Result := CreateElement('sup') end;
 
881
function THTMLDocument.CreateSpanElement: THTMLElement; begin Result := CreateElement('span') end;
 
882
function THTMLDocument.CreateBDOElement: THTMLElement; begin Result := CreateElement('bdo') end;
 
883
function THTMLDocument.CreateTTElement: THTMLElement; begin Result := CreateElement('tt') end;
 
884
function THTMLDocument.CreateIElement: THTMLElement; begin Result := CreateElement('i') end;
 
885
function THTMLDocument.CreateBElement: THTMLElement; begin Result := CreateElement('b') end;
 
886
function THTMLDocument.CreateUElement: THTMLElement; begin Result := CreateElement('u') end;
 
887
function THTMLDocument.CreateSElement: THTMLElement; begin Result := CreateElement('s') end;
 
888
function THTMLDocument.CreateStrikeElement: THTMLElement; begin Result := CreateElement('strike') end;
 
889
function THTMLDocument.CreateBigElement: THTMLElement; begin Result := CreateElement('big') end;
 
890
function THTMLDocument.CreateSmallElement: THTMLElement; begin Result := CreateElement('small') end;
 
891
function THTMLDocument.CreateEmElement: THTMLElement; begin Result := CreateElement('em') end;
 
892
function THTMLDocument.CreateStrongElement: THTMLElement; begin Result := CreateElement('strong') end;
 
893
function THTMLDocument.CreateDfnElement: THTMLElement; begin Result := CreateElement('dfn') end;
 
894
function THTMLDocument.CreateCodeElement: THTMLElement; begin Result := CreateElement('code') end;
 
895
function THTMLDocument.CreateSampElement: THTMLElement; begin Result := CreateElement('samp') end;
 
896
function THTMLDocument.CreateKbdElement: THTMLElement; begin Result := CreateElement('kbd') end;
 
897
function THTMLDocument.CreateVarElement: THTMLElement; begin Result := CreateElement('var') end;
 
898
function THTMLDocument.CreateCiteElement: THTMLElement; begin Result := CreateElement('cite') end;
 
899
function THTMLDocument.CreateAcronymElement: THTMLElement; begin Result := CreateElement('acronym') end;
 
900
function THTMLDocument.CreateAbbrElement: THTMLElement; begin Result := CreateElement('abbr') end;
 
901
function THTMLDocument.CreateDDElement: THTMLElement; begin Result := CreateElement('dd') end;
 
902
function THTMLDocument.CreateDTElement: THTMLElement; begin Result := CreateElement('dt') end;
 
903
function THTMLDocument.CreateNoFramesElement: THTMLElement; begin Result := CreateElement('noframes') end;
 
904
function THTMLDocument.CreateNoScriptElement: THTMLElement; begin Result := CreateElement('noscript') end;
 
905
function THTMLDocument.CreateAddressElement: THTMLElement; begin Result := CreateElement('address') end;
 
906
function THTMLDocument.CreateCenterElement: THTMLElement; begin Result := CreateElement('center') end;
 
907
function THTMLDocument.CreateHtmlElement: THTMLHtmlElement; begin Result := THTMLHtmlElement.Create(Self, 'html') end;
 
908
function THTMLDocument.CreateHeadElement: THTMLHeadElement; begin Result := THTMLHeadElement.Create(Self, 'head') end;
 
909
function THTMLDocument.CreateLinkElement: THTMLLinkElement; begin Result := THTMLLinkElement.Create(Self, 'a') end;
 
910
//...
 
911
function THTMLDocument.CreateBodyElement: THTMLBodyElement; begin Result := THTMLBodyElement.Create(Self, 'body') end;
 
912
//...
 
913
function THTMLDocument.CreateUListElement: THTMLUListElement; begin Result := THTMLUListElement.Create(Self, 'ul') end;
 
914
function THTMLDocument.CreateOListElement: THTMLOListElement; begin Result := THTMLOListElement.Create(Self, 'ol') end;
 
915
function THTMLDocument.CreateDListElement: THTMLDListElement; begin Result := THTMLDListElement.Create(Self, 'dl') end;
 
916
// ...
 
917
function THTMLDocument.CreateLIElement: THTMLLIElement; begin Result := THTMLLIElement.Create(Self, 'li') end;
 
918
//...
 
919
function THTMLDocument.CreateParagraphElement: THTMLParagraphElement; begin Result := THTMLParagraphElement.Create(Self, 'p') end;
 
920
 
 
921
end.