4
* Phoebe DOM Implementation.
6
* This is a C++ approximation of the W3C DOM model, which follows
7
* fairly closely the specifications in the various .idl files, copies of
8
* which are provided for reference. Most important is this one:
10
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
15
* Copyright (C) 2005 Bob Jamison
17
* This library is free software; you can redistribute it and/or
18
* modify it under the terms of the GNU Lesser General Public
19
* License as published by the Free Software Foundation; either
20
* version 2.1 of the License, or (at your option) any later version.
22
* This library is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
* Lesser General Public License for more details.
27
* You should have received a copy of the GNU Lesser General Public
28
* License along with this library; if not, write to the Free Software
29
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
52
typedef dom::DOMString DOMString;
53
typedef dom::Element Element;
54
typedef dom::NodeList NodeList;
55
typedef dom::Document Document;
57
//forward declarations
58
class ElementExclusiveTimeContainer;
60
class ElementParallelTimeContainer;
61
class ElementSequentialTimeContainer;
62
class ElementSyncBehavior;
63
class ElementTargetAttributes;
66
class ElementTimeContainer;
67
class ElementTimeControl;
68
class ElementTimeManipulation;
69
class SMILAnimateColorElement;
70
class SMILAnimateElement;
71
class SMILAnimateMotionElement;
75
class SMILLayoutElement;
76
class SMILMediaElement;
78
class SMILRegionElement;
79
class SMILRegionInterface;
80
class SMILRootLayoutElement;
82
class SMILSwitchElement;
83
class SMILTopLayoutElement;
90
/*#########################################################################
91
###########################################################################
93
###########################################################################
94
#########################################################################*/
98
/*#########################################################################
100
#########################################################################*/
113
virtual DOMString getTitle()
119
virtual void setTitle(const DOMString &val) throw(dom::DOMException)
125
virtual DOMString getBackgroundColor()
126
{ return backgroundColor; }
131
virtual void setBackgroundColor(const DOMString &val) throw(dom::DOMException)
132
{ backgroundColor = val; }
137
virtual long getHeight()
143
virtual void setHeight(long val) throw(dom::DOMException)
149
virtual long getWidth()
155
virtual void setWidth(long val) throw(dom::DOMException)
172
ElementLayout(const ElementLayout &other)
175
backgroundColor = other.backgroundColor;
176
height = other.height;
183
virtual ~ElementLayout() {}
188
DOMString backgroundColor;
195
/*#########################################################################
196
## SMILRegionInterface
197
#########################################################################*/
202
class SMILRegionInterface
209
virtual SMILRegionElement *getRegion()
210
{ return regionElement; }
214
virtual void setRegion(const SMILRegionElement *val)
215
{ regionElement = (SMILRegionElement *)val; }
224
SMILRegionInterface()
225
{ regionElement = NULL; }
230
SMILRegionInterface(const SMILRegionInterface &other)
231
{ regionElement = other.regionElement; }
236
virtual ~SMILRegionInterface() {}
240
SMILRegionElement *regionElement;
245
/*#########################################################################
247
#########################################################################*/
260
virtual bool getResolved()
266
virtual double getResolvedOffset()
267
{ return resolvedOffset; }
271
SMIL_TIME_INDEFINITE = 0,
272
SMIL_TIME_OFFSET = 1,
273
SMIL_TIME_SYNC_BASED = 2,
274
SMIL_TIME_EVENT_BASED = 3,
275
SMIL_TIME_WALLCLOCK = 4,
276
SMIL_TIME_MEDIA_MARKER = 5
284
virtual unsigned short getTimeType()
291
virtual double getOffset()
297
virtual void setOffset(double val) throw (dom::DOMException)
303
virtual Element *getBaseElement()
304
{ return baseElement; }
309
virtual void setBaseElement(const Element *val) throw (dom::DOMException)
310
{ baseElement = (Element *)val; }
315
virtual bool getBaseBegin()
316
{ return baseBegin; }
321
virtual void setBaseBegin(bool val) throw (dom::DOMException)
327
virtual DOMString getEvent()
333
virtual void setEvent(const DOMString &val) throw (dom::DOMException)
339
virtual DOMString getMarker()
345
virtual void setMarker(const DOMString &val) throw (dom::DOMException)
360
resolvedOffset = 0.0;
361
timeType = SMIL_TIME_INDEFINITE;
372
Time(const Time &other)
374
resolved = other.resolved;
375
resolvedOffset = other.resolvedOffset;
376
timeType = other.timeType;
377
offset = other.offset;
378
baseElement = other.baseElement;
379
baseBegin = other.baseBegin;
380
eventStr = other.eventStr;
381
marker = other.marker;
392
double resolvedOffset;
393
unsigned short timeType;
395
Element * baseElement;
403
/*#########################################################################
405
#########################################################################*/
418
virtual Time item(unsigned long index)
420
if (index >=items.size())
431
virtual unsigned long getLength()
448
TimeList(const TimeList &other)
456
virtual ~TimeList() {}
460
std::vector<Time>items;
466
/*#########################################################################
468
#########################################################################*/
481
virtual TimeList getBegin()
482
{ return beginTime; }
487
virtual void setBegin(const TimeList &val) throw(dom::DOMException)
492
virtual TimeList getEnd()
498
virtual void setEnd(const TimeList &val) throw(dom::DOMException)
504
virtual double getDur()
510
virtual void setDur(double val) throw(dom::DOMException)
517
RESTART_WHEN_NOT_ACTIVE = 2
523
virtual unsigned short getRestart()
529
virtual void setRestart(unsigned short val) throw (dom::DOMException)
544
virtual unsigned short getFill()
550
virtual void setFill(unsigned short val) throw (dom::DOMException)
556
virtual double getRepeatCount()
557
{ return repeatCount; }
562
virtual void setRepeatCount(double val) throw (dom::DOMException)
563
{ repeatCount = val; }
568
virtual double getRepeatDur()
569
{ return repeatDur; }
574
virtual void setRepeatDur(double val) throw (dom::DOMException)
580
virtual bool beginElement()
588
virtual bool endElement()
596
virtual void pauseElement()
603
virtual void resumeElement()
610
virtual void seekElement(double &seekTo)
625
restart = RESTART_ALWAYS;
634
ElementTime(const ElementTime &other)
636
beginTime = other.beginTime;
637
endTime = other.endTime;
639
restart = other.restart;
641
repeatCount = other.repeatCount;
642
repeatDur = other.repeatDur;
648
virtual ~ElementTime() {}
656
unsigned short restart;
665
/*#########################################################################
666
## ElementTimeManipulation
667
#########################################################################*/
672
class ElementTimeManipulation
679
virtual double getSpeed()
684
virtual void setSpeed(double val) throw (dom::DOMException)
689
virtual double getAccelerate()
690
{ return accelerate; }
695
virtual void setAccelerate(double val) throw (dom::DOMException)
696
{ accelerate = val; }
701
virtual double getDecelerate()
702
{ return decelerate; }
707
virtual void setDecelerate(double val) throw (dom::DOMException)
708
{ decelerate = val; }
713
virtual bool getAutoReverse()
714
{ return autoReverse; }
719
virtual void setAutoReverse(bool val) throw (dom::DOMException)
720
{ autoReverse = val; }
730
ElementTimeManipulation()
741
ElementTimeManipulation(const ElementTimeManipulation &other)
744
accelerate = other.accelerate;
745
decelerate = other.decelerate;
746
autoReverse = other.autoReverse;
752
virtual ~ElementTimeManipulation() {}
765
/*#########################################################################
766
## ElementTimeContainer
767
#########################################################################*/
772
class ElementTimeContainer : public ElementTime
780
virtual NodeList getTimeChildren()
789
virtual NodeList getActiveChildrenAt(double instant)
802
ElementTimeContainer() {}
807
ElementTimeContainer(const ElementTimeContainer &other) : ElementTime(other)
814
virtual ~ElementTimeContainer() {}
822
/*#########################################################################
823
## ElementSyncBehavior
824
#########################################################################*/
829
class ElementSyncBehavior
836
virtual DOMString getSyncBehavior()
837
{ return syncBehavior; }
842
virtual double getSyncTolerance()
843
{ return syncTolerance; }
848
virtual DOMString getDefaultSyncBehavior()
849
{ return defaultSyncBehavior; }
854
virtual double getDefaultSyncTolerance()
855
{ return defaultSyncTolerance; }
860
virtual bool getSyncMaster()
861
{ return syncMaster; }
870
ElementSyncBehavior()
874
defaultSyncBehavior = "";
875
defaultSyncTolerance = 0.0;
882
ElementSyncBehavior(const ElementSyncBehavior &other)
884
syncBehavior = other.syncBehavior;
885
syncTolerance = other.syncTolerance;
886
defaultSyncBehavior = other.defaultSyncBehavior;
887
defaultSyncTolerance = other.defaultSyncTolerance;
888
syncMaster = other.syncMaster;
894
virtual ~ElementSyncBehavior() {}
898
DOMString syncBehavior;
899
double syncTolerance;
900
DOMString defaultSyncBehavior;
901
double defaultSyncTolerance;
907
/*#########################################################################
908
## ElementParallelTimeContainer
909
#########################################################################*/
914
class ElementParallelTimeContainer : public ElementTimeContainer
921
virtual DOMString getEndSync()
927
virtual void setEndSync(const DOMString &val) throw (dom::DOMException)
933
virtual double getImplicitDuration()
934
{ return implicitDuration; }
943
ElementParallelTimeContainer()
946
implicitDuration = 0.0;
952
ElementParallelTimeContainer(const ElementParallelTimeContainer &other)
953
: ElementTimeContainer(other)
955
endSync = other.endSync;
956
implicitDuration = other.implicitDuration;
962
virtual ~ElementParallelTimeContainer() {}
967
double implicitDuration;
972
/*#########################################################################
973
## ElementSequentialTimeContainer
974
#########################################################################*/
979
class ElementSequentialTimeContainer : public ElementTimeContainer
991
ElementSequentialTimeContainer() {}
996
ElementSequentialTimeContainer(const ElementSequentialTimeContainer &other)
997
: ElementTimeContainer(other)
1004
virtual ~ElementSequentialTimeContainer() {}
1010
/*#########################################################################
1011
## ElementExclusiveTimeContainer
1012
#########################################################################*/
1017
class ElementExclusiveTimeContainer : public ElementTimeContainer
1024
virtual DOMString getEndSync()
1030
virtual void setEndSync(const DOMString &val) throw (dom::DOMException)
1036
virtual NodeList getPausedElements()
1037
{ return pausedElements; }
1039
//##################
1041
//##################
1046
ElementExclusiveTimeContainer() {}
1051
ElementExclusiveTimeContainer(const ElementExclusiveTimeContainer &other)
1052
: ElementTimeContainer(other)
1054
endSync = other.endSync;
1055
pausedElements = other.pausedElements;
1061
virtual ~ElementExclusiveTimeContainer() {}
1066
NodeList pausedElements;
1072
/*#########################################################################
1073
## ElementTimeControl
1074
#########################################################################*/
1079
class ElementTimeControl
1086
virtual bool beginElement() throw(dom::DOMException)
1094
virtual bool beginElementAt(double offset) throw(dom::DOMException)
1102
virtual bool endElement() throw(dom::DOMException)
1110
virtual bool endElementAt(double offset) throw(dom::DOMException)
1115
//##################
1117
//##################
1122
ElementTimeControl() {}
1127
ElementTimeControl(const ElementTimeControl &other)
1134
virtual ~ElementTimeControl() {}
1140
/*#########################################################################
1141
## ElementTargetAttributes
1142
#########################################################################*/
1147
class ElementTargetAttributes
1155
virtual DOMString getAttributeName()
1156
{ return attributeName; }
1161
virtual void setAttributeName(const DOMString &val)
1162
{ attributeName = val; }
1166
ATTRIBUTE_TYPE_AUTO = 0,
1167
ATTRIBUTE_TYPE_CSS = 1,
1168
ATTRIBUTE_TYPE_XML = 2
1174
virtual unsigned short getAttributeType()
1175
{ return attributeType; }
1180
virtual void setAttributeType(unsigned short val)
1181
{ attributeType = val; }
1183
//##################
1185
//##################
1190
ElementTargetAttributes()
1193
attributeType = ATTRIBUTE_TYPE_AUTO;
1199
ElementTargetAttributes(const ElementTargetAttributes &other)
1201
attributeName = other.attributeName;
1202
attributeType = other.attributeType;
1208
virtual ~ElementTargetAttributes() {}
1212
DOMString attributeName;
1213
unsigned short attributeType;
1218
/*#########################################################################
1220
#########################################################################*/
1233
virtual long getSystemBitrate()
1234
{ return systemBitrate; }
1239
virtual void setSystemBitrate(long val) throw (dom::DOMException)
1240
{ systemBitrate = val; }
1245
virtual bool getSystemCaptions()
1246
{ return systemCaptions; }
1251
virtual void setSystemCaptions(bool val) throw (dom::DOMException)
1252
{ systemCaptions = val; }
1257
virtual DOMString getSystemLanguage()
1258
{ return systemLanguage; }
1263
virtual void setSystemLanguage(const DOMString &val) throw (dom::DOMException)
1264
{ systemLanguage = val; }
1269
virtual bool getSystemRequired()
1270
{ return systemRequired; }
1275
virtual bool getSystemScreenSize()
1276
{ return systemScreenSize; }
1281
virtual bool getSystemScreenDepth()
1282
{ return systemScreenDepth; }
1287
virtual DOMString getSystemOverdubOrSubtitle()
1288
{ return systemOverdubOrSubtitle; }
1293
virtual void setSystemOverdubOrSubtitle(const DOMString &val) throw (dom::DOMException)
1294
{ systemOverdubOrSubtitle = val; }
1299
virtual bool getSystemAudioDesc()
1300
{ return systemBitrate; }
1305
virtual void setSystemAudioDesc(bool val) throw (dom::DOMException)
1306
{ systemAudioDesc = val; }
1309
//##################
1311
//##################
1319
systemCaptions = false;
1320
systemLanguage = "";
1321
systemRequired = false;
1322
systemScreenSize = false;
1323
systemScreenDepth = false;
1324
systemOverdubOrSubtitle = "";
1325
systemAudioDesc = false;
1331
ElementTest(const ElementTest &other)
1333
systemBitrate = other.systemBitrate;
1334
systemCaptions = other.systemCaptions;
1335
systemLanguage = other.systemLanguage;
1336
systemRequired = other.systemRequired;
1337
systemScreenSize = other.systemScreenSize;
1338
systemScreenDepth = other.systemScreenDepth;
1339
systemOverdubOrSubtitle = other.systemOverdubOrSubtitle;
1340
systemAudioDesc = other.systemAudioDesc;
1346
virtual ~ElementTest() {}
1353
bool systemCaptions;
1354
DOMString systemLanguage;
1355
bool systemRequired;
1356
bool systemScreenSize;
1357
bool systemScreenDepth;
1358
DOMString systemOverdubOrSubtitle;
1359
bool systemAudioDesc;
1363
/*#########################################################################
1365
#########################################################################*/
1370
class TimeEvent : public events::Event
1377
virtual views::View getView()
1383
virtual long getDetail()
1389
virtual void initTimeEvent(const DOMString &typeArg,
1390
const views::View *viewArg,
1395
//##################
1397
//##################
1410
TimeEvent(const TimeEvent &other) : events::Event(other)
1413
detail = other.detail;
1419
virtual ~TimeEvent() {}
1433
/*#########################################################################
1434
###########################################################################
1435
## I N T E R F A C E T Y P E S
1436
###########################################################################
1437
#########################################################################*/
1442
/*#########################################################################
1444
#########################################################################*/
1449
class SMILDocument : virtual public Document,
1450
public ElementSequentialTimeContainer
1455
//##################
1457
//##################
1462
virtual ~SMILDocument() {}
1468
/*#########################################################################
1470
#########################################################################*/
1475
class SMILElement : virtual public Element
1482
virtual DOMString getId() =0;
1487
virtual void setId(const DOMString &val) throw (dom::DOMException) =0;
1490
//##################
1492
//##################
1497
virtual ~SMILElement() {}
1503
/*#########################################################################
1504
## SMILLayoutElement
1505
#########################################################################*/
1510
class SMILLayoutElement : virtual public SMILElement
1517
virtual DOMString getType() =0;
1522
virtual bool getResolved() =0;
1524
//##################
1526
//##################
1531
virtual ~SMILLayoutElement() {}
1537
/*#########################################################################
1538
## SMILTopLayoutElement
1539
#########################################################################*/
1544
class SMILTopLayoutElement : virtual public SMILElement,
1545
virtual public ElementLayout
1550
//##################
1552
//##################
1557
virtual ~SMILTopLayoutElement() {}
1563
/*#########################################################################
1564
## SMILRootLayoutElement
1565
#########################################################################*/
1570
class SMILRootLayoutElement : virtual public SMILElement,
1571
virtual public ElementLayout
1576
//##################
1578
//##################
1583
virtual ~SMILRootLayoutElement() {}
1589
/*#########################################################################
1590
## SMILRegionElement
1591
#########################################################################*/
1596
class SMILRegionElement : virtual public SMILElement,
1597
virtual public ElementLayout
1605
virtual DOMString getFit() =0;
1610
virtual void setFit(const DOMString &val) throw (dom::DOMException) =0;
1615
virtual DOMString getTop() =0;
1620
virtual void setTop(const DOMString &val) throw (dom::DOMException) =0;
1625
virtual long getZIndex() =0;
1630
virtual void setZIndex(long val) throw (dom::DOMException) =0;
1633
//##################
1635
//##################
1640
virtual ~SMILRegionElement() {}
1647
/*#########################################################################
1649
#########################################################################*/
1654
class SMILMediaElement : virtual public ElementTime,
1655
virtual public SMILElement
1663
virtual DOMString getAbstractAttr() =0;
1668
virtual void setAbstractAttr(const DOMString &val) throw (dom::DOMException) =0;
1673
virtual DOMString getAlt() =0;
1678
virtual void setAlt(const DOMString &val) throw (dom::DOMException) =0;
1683
virtual DOMString getAuthor() =0;
1688
virtual void setAuthor(const DOMString &val) throw (dom::DOMException) =0;
1693
virtual DOMString getClipBegin() =0;
1698
virtual void setClipBegin(const DOMString &val) throw (dom::DOMException) =0;
1703
virtual DOMString getClipEnd() =0;
1708
virtual void setClipEnd(const DOMString &val) throw (dom::DOMException) =0;
1713
virtual DOMString getCopyright() =0;
1718
virtual void setCopyright(const DOMString &val) throw (dom::DOMException) =0;
1723
virtual DOMString getLongdesc() =0;
1728
virtual void setLongdesc(const DOMString &val) throw (dom::DOMException) =0;
1733
virtual DOMString getPort() =0;
1738
virtual void setPort(const DOMString &val) throw (dom::DOMException) =0;
1743
virtual DOMString getReadIndex() =0;
1748
virtual void setReadIndex(const DOMString &val) throw (dom::DOMException) =0;
1753
virtual DOMString getRtpformat() =0;
1758
virtual void setRtpformat(const DOMString &val) throw (dom::DOMException) =0;
1763
virtual DOMString getSrc() =0;
1768
virtual void setSrc(const DOMString &val) throw (dom::DOMException) =0;
1773
virtual DOMString getStripRepeat() =0;
1778
virtual void setStripRepeat(const DOMString &val) throw (dom::DOMException) =0;
1783
virtual DOMString getTitle() =0;
1788
virtual void setTitle(const DOMString &val) throw (dom::DOMException) =0;
1793
virtual DOMString getTransport() =0;
1798
virtual void setTransport(const DOMString &val) throw (dom::DOMException) =0;
1803
virtual DOMString getType() =0;
1808
virtual void setType(const DOMString &val) throw (dom::DOMException) =0;
1812
//##################
1814
//##################
1819
virtual ~SMILMediaElement() {}
1825
/*#########################################################################
1827
#########################################################################*/
1832
class SMILRefElement : virtual public SMILMediaElement
1837
//##################
1839
//##################
1844
virtual ~SMILRefElement() {}
1850
/*#########################################################################
1852
#########################################################################*/
1857
class SMILAnimation : virtual public SMILElement,
1858
virtual public ElementTargetAttributes,
1859
virtual public ElementTime,
1860
virtual public ElementTimeControl
1866
ADDITIVE_REPLACE = 0,
1874
virtual unsigned short getAdditive() =0;
1879
virtual void setAdditive(unsigned short val) throw (dom::DOMException)=0;
1883
ACCUMULATE_NONE = 0,
1891
virtual unsigned short getAccumulate() =0;
1896
virtual void setAccumulate(unsigned short val) throw (dom::DOMException)=0;
1900
CALCMODE_DISCRETE = 0,
1901
CALCMODE_LINEAR = 1,
1910
virtual unsigned short getCalcMode() =0;
1915
virtual void setCalcMode(unsigned short val) throw (dom::DOMException)=0;
1920
virtual DOMString getKeySplines() =0;
1925
virtual void setKeySplines(const DOMString &val) throw (dom::DOMException)=0;
1930
virtual TimeList getKeyTimes() =0;
1935
virtual void setKeyTimes(const TimeList &val) throw (dom::DOMException)=0;
1940
virtual DOMString getValues() =0;
1945
virtual void setValues(const DOMString &val) throw (dom::DOMException)=0;
1950
virtual DOMString getFrom() =0;
1955
virtual void setFrom(const DOMString &val) throw (dom::DOMException)=0;
1960
virtual DOMString getTo() =0;
1965
virtual void setTo(const DOMString &val) throw (dom::DOMException)=0;
1970
virtual DOMString getBy() =0;
1975
virtual void setBy(const DOMString &val) throw (dom::DOMException)=0;
1977
//##################
1979
//##################
1984
virtual ~SMILAnimation() {}
1990
/*#########################################################################
1991
## SMILAnimateElement
1992
#########################################################################*/
1997
class SMILAnimateElement : virtual public SMILAnimation
2002
//##################
2004
//##################
2009
virtual ~SMILAnimateElement() {}
2015
/*#########################################################################
2017
#########################################################################*/
2022
class SMILSetElement : virtual public ElementTimeControl,
2023
virtual public ElementTime,
2024
virtual public ElementTargetAttributes,
2025
virtual public SMILElement
2032
virtual DOMString getTo() =0;
2037
virtual void setTo(const DOMString &val) =0;
2039
//##################
2041
//##################
2046
virtual ~SMILSetElement() {}
2052
/*#########################################################################
2053
## SMILAnimateMotionElement
2054
#########################################################################*/
2059
class SMILAnimateMotionElement : virtual public SMILAnimateElement
2066
virtual DOMString getPath() =0;
2071
virtual void setPath(const DOMString &val) throw(dom::DOMException) =0;
2076
virtual DOMString getOrigin() =0;
2081
virtual void setOrigin(const DOMString &val) throw(dom::DOMException) =0;
2084
//##################
2086
//##################
2091
virtual ~SMILAnimateMotionElement() {}
2097
/*#########################################################################
2098
## SMILAnimateColorElement
2099
#########################################################################*/
2104
class SMILAnimateColorElement : virtual public SMILAnimation
2109
//##################
2111
//##################
2116
virtual ~SMILAnimateColorElement() {}
2125
/*#########################################################################
2126
## SMILSwitchElement
2127
#########################################################################*/
2132
class SMILSwitchElement : virtual public SMILElement
2139
virtual Element *getSelectedElement() =0;
2141
//##################
2143
//##################
2148
virtual ~SMILSwitchElement() {}
2162
#endif /* __SMIL_H__ */
2164
/*#########################################################################
2165
## E N D O F F I L E
2166
#########################################################################*/