Code

add proper unix socket includes
[inkscape.git] / src / dom / domimpl.h
1 #ifndef __DOMIMPL_H__
2 #define __DOMIMPL_H__
3 /**
4  * Phoebe DOM Implementation.
5  *
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:
9  *
10  * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
11  *
12  * Authors:
13  *   Bob Jamison
14  *
15  * Copyright (C) 2005 Bob Jamison
16  *
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.
21  *
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.
26  *
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
30  */
33 #include "dom.h"
35 #include <map>
37 namespace org
38 {
39 namespace w3c
40 {
41 namespace dom
42 {
46 class DOMImplementationSourceImpl;
47 class DOMImplementationImpl;
48 class NodeImpl;
49 class CharacterDataImpl;
50 class AttrImpl;
51 class ElementImpl;
52 class TextImpl;
53 class CommentImpl;
54 class TypeInfoImpl;
55 class UserDataHandlerImpl;
56 class DOMErrorImpl;
57 class DOMErrorHandlerImpl;
58 class DOMLocatorImpl;
59 class DOMConfigurationImpl;
60 class CDATASectionImpl;
61 class DocumentTypeImpl;
62 class NotationImpl;
63 class EntityImpl;
64 class EntityReferenceImpl;
65 class ProcessingInstructionImpl;
66 class DocumentFragmentImpl;
67 class DocumentImpl;
71 /*#########################################################################
72 ## DOMImplementationSourceImpl
73 #########################################################################*/
75 class DOMImplementationSourceImpl : public DOMImplementationSource
76 {
77 public:
79     /**
80      *
81      */
82     virtual DOMImplementation *getDOMImplementation(const DOMString &features);
84     /**
85      *
86      */
87     virtual DOMImplementationList getDOMImplementationList(const DOMString &features);
90     //##################
91     //# Non-API methods
92     //##################
94     /**
95      *
96      */
97     DOMImplementationSourceImpl();
99     /**
100      *
101      */
102     virtual ~DOMImplementationSourceImpl();
104 protected:
107     DOMImplementationImpl *domImpl;
108     DOMImplementationList domImplList;
109 };
115 /*#########################################################################
116 ## DOMImplementationImpl
117 #########################################################################*/
118 /**
119  *
120  */
121 class DOMImplementationImpl : public DOMImplementation
123 public:
126     /**
127      *
128      */
129     DOMImplementationImpl();
131     /**
132      *
133      */
134     virtual ~DOMImplementationImpl();
136     /**
137      *
138      */
139     virtual bool hasFeature(const DOMString& feature, const DOMString& version);
142     /**
143      *
144      */
145     virtual DocumentType *createDocumentType(const DOMString& qualifiedName,
146                                      const DOMString& publicId,
147                                      const DOMString& systemId)
148                                      throw(DOMException);
150     /**
151      *
152      */
153     virtual Document *createDocument(const DOMString& namespaceURI,
154                              const DOMString& qualifiedName,
155                              DocumentType *doctype)
156                              throw(DOMException);
157     /**
158      *
159      */
160     virtual DOMObject *getFeature(const DOMString& feature,
161                              const DOMString& version);
164 protected:
166 };
171 /*#########################################################################
172 ## NodeImpl
173 #########################################################################*/
175 /**
176  *
177  */
178 class NodeImpl : virtual public Node
181     friend class DocumentImpl;
183 public:
185     /**
186      *
187      */
188     virtual DOMString getNodeName();
190     /**
191      *
192      */
193     virtual DOMString getNodeValue() throw (DOMException);
195     /**
196      *
197      */
198     virtual void setNodeValue(const DOMString& val) throw (DOMException);
200     /**
201      *
202      */
203     virtual unsigned short getNodeType();
205     /**
206      *
207      */
208     virtual Node *getParentNode();
210     /**
211      *
212      */
213     virtual NodeList getChildNodes();
215     /**
216      *
217      */
218     virtual Node *getFirstChild();
220     /**
221      *
222      */
223     virtual Node *getLastChild();
225     /**
226      *
227      */
228     virtual Node *getPreviousSibling();
230     /**
231      *
232      */
233     virtual Node *getNextSibling();
235     /**
236      *
237      */
238     virtual NamedNodeMap &getAttributes();
241     /**
242      *
243      */
244     virtual Document *getOwnerDocument();
246     /**
247      *
248      */
249     virtual Node *insertBefore(const Node *newChild,
250                        const Node *refChild)
251                        throw(DOMException);
253     /**
254      *
255      */
256     virtual Node *replaceChild(const Node *newChild,
257                        const Node *oldChild)
258                        throw(DOMException);
260     /**
261      *
262      */
263     virtual Node *removeChild(const Node *oldChild)
264                       throw(DOMException);
266     /**
267      *
268      */
269     virtual Node *appendChild(const Node *newChild)
270                       throw(DOMException);
272     /**
273      *
274      */
275     virtual bool hasChildNodes();
277     /**
278      *
279      */
280     virtual Node *cloneNode(bool deep);
282     /**
283      *
284      */
285     virtual void normalize();
287     /**
288      *
289      */
290     virtual bool isSupported(const DOMString& feature,
291                      const DOMString& version);
293     /**
294      *
295      */
296     virtual DOMString getNamespaceURI();
298     /**
299      *
300      */
301     virtual DOMString getPrefix();
303     /**
304      *
305      */
306     virtual void setPrefix(const DOMString& val) throw(DOMException);
308     /**
309      *
310      */
311     virtual DOMString getLocalName();
313     /**
314      *
315      */
316     virtual bool hasAttributes();
318     /**
319      *
320      */
321     virtual DOMString getBaseURI();
323     /**
324      *
325      */
326     virtual unsigned short compareDocumentPosition(const Node *other);
328     /**
329      *
330      */
331     virtual DOMString getTextContext() throw(DOMException);
334     /**
335      *
336      */
337     virtual void setTextContext(const DOMString &val) throw(DOMException);
340     /**
341      *
342      */
343     virtual DOMString lookupPrefix(const DOMString &namespaceURI);
346     /**
347      *
348      */
349     virtual bool isDefaultNamespace(const DOMString &namespaceURI);
352     /**
353      *
354      */
355     virtual DOMString lookupNamespaceURI(const DOMString &prefix);
358     /**
359      *
360      */
361     virtual bool isEqualNode(const Node *node);
365     /**
366      *
367      */
368     virtual DOMObject *getFeature(const DOMString &feature,
369                                   const DOMString &version);
371     /**
372      *
373      */
374     virtual DOMUserData *setUserData(const DOMString &key,
375                                      const DOMUserData *data,
376                                      const UserDataHandler *handler);
379     /**
380      *
381      */
382     virtual DOMUserData *getUserData(const DOMString &namespaceURI);
385     //##################
386     //# Non-API methods
387     //##################
389     /**
390      *
391      */
392     virtual void bindingsAdd(const DOMString &prefix, const DOMString &namespaceURI)
393         {
394         bindings[prefix] = namespaceURI;
395         }
397     /**
398      *
399      */
400     virtual void bindingsClear()
401         {
402         bindings.clear();
403         }
405     DOMString bindingsFind(const DOMString &prefix)
406         {
407         std::map<DOMString, DOMString>::iterator iter =
408              bindings.find(prefix);
409         if (iter != bindings.end())
410             {
411             DOMString ret = iter->second;
412             return ret;
413             }
414         if (parent)
415             {
416             DOMString ret = parent->bindingsFind(prefix);
417             if (ret.size() > 0)
418                 return ret;
419             }
420         return "";
421         }
423     /**
424      *
425      */
426     virtual void setNodeName(const DOMString &qualifiedName);
428     /**
429      *
430      */
431     virtual void setNamespaceURI(const DOMString &theNamespaceURI);
433     /**
434      *
435      */
436     DOMString lookupNamespacePrefix(const DOMString &namespaceURI,
437                                     Node *originalElement);
438     /**
439      *
440      */
441     NodeImpl();
443     /**
444      *
445      */
446     NodeImpl(DocumentImpl *owner);
448     /**
449      *
450      */
451     NodeImpl(DocumentImpl *owner, const DOMString &nodeName);
453     /**
454      *
455      */
456     NodeImpl(DocumentImpl *owner, const DOMString &namespaceURI, const DOMString &nodeName);
458     /**
459      *
460      */
461     virtual ~NodeImpl();
464     /**
465      *
466      */
467     void assign(const NodeImpl &other);
469 protected:
471     /**
472      * Set up the internal values
473      */
474     void init();
476     unsigned short nodeType;
478     NodeImpl *parent;
480     NodeImpl *prev;
482     NodeImpl *next;
484     DOMUserData *userData;
486     DOMString prefix;
488     DOMString localName;
490     DOMString nodeName;
492     DOMString namespaceURI;
494     DOMString baseURI;
496     DOMString nodeValue;
498     NodeImpl *firstChild;
499     NodeImpl *lastChild;
501     DocumentImpl *ownerDocument;
503     NamedNodeMap attributes;
505     class UserDataEntry
506     {
507     public:
508         UserDataEntry(const DOMString       &theKey,
509                       const DOMUserData     *theData,
510                       const UserDataHandler *theHandler)
511             {
512             next    = NULL;
513             key     = theKey;
514             data    = (DOMUserData *)theData;
515             handler = (UserDataHandler *)theHandler;
516             }
517         ~UserDataEntry()
518             {
519             //delete anything after me, too
520             if (next)
521                 delete next;
522             }
524         UserDataEntry   *next;
525         DOMString       key;
526         DOMUserData     *data;
527         UserDataHandler *handler;
528     };
530     UserDataEntry *userDataEntries;
532     //### Our prefix->namespaceURI bindings
534     std::map<DOMString, DOMString> bindings;
537 };
541 /*#########################################################################
542 ## CharacterDataImpl
543 #########################################################################*/
545 /**
546  *
547  */
548 class CharacterDataImpl : virtual public CharacterData, protected NodeImpl
550 public:
552     /**
553      *
554      */
555     virtual DOMString getData() throw(DOMException);
557     /**
558      *
559      */
560     virtual void setData(const DOMString& val) throw(DOMException);
562     /**
563      *
564      */
565     virtual unsigned long getLength();
567     /**
568      *
569      */
570     virtual DOMString substringData(unsigned long offset,
571                             unsigned long count)
572                             throw(DOMException);
574     /**
575      *
576      */
577     virtual void appendData(const DOMString& arg) throw(DOMException);
579     /**
580      *
581      */
582     virtual void insertData(unsigned long offset,
583                     const DOMString& arg)
584                     throw(DOMException);
586     /**
587      *
588      */
589     virtual void deleteData(unsigned long offset,
590                     unsigned long count)
591                     throw(DOMException);
593     /**
594      *
595      */
596     virtual void  replaceData(unsigned long offset,
597                       unsigned long count,
598                       const DOMString& arg)
599                       throw(DOMException);
602     //##################
603     //# Non-API methods
604     //##################
606     /**
607      *
608      */
609     CharacterDataImpl();
612     /**
613      *
614      */
615     CharacterDataImpl(DocumentImpl *owner, const DOMString &value);
617     /**
618      *
619      */
620     virtual ~CharacterDataImpl();
622 protected:
624    //'data' is the nodeValue
626 };
632 /*#########################################################################
633 ## AttrImpl
634 #########################################################################*/
636 /**
637  *
638  */
639 class AttrImpl : virtual public Attr, public NodeImpl
641 public:
643     /**
644      *
645      */
646     virtual DOMString getName();
648     /**
649      *
650      */
651     virtual bool getSpecified();
653     /**
654      *
655      */
656     virtual DOMString getValue();
658     /**
659      *
660      */
661     virtual void setValue(const DOMString& val) throw(DOMException);
663     /**
664      *
665      */
666     virtual Element *getOwnerElement();
669     /**
670      *
671      */
672     virtual TypeInfo *getSchemaTypeInfo();
675     /**
676      *
677      */
678     virtual bool getIsId();
682     //##################
683     //# Non-API methods
684     //##################
686     /**
687      *
688      */
689     virtual void setOwnerElement(const Element *elem);
691     /**
692      *
693      */
694     AttrImpl(DocumentImpl *owner, const DOMString &name);
696     /**
697      *
698      */
699     AttrImpl(DocumentImpl *owner, const DOMString &namespaceURI, const DOMString &name);
701     /**
702      *
703      */
704     virtual ~AttrImpl();
706 protected:
709     Element *ownerElement;
712 };
718 /*#########################################################################
719 ## ElementImpl
720 #########################################################################*/
722 /**
723  *
724  */
725 class ElementImpl : virtual public Element, public NodeImpl
727 public:
729     /**
730      *
731      */
732     virtual DOMString getTagName();
734     /**
735      *
736      */
737     virtual DOMString getAttribute(const DOMString& name);
739     /**
740      *
741      */
742     virtual void setAttribute(const DOMString& name,
743                       const DOMString& value)
744                       throw(DOMException);
746     /**
747      *
748      */
749     virtual void removeAttribute(const DOMString& name)
750                          throw(DOMException);
752     /**
753      *
754      */
755     virtual Attr *getAttributeNode(const DOMString& name);
757     /**
758      *
759      */
760     virtual Attr *setAttributeNode(Attr *newAttr)
761                           throw(DOMException);
763     /**
764      *
765      */
766     virtual Attr *removeAttributeNode(Attr *oldAttr)
767                              throw(DOMException);
769     /**
770      *
771      */
772     virtual NodeList getElementsByTagName(const DOMString& name);
774     /**
775      *
776      */
777     virtual DOMString getAttributeNS(const DOMString& namespaceURI,
778                              const DOMString& localName);
780     /**
781      *
782      */
783     virtual void setAttributeNS(const DOMString& namespaceURI,
784                         const DOMString& qualifiedName,
785                         const DOMString& value)
786                         throw(DOMException);
788     /**
789      *
790      */
791     virtual void removeAttributeNS(const DOMString& namespaceURI,
792                            const DOMString& localName)
793                            throw(DOMException);
795     /**
796      *
797      */
798     virtual Attr *getAttributeNodeNS(const DOMString& namespaceURI,
799                             const DOMString& localName);
801     /**
802      *
803      */
804     virtual Attr *setAttributeNodeNS(Attr *newAttr)
805                             throw(DOMException);
807     /**
808      *
809      */
810     virtual NodeList getElementsByTagNameNS(const DOMString& namespaceURI,
811                                     const DOMString& localName);
813     /**
814      *
815      */
816     virtual bool hasAttribute(const DOMString& name);
818     /**
819      *
820      */
821     virtual bool hasAttributeNS(const DOMString& namespaceURI,
822                         const DOMString& localName);
824     /**
825      *
826      */
827     virtual TypeInfo *getSchemaTypeInto();
830     /**
831      *
832      */
833     virtual void setIdAttribute(const DOMString &name,
834                                 bool isId) throw (DOMException);
836     /**
837      *
838      */
839     virtual void setIdAttributeNS(const DOMString &namespaceURI,
840                                   const DOMString &localName,
841                                   bool isId) throw (DOMException);
843     /**
844      *
845      */
846     virtual void setIdAttributeNode(const Attr *idAttr,
847                                     bool isId) throw (DOMException);
851     //##################
852     //# Non-API methods
853     //##################
856     /**
857      *
858      */
859     ElementImpl();
861     /**
862      *
863      */
864     ElementImpl(DocumentImpl *owner, const DOMString &tagName);
866     /**
867      *
868      */
869     ElementImpl(DocumentImpl *owner, const DOMString &namespaceURI, const DOMString &tagName);
871     /**
872      *
873      */
874     virtual ~ElementImpl();
876     /**
877      *
878      */
879     void normalizeNamespaces();
881 protected:
883 friend class DocumentImpl;
885     static void getElementsByTagNameRecursive(NodeList &list,
886                         const DOMString& name, Element *elem);
887     static void getElementsByTagNameNSRecursive(NodeList &list,
888              const DOMString& namespaceURI, const DOMString& tagName, Element *elem);
889 };
895 /*#########################################################################
896 ## TextImpl
897 #########################################################################*/
899 /**
900  *
901  */
902 class TextImpl : virtual public Text, protected CharacterDataImpl
904 public:
906     /**
907      *
908      */
909     virtual Text *splitText(unsigned long offset)
910                     throw(DOMException);
912     /**
913      *
914      */
915     virtual bool getIsElementContentWhitespace();
917     /**
918      *
919      */
920     virtual DOMString getWholeText();
923     /**
924      *
925      */
926     virtual Text *replaceWholeText(const DOMString &content)
927                                  throw(DOMException);
929     //##################
930     //# Non-API methods
931     //##################
933     /**
934      *
935      */
936     TextImpl();
939     /**
940      *
941      */
942     TextImpl(DocumentImpl *owner, const DOMString &val);
944     /**
945      *
946      */
947     virtual ~TextImpl();
949 protected:
951 };
955 /*#########################################################################
956 ## CommentImpl
957 #########################################################################*/
959 /**
960  *
961  */
962 class CommentImpl : virtual public Comment, protected CharacterDataImpl
964 public:
966     //##################
967     //# Non-API methods
968     //##################
970     /**
971      *
972      */
973     CommentImpl();
975     /**
976      *
977      */
978     CommentImpl(DocumentImpl *owner, const DOMString &theValue);
980     /**
981      *
982      */
983     virtual ~CommentImpl();
984 };
988 /*#########################################################################
989 ## TypeInfoImpl
990 #########################################################################*/
992 /**
993  *
994  */
995 class TypeInfoImpl : public TypeInfo
997 public:
999     /**
1000      *
1001      */
1002     virtual DOMString getTypeName();
1004     /**
1005      *
1006      */
1007     virtual DOMString getTypeNamespace();
1009     /**
1010      *
1011      */
1012     virtual bool isDerivedFrom(const DOMString &typeNamespaceArg,
1013                                const DOMString &typeNameArg,
1014                                const DerivationMethod derivationMethod);
1017     //##################
1018     //# Non-API methods
1019     //##################
1022     /**
1023      *
1024      */
1025     TypeInfoImpl(const DOMString &typeNamespaceArg,
1026                  const DOMString &typeNameArg,
1027                  const DerivationMethod derivationMethod);
1029     /**
1030      *
1031      */
1032     virtual ~TypeInfoImpl();
1034 protected:
1036     DOMString typeName;
1038     DOMString typeNamespace;
1040     unsigned short derivationMethod;
1042 };
1047 /*#########################################################################
1048 ## UserDataHandlerImpl
1049 #########################################################################*/
1051 /**
1052  *
1053  */
1054 class UserDataHandlerImpl : public UserDataHandler
1056 public:
1058     /**
1059      *
1060      */
1061     virtual  void handle(unsigned short operation,
1062                          const DOMString &key,
1063                          const DOMUserData *data,
1064                          const Node *src,
1065                          const Node *dst);
1067     //##################
1068     //# Non-API methods
1069     //##################
1072 protected:
1074     /**
1075      *
1076      */
1077     UserDataHandlerImpl();
1079     /**
1080      *
1081      */
1082     virtual ~UserDataHandlerImpl();
1083 };
1086 /*#########################################################################
1087 ## DOMErrorImpl
1088 #########################################################################*/
1090 /**
1091  *
1092  */
1093 class DOMErrorImpl : public DOMError
1095 public:
1097     /**
1098      *
1099      */
1100     virtual unsigned short getSeverity();
1102     /**
1103      *
1104      */
1105     virtual DOMString getMessage();
1107     /**
1108      *
1109      */
1110     virtual DOMString getType();
1112     /**
1113      *
1114      */
1115     virtual DOMObject *getRelatedException();
1117     /**
1118      *
1119      */
1120     virtual DOMObject *getRelatedData();
1122     /**
1123      *
1124      */
1125     virtual DOMLocator *getLocation();
1128     //##################
1129     //# Non-API methods
1130     //##################
1133 protected:
1135     /**
1136      *
1137      */
1138     DOMErrorImpl();
1140     /**
1141      *
1142      */
1143     virtual ~DOMErrorImpl();
1145     unsigned short severity;
1147     DOMString message;
1149     DOMString type;
1152 };
1155 /*#########################################################################
1156 ## DOMErrorHandlerImpl
1157 #########################################################################*/
1159 /**
1160  *
1161  */
1162 class DOMErrorHandlerImpl : public DOMErrorHandler
1164 public:
1166     /**
1167      *
1168      */
1169     virtual bool handleError(const DOMError *error);
1173     //##################
1174     //# Non-API methods
1175     //##################
1179 protected:
1181     /**
1182      *
1183      */
1184     DOMErrorHandlerImpl();
1186     /**
1187      *
1188      */
1189     virtual ~DOMErrorHandlerImpl();
1192 };
1196 /*#########################################################################
1197 ## DOMLocatorImpl
1198 #########################################################################*/
1200 /**
1201  *
1202  */
1203 class DOMLocatorImpl : public DOMLocator
1205 public:
1207     /**
1208      *
1209      */
1210     virtual long getLineNumber();
1212     /**
1213      *
1214      */
1215     virtual long getColumnNumber();
1217     /**
1218      *
1219      */
1220     virtual long getByteOffset();
1222     /**
1223      *
1224      */
1225     virtual long getUtf16Offset();
1228     /**
1229      *
1230      */
1231     virtual Node *getRelatedNode();
1234     /**
1235      *
1236      */
1237     virtual DOMString getUri();
1241     //##################
1242     //# Non-API methods
1243     //##################
1246     /**
1247      *
1248      */
1249     DOMLocatorImpl();
1251     /**
1252      *
1253      */
1254     virtual ~DOMLocatorImpl();
1256 protected:
1259     long lineNumber;
1261     long columnNumber;
1263     long byteOffset;
1265     long utf16Offset;
1267     Node *relatedNode;
1269     DOMString uri;
1270 };
1273 /*#########################################################################
1274 ## DOMConfigurationImpl
1275 #########################################################################*/
1277 /**
1278  *
1279  */
1280 class DOMConfigurationImpl : public DOMConfiguration
1282 public:
1284     /**
1285      *
1286      */
1287     virtual void setParameter(const DOMString &name,
1288                               const DOMUserData *value) throw (DOMException);
1290     /**
1291      *
1292      */
1293     virtual DOMUserData *getParameter(const DOMString &name)
1294                                       throw (DOMException);
1296     /**
1297      *
1298      */
1299     virtual bool canSetParameter(const DOMString &name,
1300                                  const DOMUserData *data);
1302     /**
1303      *
1304      */
1305     virtual DOMStringList *getParameterNames();
1308     //##################
1309     //# Non-API methods
1310     //##################
1312     /**
1313      *
1314      */
1315     DOMConfigurationImpl();
1317     /**
1318      *
1319      */
1320     virtual ~DOMConfigurationImpl();
1322 protected:
1324 };
1331 /*#########################################################################
1332 ## CDATASectionImpl
1333 #########################################################################*/
1334 /**
1335  *
1336  */
1337 class CDATASectionImpl : public CDATASection, public TextImpl
1339 public:
1341     //##################
1342     //# Non-API methods
1343     //##################
1345     /**
1346      *
1347      */
1348     CDATASectionImpl();
1351     /**
1352      *
1353      */
1354     CDATASectionImpl(DocumentImpl *owner, const DOMString &value);
1356     /**
1357      *
1358      */
1359     virtual ~CDATASectionImpl();
1361 };
1366 /*#########################################################################
1367 ## DocumentTypeImpl
1368 #########################################################################*/
1370 /**
1371  *
1372  */
1373 class DocumentTypeImpl : public DocumentType, public NodeImpl
1375 public:
1377     /**
1378      *
1379      */
1380     virtual DOMString getName();
1382     /**
1383      *
1384      */
1385     virtual NamedNodeMap getEntities();
1387     /**
1388      *
1389      */
1390     virtual NamedNodeMap getNotations();
1392     /**
1393      *
1394      */
1395     virtual DOMString getPublicId();
1397     /**
1398      *
1399      */
1400     virtual DOMString getSystemId();
1402     /**
1403      *
1404      */
1405     virtual DOMString getInternalSubset();
1407     //##################
1408     //# Non-API methods
1409     //##################
1411     /**
1412      *
1413      */
1414    DocumentTypeImpl();
1416     /**
1417      *
1418      */
1419    DocumentTypeImpl(const DOMString& name,
1420                     const DOMString& publicId,
1421                     const DOMString& systemId);
1422     /**
1423      *
1424      */
1425    virtual ~DocumentTypeImpl();
1428 protected:
1429    DOMString name;
1430    DOMString publicId;
1431    DOMString systemId;
1433    NamedNodeMap entities;
1434    NamedNodeMap notations;
1436 };
1442 /*#########################################################################
1443 ## NotationImpl
1444 #########################################################################*/
1446 /**
1447  *
1448  */
1449 class NotationImpl : public Notation, public NodeImpl
1451 public:
1453     /**
1454      *
1455      */
1456     virtual DOMString getPublicId();
1458     /**
1459      *
1460      */
1461     virtual DOMString getSystemId();
1464     //##################
1465     //# Non-API methods
1466     //##################
1468     /**
1469      *
1470      */
1471     NotationImpl();
1473     /**
1474      *
1475      */
1476     NotationImpl(DocumentImpl *owner);
1478     /**
1479      *
1480      */
1481     virtual ~NotationImpl();
1484 protected:
1488     DOMString publicId;
1490     DOMString systemId;
1491 };
1498 /*#########################################################################
1499 ## EntityImpl
1500 #########################################################################*/
1502 /**
1503  *
1504  */
1505 class EntityImpl : public Entity, public NodeImpl
1507 public:
1509     /**
1510      *
1511      */
1512     virtual DOMString getPublicId();
1514     /**
1515      *
1516      */
1517     virtual DOMString getSystemId();
1519     /**
1520      *
1521      */
1522     virtual DOMString getNotationName();
1524     /**
1525      *
1526      */
1527     virtual DOMString getInputEncoding();
1529     /**
1530      *
1531      */
1532     virtual DOMString getXmlEncoding();
1534     /**
1535      *
1536      */
1537     virtual DOMString getXmlVersion();
1540     //##################
1541     //# Non-API methods
1542     //##################
1544     /**
1545      *
1546      */
1547     EntityImpl();
1550     /**
1551      *
1552      */
1553     EntityImpl(DocumentImpl *owner);
1555     /**
1556      *
1557      */
1558     virtual ~EntityImpl();
1560 protected:
1564     DOMString publicId;
1566     DOMString systemId;
1568     DOMString notationName;
1570     DOMString inputEncoding;
1572     DOMString xmlEncoding;
1574     DOMString xmlVersion;
1576 };
1582 /*#########################################################################
1583 ## EntityReferenceImpl
1584 #########################################################################*/
1585 /**
1586  *
1587  */
1588 class EntityReferenceImpl : public EntityReference, public NodeImpl
1590 public:
1592     //##################
1593     //# Non-API methods
1594     //##################
1596     /**
1597      *
1598      */
1599     EntityReferenceImpl();
1602     /**
1603      *
1604      */
1605     EntityReferenceImpl(DocumentImpl *owner, const DOMString &theName);
1607     /**
1608      *
1609      */
1610     virtual ~EntityReferenceImpl();
1612 };
1618 /*#########################################################################
1619 ## ProcessingInstructionImpl
1620 #########################################################################*/
1622 /**
1623  *
1624  */
1625 class ProcessingInstructionImpl : public ProcessingInstruction, public NodeImpl
1627 public:
1629     /**
1630      *
1631      */
1632     virtual DOMString getTarget();
1634     /**
1635      *
1636      */
1637     virtual DOMString getData();
1639     /**
1640      *
1641      */
1642    virtual void setData(const DOMString& val) throw(DOMException);
1645     //##################
1646     //# Non-API methods
1647     //##################
1650     /**
1651      *
1652      */
1653     ProcessingInstructionImpl();
1656     /**
1657      *
1658      */
1659     ProcessingInstructionImpl(DocumentImpl *owner,
1660                               const DOMString &target,
1661                               const DOMString &data);
1663     /**
1664      *
1665      */
1666     virtual ~ProcessingInstructionImpl();
1669 protected:
1672     //'target' is nodeName
1674     //'data' is nodeValue
1677 };
1683 /*#########################################################################
1684 ## DocumentFragmentImpl
1685 #########################################################################*/
1686 /**
1687  *
1688  */
1689 class DocumentFragmentImpl : public DocumentFragment, public NodeImpl
1692 public:
1694     //##################
1695     //# Non-API methods
1696     //##################
1698     /**
1699      *
1700      */
1701     DocumentFragmentImpl();
1703     /**
1704      *
1705      */
1706     DocumentFragmentImpl(DocumentImpl *owner);
1708     /**
1709      *
1710      */
1711     virtual ~DocumentFragmentImpl();
1713 };
1720 /*#########################################################################
1721 ## DocumentImpl
1722 #########################################################################*/
1724 /**
1725  *
1726  */
1727 class DocumentImpl : virtual public Document, public NodeImpl
1729 public:
1731     /**
1732      *
1733      */
1734     virtual DocumentType *getDoctype();
1736     /**
1737      *
1738      */
1739     virtual DOMImplementation *getImplementation();
1741     /**
1742      *
1743      */
1744     virtual Element *getDocumentElement();
1746     /**
1747      *
1748      */
1749     virtual Element *createElement(const DOMString& tagName)
1750                            throw(DOMException);
1752     /**
1753      *
1754      */
1755     virtual DocumentFragment *createDocumentFragment();
1757     /**
1758      *
1759      */
1760     virtual Text *createTextNode(const DOMString& data);
1762     /**
1763      *
1764      */
1765     virtual Comment  *createComment(const DOMString& data);
1767     /**
1768      *
1769      */
1770     virtual CDATASection *createCDATASection(const DOMString& data)
1771                                      throw(DOMException);
1773     /**
1774      *
1775      */
1776     virtual ProcessingInstruction *createProcessingInstruction(const DOMString& target,
1777                                                        const DOMString& data)
1778                                                        throw(DOMException);
1780     /**
1781      *
1782      */
1783     virtual Attr *createAttribute(const DOMString& name)
1784                           throw(DOMException);
1786     /**
1787      *
1788      */
1789     virtual EntityReference *createEntityReference(const DOMString& name)
1790                                            throw(DOMException);
1792     /**
1793      *
1794      */
1795     virtual NodeList getElementsByTagName(const DOMString& tagname);
1798     /**
1799      *
1800      */
1801     virtual Node *importNode(const Node *importedNode,
1802                      bool deep)
1803                      throw(DOMException);
1805     /**
1806      *
1807      */
1808     virtual Element *createElementNS(const DOMString& namespaceURI,
1809                              const DOMString& qualifiedName)
1810                              throw(DOMException);
1812     /**
1813      *
1814      */
1815     virtual Attr *createAttributeNS(const DOMString& namespaceURI,
1816                             const DOMString& qualifiedName)
1817                             throw(DOMException);
1819     /**
1820      *
1821      */
1822     virtual NodeList getElementsByTagNameNS(const DOMString& namespaceURI,
1823                                      const DOMString& localName);
1825     /**
1826      *
1827      */
1828     virtual Element *getElementById(const DOMString& elementId);
1831     /**
1832      *
1833      */
1834     virtual DOMString getInputEncoding();
1837     /**
1838      *
1839      */
1840     virtual DOMString getXmlEncoding();
1842     /**
1843      *
1844      */
1845     virtual bool getXmlStandalone();
1847     /**
1848      *
1849      */
1850     virtual void setXmlStandalone(bool val) throw (DOMException);
1852     /**
1853      *
1854      */
1855     virtual DOMString getXmlVersion();
1857     /**
1858      *
1859      */
1860     virtual void setXmlVersion(const DOMString &version) throw (DOMException);
1862     /**
1863      *
1864      */
1865     virtual bool getStrictErrorChecking();
1867     /**
1868      *
1869      */
1870     virtual void setStrictErrorChecking(bool val);
1873     /**
1874      *
1875      */
1876     virtual DOMString getDocumentURI();
1878     /**
1879      *
1880      */
1881     virtual void setDocumentURI(const DOMString &uri);
1883     /**
1884      *
1885      */
1886     virtual Node *adoptNode(const Node *source) throw (DOMException);
1888     /**
1889      *
1890      */
1891     virtual DOMConfiguration *getDomConfig();
1893     /**
1894      *
1895      */
1896     virtual void normalizeDocument();
1898     /**
1899      *
1900      */
1901     virtual Node *renameNode(const Node *n,
1902                              const DOMString &name,
1903                              const DOMString &qualifiedName)
1904                              throw (DOMException);
1907     //##################
1908     //# Non-API methods
1909     //##################
1911     DocumentImpl(const DOMImplementation *domImpl,
1912                  const DOMString    &namespaceURI,
1913                  const DOMString    &qualifiedName,
1914                  const DocumentType *doctype);
1916     virtual ~DocumentImpl();
1919     DOMString *stringCache(const DOMString &val);
1921     int namespaceIndex;
1923 protected:
1925     DOMImplementation *parent;
1927     DOMString *documentURI;
1929     DOMString qualifiedName;
1931     DocumentType *doctype;
1933     ElementImpl *documentElement;
1935     class NamedElementItem
1936     {
1937     public:
1938         NamedElementItem()
1939         {
1940             next = NULL;
1941         }
1942         NamedElementItem(const DOMString &nameArg, Element *elemArg)
1943         {
1944             next = NULL;
1945             name = nameArg;
1946             elem = elemArg;
1947         }
1948         ~NamedElementItem()
1949         {
1950             if (next)
1951                 delete next;
1952         }
1953         NamedElementItem *next;
1954         DOMString        name;
1955         Element          *elem;
1956     };
1958     NamedElementItem elementsById;
1961     DOMString xmlEncoding;
1963     DOMString inputEncoding;
1965     DOMString xmlVersion;
1967     bool xmlStandalone;
1969     bool strictErrorChecking;
1971     DOMConfiguration *domConfig;
1973     NamedNodeMap namespaceURIs;
1976 };
1988 }  //namespace dom
1989 }  //namespace w3c
1990 }  //namespace org
1993 #endif // __DOMIMPL_H__
1996 /*#########################################################################
1997 ## E N D    O F    F I L E
1998 #########################################################################*/