1 module webkit2webextension.DOMCSSStyleDeclaration; 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.DOMCSSRule; 8 private import webkit2webextension.DOMObject; 9 private import webkit2webextension.c.functions; 10 public import webkit2webextension.c.types; 11 12 13 /** */ 14 public class DOMCSSStyleDeclaration : DOMObject 15 { 16 /** the main Gtk struct */ 17 protected WebKitDOMCSSStyleDeclaration* webKitDOMCSSStyleDeclaration; 18 19 /** Get the main Gtk struct */ 20 public WebKitDOMCSSStyleDeclaration* getDOMCSSStyleDeclarationStruct(bool transferOwnership = false) 21 { 22 if (transferOwnership) 23 ownedRef = false; 24 return webKitDOMCSSStyleDeclaration; 25 } 26 27 /** the main Gtk struct as a void* */ 28 protected override void* getStruct() 29 { 30 return cast(void*)webKitDOMCSSStyleDeclaration; 31 } 32 33 /** 34 * Sets our main struct and passes it to the parent class. 35 */ 36 public this (WebKitDOMCSSStyleDeclaration* webKitDOMCSSStyleDeclaration, bool ownedRef = false) 37 { 38 this.webKitDOMCSSStyleDeclaration = webKitDOMCSSStyleDeclaration; 39 super(cast(WebKitDOMObject*)webKitDOMCSSStyleDeclaration, ownedRef); 40 } 41 42 43 /** */ 44 public static GType getType() 45 { 46 return webkit_dom_css_style_declaration_get_type(); 47 } 48 49 /** 50 * 51 * 52 * Deprecated: Use JavaScriptCore API instead 53 * 54 * Returns: A #gchar 55 */ 56 public string getCssText() 57 { 58 auto retStr = webkit_dom_css_style_declaration_get_css_text(webKitDOMCSSStyleDeclaration); 59 60 scope(exit) Str.freeString(retStr); 61 return Str.toString(retStr); 62 } 63 64 /** 65 * 66 * 67 * Deprecated: Use JavaScriptCore API instead 68 * 69 * Returns: A #gulong 70 */ 71 public gulong getLength() 72 { 73 return webkit_dom_css_style_declaration_get_length(webKitDOMCSSStyleDeclaration); 74 } 75 76 /** 77 * 78 * 79 * Deprecated: Use JavaScriptCore API instead 80 * 81 * Returns: A #WebKitDOMCSSRule 82 */ 83 public DOMCSSRule getParentRule() 84 { 85 auto __p = webkit_dom_css_style_declaration_get_parent_rule(webKitDOMCSSStyleDeclaration); 86 87 if(__p is null) 88 { 89 return null; 90 } 91 92 return ObjectG.getDObject!(DOMCSSRule)(cast(WebKitDOMCSSRule*) __p, true); 93 } 94 95 /** 96 * 97 * 98 * Deprecated: Use JavaScriptCore API instead 99 * 100 * Params: 101 * propertyName = A #gchar 102 * 103 * Returns: A #gchar 104 */ 105 public string getPropertyPriority(string propertyName) 106 { 107 auto retStr = webkit_dom_css_style_declaration_get_property_priority(webKitDOMCSSStyleDeclaration, Str.toStringz(propertyName)); 108 109 scope(exit) Str.freeString(retStr); 110 return Str.toString(retStr); 111 } 112 113 /** 114 * 115 * 116 * Deprecated: Use JavaScriptCore API instead 117 * 118 * Params: 119 * propertyName = A #gchar 120 * 121 * Returns: A #gchar 122 */ 123 public string getPropertyShorthand(string propertyName) 124 { 125 auto retStr = webkit_dom_css_style_declaration_get_property_shorthand(webKitDOMCSSStyleDeclaration, Str.toStringz(propertyName)); 126 127 scope(exit) Str.freeString(retStr); 128 return Str.toString(retStr); 129 } 130 131 /** 132 * 133 * 134 * Deprecated: Use JavaScriptCore API instead 135 * 136 * Params: 137 * propertyName = A #gchar 138 * 139 * Returns: A #gchar 140 */ 141 public string getPropertyValue(string propertyName) 142 { 143 auto retStr = webkit_dom_css_style_declaration_get_property_value(webKitDOMCSSStyleDeclaration, Str.toStringz(propertyName)); 144 145 scope(exit) Str.freeString(retStr); 146 return Str.toString(retStr); 147 } 148 149 /** 150 * 151 * 152 * Deprecated: Use JavaScriptCore API instead 153 * 154 * Params: 155 * propertyName = A #gchar 156 * 157 * Returns: A #gboolean 158 */ 159 public bool isPropertyImplicit(string propertyName) 160 { 161 return webkit_dom_css_style_declaration_is_property_implicit(webKitDOMCSSStyleDeclaration, Str.toStringz(propertyName)) != 0; 162 } 163 164 /** 165 * 166 * 167 * Deprecated: Use JavaScriptCore API instead 168 * 169 * Params: 170 * index = A #gulong 171 * 172 * Returns: A #gchar 173 */ 174 public string item(gulong index) 175 { 176 auto retStr = webkit_dom_css_style_declaration_item(webKitDOMCSSStyleDeclaration, index); 177 178 scope(exit) Str.freeString(retStr); 179 return Str.toString(retStr); 180 } 181 182 /** 183 * 184 * 185 * Deprecated: Use JavaScriptCore API instead 186 * 187 * Params: 188 * propertyName = A #gchar 189 * 190 * Returns: A #gchar 191 * 192 * Throws: GException on failure. 193 */ 194 public string removeProperty(string propertyName) 195 { 196 GError* err = null; 197 198 auto retStr = webkit_dom_css_style_declaration_remove_property(webKitDOMCSSStyleDeclaration, Str.toStringz(propertyName), &err); 199 200 if (err !is null) 201 { 202 throw new GException( new ErrorG(err) ); 203 } 204 205 scope(exit) Str.freeString(retStr); 206 return Str.toString(retStr); 207 } 208 209 /** 210 * 211 * 212 * Deprecated: Use JavaScriptCore API instead 213 * 214 * Params: 215 * value = A #gchar 216 * 217 * Throws: GException on failure. 218 */ 219 public void setCssText(string value) 220 { 221 GError* err = null; 222 223 webkit_dom_css_style_declaration_set_css_text(webKitDOMCSSStyleDeclaration, Str.toStringz(value), &err); 224 225 if (err !is null) 226 { 227 throw new GException( new ErrorG(err) ); 228 } 229 } 230 231 /** 232 * 233 * 234 * Deprecated: Use JavaScriptCore API instead 235 * 236 * Params: 237 * propertyName = A #gchar 238 * value = A #gchar 239 * priority = A #gchar 240 * 241 * Throws: GException on failure. 242 */ 243 public void setProperty(string propertyName, string value, string priority) 244 { 245 GError* err = null; 246 247 webkit_dom_css_style_declaration_set_property(webKitDOMCSSStyleDeclaration, Str.toStringz(propertyName), Str.toStringz(value), Str.toStringz(priority), &err); 248 249 if (err !is null) 250 { 251 throw new GException( new ErrorG(err) ); 252 } 253 } 254 }