1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2008 Novell, Inc.
23 // Andreia Gaita (avidigal@novell.com)
27 using Mono.WebBrowser.DOM;
29 namespace Mono.Mozilla.DOM
31 internal class DocumentType : Node, IDocumentType
33 internal nsIDOMDocumentType doctype;
35 public DocumentType (WebBrowser control, nsIDOMDocumentType doctype)
36 : base (control, doctype as nsIDOMNode)
38 if (control.platform != control.enginePlatform)
39 this.doctype = nsDOMDocumentType.GetProxy (control, doctype);
41 this.doctype = doctype;
45 #region IDisposable Members
46 protected override void Dispose (bool disposing)
50 this.resources.Clear ();
54 base.Dispose (disposing);
58 internal nsIDOMDocumentType ComObject
60 get { return doctype; }
66 doctype.getName (storage);
67 return Base.StringGet (storage);
70 public INamedNodeMap Entities {
72 nsIDOMNamedNodeMap nodeMap;
73 doctype.getEntities (out nodeMap);
74 return new NamedNodeMap (this.control, nodeMap);
77 public INamedNodeMap Notations {
79 nsIDOMNamedNodeMap nodeMap;
80 doctype.getNotations (out nodeMap);
81 return new NamedNodeMap (this.control, nodeMap);
84 public string PublicId {
86 doctype.getPublicId (storage);
87 return Base.StringGet (storage);
90 public string SystemId {
92 doctype.getSystemId (storage);
93 return Base.StringGet (storage);
96 public string InternalSubset {
98 doctype.getInternalSubset (storage);
99 return Base.StringGet (storage);
104 public override int GetHashCode () {
105 return this.hashcode;