1 module webkit2webextension.DOMDOMImplementation;
2 
3 private import glib.ErrorG;
4 private import glib.GException;
5 private import glib.Str;
6 private import gobject.ObjectG;
7 private import webkit2webextension.DOMCSSStyleSheet;
8 private import webkit2webextension.DOMDocument;
9 private import webkit2webextension.DOMDocumentType;
10 private import webkit2webextension.DOMHTMLDocument;
11 private import webkit2webextension.DOMObject;
12 private import webkit2webextension.c.functions;
13 public  import webkit2webextension.c.types;
14 
15 
16 /** */
17 public class DOMDOMImplementation : DOMObject
18 {
19 	/** the main Gtk struct */
20 	protected WebKitDOMDOMImplementation* webKitDOMDOMImplementation;
21 
22 	/** Get the main Gtk struct */
23 	public WebKitDOMDOMImplementation* getDOMDOMImplementationStruct(bool transferOwnership = false)
24 	{
25 		if (transferOwnership)
26 			ownedRef = false;
27 		return webKitDOMDOMImplementation;
28 	}
29 
30 	/** the main Gtk struct as a void* */
31 	protected override void* getStruct()
32 	{
33 		return cast(void*)webKitDOMDOMImplementation;
34 	}
35 
36 	/**
37 	 * Sets our main struct and passes it to the parent class.
38 	 */
39 	public this (WebKitDOMDOMImplementation* webKitDOMDOMImplementation, bool ownedRef = false)
40 	{
41 		this.webKitDOMDOMImplementation = webKitDOMDOMImplementation;
42 		super(cast(WebKitDOMObject*)webKitDOMDOMImplementation, ownedRef);
43 	}
44 
45 
46 	/** */
47 	public static GType getType()
48 	{
49 		return webkit_dom_dom_implementation_get_type();
50 	}
51 
52 	/**
53 	 *
54 	 *
55 	 * Deprecated: Use JavaScriptCore API instead
56 	 *
57 	 * Params:
58 	 *     title = A #gchar
59 	 *     media = A #gchar
60 	 *
61 	 * Returns: A #WebKitDOMCSSStyleSheet
62 	 *
63 	 * Throws: GException on failure.
64 	 */
65 	public DOMCSSStyleSheet createCssStyleSheet(string title, string media)
66 	{
67 		GError* err = null;
68 
69 		auto __p = webkit_dom_dom_implementation_create_css_style_sheet(webKitDOMDOMImplementation, Str.toStringz(title), Str.toStringz(media), &err);
70 
71 		if (err !is null)
72 		{
73 			throw new GException( new ErrorG(err) );
74 		}
75 
76 		if(__p is null)
77 		{
78 			return null;
79 		}
80 
81 		return ObjectG.getDObject!(DOMCSSStyleSheet)(cast(WebKitDOMCSSStyleSheet*) __p, true);
82 	}
83 
84 	/**
85 	 *
86 	 *
87 	 * Deprecated: Use JavaScriptCore API instead
88 	 *
89 	 * Params:
90 	 *     namespaceURI = A #gchar
91 	 *     qualifiedName = A #gchar
92 	 *     doctype = A #WebKitDOMDocumentType
93 	 *
94 	 * Returns: A #WebKitDOMDocument
95 	 *
96 	 * Throws: GException on failure.
97 	 */
98 	public DOMDocument createDocument(string namespaceURI, string qualifiedName, DOMDocumentType doctype)
99 	{
100 		GError* err = null;
101 
102 		auto __p = webkit_dom_dom_implementation_create_document(webKitDOMDOMImplementation, Str.toStringz(namespaceURI), Str.toStringz(qualifiedName), (doctype is null) ? null : doctype.getDOMDocumentTypeStruct(), &err);
103 
104 		if (err !is null)
105 		{
106 			throw new GException( new ErrorG(err) );
107 		}
108 
109 		if(__p is null)
110 		{
111 			return null;
112 		}
113 
114 		return ObjectG.getDObject!(DOMDocument)(cast(WebKitDOMDocument*) __p);
115 	}
116 
117 	/**
118 	 *
119 	 *
120 	 * Deprecated: Use JavaScriptCore API instead
121 	 *
122 	 * Params:
123 	 *     qualifiedName = A #gchar
124 	 *     publicId = A #gchar
125 	 *     systemId = A #gchar
126 	 *
127 	 * Returns: A #WebKitDOMDocumentType
128 	 *
129 	 * Throws: GException on failure.
130 	 */
131 	public DOMDocumentType createDocumentType(string qualifiedName, string publicId, string systemId)
132 	{
133 		GError* err = null;
134 
135 		auto __p = webkit_dom_dom_implementation_create_document_type(webKitDOMDOMImplementation, Str.toStringz(qualifiedName), Str.toStringz(publicId), Str.toStringz(systemId), &err);
136 
137 		if (err !is null)
138 		{
139 			throw new GException( new ErrorG(err) );
140 		}
141 
142 		if(__p is null)
143 		{
144 			return null;
145 		}
146 
147 		return ObjectG.getDObject!(DOMDocumentType)(cast(WebKitDOMDocumentType*) __p);
148 	}
149 
150 	/**
151 	 *
152 	 *
153 	 * Deprecated: Use JavaScriptCore API instead
154 	 *
155 	 * Params:
156 	 *     title = A #gchar
157 	 *
158 	 * Returns: A #WebKitDOMHTMLDocument
159 	 */
160 	public DOMHTMLDocument createHtmlDocument(string title)
161 	{
162 		auto __p = webkit_dom_dom_implementation_create_html_document(webKitDOMDOMImplementation, Str.toStringz(title));
163 
164 		if(__p is null)
165 		{
166 			return null;
167 		}
168 
169 		return ObjectG.getDObject!(DOMHTMLDocument)(cast(WebKitDOMHTMLDocument*) __p);
170 	}
171 
172 	/**
173 	 *
174 	 *
175 	 * Deprecated: Use JavaScriptCore API instead
176 	 *
177 	 * Params:
178 	 *     feature = A #gchar
179 	 *     version_ = A #gchar
180 	 *
181 	 * Returns: A #gboolean
182 	 */
183 	public bool hasFeature(string feature, string version_)
184 	{
185 		return webkit_dom_dom_implementation_has_feature(webKitDOMDOMImplementation, Str.toStringz(feature), Str.toStringz(version_)) != 0;
186 	}
187 }