ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

htmlinput.c
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006 Jacek Caban for CodeWeavers
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #include <stdarg.h>
00020 
00021 #define COBJMACROS
00022 
00023 #include "windef.h"
00024 #include "winbase.h"
00025 #include "winuser.h"
00026 #include "ole2.h"
00027 
00028 #include "wine/debug.h"
00029 
00030 #include "mshtml_private.h"
00031 #include "htmlevent.h"
00032 
00033 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
00034 
00035 typedef struct {
00036     HTMLElement element;
00037 
00038     const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
00039     const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
00040 
00041     nsIDOMHTMLInputElement *nsinput;
00042 } HTMLInputElement;
00043 
00044 #define HTMLINPUT(x)      ((IHTMLInputElement*)      &(x)->lpHTMLInputElementVtbl)
00045 #define HTMLINPUTTEXT(x)  (&(x)->lpHTMLInputTextElementVtbl)
00046 
00047 #define HTMLINPUT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputElement, iface)
00048 
00049 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
00050                                                          REFIID riid, void **ppv)
00051 {
00052     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00053 
00054     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
00055 }
00056 
00057 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
00058 {
00059     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00060 
00061     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
00062 }
00063 
00064 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
00065 {
00066     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00067 
00068     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
00069 }
00070 
00071 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
00072 {
00073     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00074 
00075     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
00076 }
00077 
00078 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
00079                                               LCID lcid, ITypeInfo **ppTInfo)
00080 {
00081     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00082 
00083     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
00084 }
00085 
00086 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
00087                                                 LPOLESTR *rgszNames, UINT cNames,
00088                                                 LCID lcid, DISPID *rgDispId)
00089 {
00090     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00091 
00092     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
00093             cNames, lcid, rgDispId);
00094 }
00095 
00096 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
00097                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
00098                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
00099 {
00100     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00101 
00102     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
00103             pDispParams, pVarResult, pExcepInfo, puArgErr);
00104 }
00105 
00106 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
00107 {
00108     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00109     nsAString type_str;
00110     nsresult nsres;
00111 
00112     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00113 
00114     /*
00115      * FIXME:
00116      * On IE setting type works only on dynamically created elements before adding them to DOM tree.
00117      */
00118     nsAString_InitDepend(&type_str, v);
00119     nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
00120     nsAString_Finish(&type_str);
00121     if(NS_FAILED(nsres)) {
00122         ERR("SetType failed: %08x\n", nsres);
00123         return E_FAIL;
00124     }
00125 
00126     return S_OK;
00127 }
00128 
00129 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
00130 {
00131     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00132     nsAString type_str;
00133     const PRUnichar *type;
00134     nsresult nsres;
00135 
00136     TRACE("(%p)->(%p)\n", This, p);
00137 
00138     nsAString_Init(&type_str, NULL);
00139     nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
00140 
00141     if(NS_SUCCEEDED(nsres)) {
00142         nsAString_GetData(&type_str, &type);
00143         *p = SysAllocString(type);
00144     }else {
00145         ERR("GetType failed: %08x\n", nsres);
00146     }
00147 
00148     nsAString_Finish(&type_str);
00149 
00150     TRACE("type=%s\n", debugstr_w(*p));
00151     return S_OK;
00152 }
00153 
00154 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
00155 {
00156     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00157     nsAString val_str;
00158     nsresult nsres;
00159 
00160     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00161 
00162     nsAString_InitDepend(&val_str, v);
00163     nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
00164     nsAString_Finish(&val_str);
00165     if(NS_FAILED(nsres))
00166         ERR("SetValue failed: %08x\n", nsres);
00167 
00168     return S_OK;
00169 }
00170 
00171 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
00172 {
00173     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00174     nsAString value_str;
00175     const PRUnichar *value = NULL;
00176     nsresult nsres;
00177 
00178     TRACE("(%p)->(%p)\n", This, p);
00179 
00180     nsAString_Init(&value_str, NULL);
00181 
00182     nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
00183     if(NS_SUCCEEDED(nsres)) {
00184         nsAString_GetData(&value_str, &value);
00185         *p = SysAllocString(value);
00186     }else {
00187         ERR("GetValue failed: %08x\n", nsres);
00188     }
00189 
00190     nsAString_Finish(&value_str);
00191 
00192     TRACE("value=%s\n", debugstr_w(*p));
00193     return S_OK;
00194 }
00195 
00196 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
00197 {
00198     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00199     nsAString name_str;
00200     nsresult nsres;
00201 
00202     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00203 
00204     nsAString_InitDepend(&name_str, v);
00205     nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
00206     nsAString_Finish(&name_str);
00207     if(NS_FAILED(nsres)) {
00208         ERR("SetName failed: %08x\n", nsres);
00209         return E_FAIL;
00210     }
00211 
00212     return S_OK;
00213 }
00214 
00215 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
00216 {
00217     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00218     nsAString name_str;
00219     const PRUnichar *name;
00220     nsresult nsres;
00221     HRESULT hres = S_OK;
00222 
00223     TRACE("(%p)->(%p)\n", This, p);
00224 
00225     nsAString_Init(&name_str, NULL);
00226 
00227     nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
00228     if(NS_SUCCEEDED(nsres)) {
00229         nsAString_GetData(&name_str, &name);
00230         *p = *name ? SysAllocString(name) : NULL;
00231     }else {
00232         ERR("GetName failed: %08x\n", nsres);
00233         hres = E_FAIL;
00234     }
00235 
00236     nsAString_Finish(&name_str);
00237     return hres;
00238 }
00239 
00240 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
00241 {
00242     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00243     FIXME("(%p)->(%x)\n", This, v);
00244     return E_NOTIMPL;
00245 }
00246 
00247 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
00248 {
00249     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00250     FIXME("(%p)->(%p)\n", This, p);
00251     return E_NOTIMPL;
00252 }
00253 
00254 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
00255 {
00256     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00257     nsresult nsres;
00258 
00259     TRACE("(%p)->(%x)\n", This, v);
00260 
00261     nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
00262     if(NS_FAILED(nsres))
00263         ERR("SetDisabled failed: %08x\n", nsres);
00264 
00265     return S_OK;
00266 }
00267 
00268 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
00269 {
00270     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00271     PRBool disabled = FALSE;
00272 
00273     TRACE("(%p)->(%p)\n", This, p);
00274 
00275     nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
00276 
00277     *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
00278     return S_OK;
00279 }
00280 
00281 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
00282 {
00283     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00284     FIXME("(%p)->(%p)\n", This, p);
00285     return E_NOTIMPL;
00286 }
00287 
00288 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
00289 {
00290     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00291     FIXME("(%p)->(%d)\n", This, v);
00292     return E_NOTIMPL;
00293 }
00294 
00295 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
00296 {
00297     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00298     FIXME("(%p)->(%p)\n", This, p);
00299     return E_NOTIMPL;
00300 }
00301 
00302 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
00303 {
00304     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00305     FIXME("(%p)->(%d)\n", This, v);
00306     return E_NOTIMPL;
00307 }
00308 
00309 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
00310 {
00311     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00312     FIXME("(%p)->(%p)\n", This, p);
00313     return E_NOTIMPL;
00314 }
00315 
00316 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
00317 {
00318     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00319     nsresult nsres;
00320 
00321     TRACE("(%p)\n", This);
00322 
00323     nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
00324     if(NS_FAILED(nsres)) {
00325         ERR("Select failed: %08x\n", nsres);
00326         return E_FAIL;
00327     }
00328 
00329     return S_OK;
00330 }
00331 
00332 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
00333 {
00334     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00335     FIXME("(%p)->()\n", This);
00336     return E_NOTIMPL;
00337 }
00338 
00339 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
00340 {
00341     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00342     FIXME("(%p)->(%p)\n", This, p);
00343     return E_NOTIMPL;
00344 }
00345 
00346 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
00347 {
00348     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00349     FIXME("(%p)->()\n", This);
00350     return E_NOTIMPL;
00351 }
00352 
00353 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
00354 {
00355     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00356     FIXME("(%p)->(%p)\n", This, p);
00357     return E_NOTIMPL;
00358 }
00359 
00360 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
00361 {
00362     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00363     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00364     return E_NOTIMPL;
00365 }
00366 
00367 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
00368 {
00369     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00370     FIXME("(%p)->(%p)\n", This, p);
00371     return E_NOTIMPL;
00372 }
00373 
00374 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
00375 {
00376     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00377     FIXME("(%p)->(%x)\n", This, v);
00378     return E_NOTIMPL;
00379 }
00380 
00381 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
00382 {
00383     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00384     FIXME("(%p)->(%p)\n", This, p);
00385     return E_NOTIMPL;
00386 }
00387 
00388 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
00389 {
00390     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00391     FIXME("(%p)->(%p)\n", This, range);
00392     return E_NOTIMPL;
00393 }
00394 
00395 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
00396 {
00397     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00398     FIXME("(%p)->(%x)\n", This, v);
00399     return E_NOTIMPL;
00400 }
00401 
00402 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
00403 {
00404     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00405     FIXME("(%p)->(%p)\n", This, p);
00406     return E_NOTIMPL;
00407 }
00408 
00409 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
00410 {
00411     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00412     nsresult nsres;
00413 
00414     TRACE("(%p)->(%x)\n", This, v);
00415 
00416     nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
00417     if(NS_FAILED(nsres)) {
00418         ERR("SetDefaultChecked failed: %08x\n", nsres);
00419         return E_FAIL;
00420     }
00421 
00422     return S_OK;
00423 }
00424 
00425 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
00426 {
00427     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00428     PRBool default_checked = FALSE;
00429     nsresult nsres;
00430 
00431     TRACE("(%p)->(%p)\n", This, p);
00432 
00433     nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
00434     if(NS_FAILED(nsres)) {
00435         ERR("GetDefaultChecked failed: %08x\n", nsres);
00436         return E_FAIL;
00437     }
00438 
00439     *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
00440     return S_OK;
00441 }
00442 
00443 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
00444 {
00445     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00446     nsresult nsres;
00447 
00448     TRACE("(%p)->(%x)\n", This, v);
00449 
00450     nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
00451     if(NS_FAILED(nsres)) {
00452         ERR("SetChecked failed: %08x\n", nsres);
00453         return E_FAIL;
00454     }
00455 
00456     return S_OK;
00457 }
00458 
00459 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
00460 {
00461     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00462     PRBool checked;
00463     nsresult nsres;
00464 
00465     TRACE("(%p)->(%p)\n", This, p);
00466 
00467     nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
00468     if(NS_FAILED(nsres)) {
00469         ERR("GetChecked failed: %08x\n", nsres);
00470         return E_FAIL;
00471     }
00472 
00473     *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
00474     TRACE("checked=%x\n", *p);
00475     return S_OK;
00476 }
00477 
00478 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
00479 {
00480     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00481     FIXME("(%p)->()\n", This);
00482     return E_NOTIMPL;
00483 }
00484 
00485 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
00486 {
00487     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00488     FIXME("(%p)->(%p)\n", This, p);
00489     return E_NOTIMPL;
00490 }
00491 
00492 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
00493 {
00494     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00495     FIXME("(%p)->(%d)\n", This, v);
00496     return E_NOTIMPL;
00497 }
00498 
00499 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
00500 {
00501     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00502     FIXME("(%p)->(%p)\n", This, p);
00503     return E_NOTIMPL;
00504 }
00505 
00506 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
00507 {
00508     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00509     FIXME("(%p)->(%d)\n", This, v);
00510     return E_NOTIMPL;
00511 }
00512 
00513 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
00514 {
00515     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00516     FIXME("(%p)->(%p)\n", This, p);
00517     return E_NOTIMPL;
00518 }
00519 
00520 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
00521 {
00522     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00523     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00524     return E_NOTIMPL;
00525 }
00526 
00527 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
00528 {
00529     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00530     FIXME("(%p)->(%p)\n", This, p);
00531     return E_NOTIMPL;
00532 }
00533 
00534 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
00535 {
00536     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00537     nsAString nsstr;
00538     nsresult nsres;
00539 
00540     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00541 
00542     nsAString_InitDepend(&nsstr, v);
00543     nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
00544     nsAString_Finish(&nsstr);
00545     if(NS_FAILED(nsres))
00546         ERR("SetSrc failed: %08x\n", nsres);
00547 
00548     return S_OK;
00549 }
00550 
00551 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
00552 {
00553     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00554     const PRUnichar *src;
00555     nsAString src_str;
00556     nsresult nsres;
00557     HRESULT hres;
00558 
00559     TRACE("(%p)->(%p)\n", This, p);
00560 
00561     nsAString_Init(&src_str, NULL);
00562     nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
00563     if(NS_FAILED(nsres)) {
00564         ERR("GetSrc failed: %08x\n", nsres);
00565         return E_FAIL;
00566     }
00567 
00568     nsAString_GetData(&src_str, &src);
00569     hres = nsuri_to_url(src, FALSE, p);
00570     nsAString_Finish(&src_str);
00571 
00572     return hres;
00573 }
00574 
00575 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
00576 {
00577     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00578     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00579     return E_NOTIMPL;
00580 }
00581 
00582 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
00583 {
00584     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00585     FIXME("(%p)->(%p)\n", This, p);
00586     return E_NOTIMPL;
00587 }
00588 
00589 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
00590 {
00591     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00592     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00593     return E_NOTIMPL;
00594 }
00595 
00596 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
00597 {
00598     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00599     FIXME("(%p)->(%p)\n", This, p);
00600     return E_NOTIMPL;
00601 }
00602 
00603 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
00604 {
00605     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00606     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00607     return E_NOTIMPL;
00608 }
00609 
00610 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
00611 {
00612     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00613     FIXME("(%p)->(%p)\n", This, p);
00614     return E_NOTIMPL;
00615 }
00616 
00617 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
00618 {
00619     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00620     FIXME("(%p)->(%p)\n", This, p);
00621     return E_NOTIMPL;
00622 }
00623 
00624 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
00625 {
00626     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00627     FIXME("(%p)->(%p)\n", This, p);
00628     return E_NOTIMPL;
00629 }
00630 
00631 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
00632 {
00633     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00634     FIXME("(%p)->()\n", This);
00635     return E_NOTIMPL;
00636 }
00637 
00638 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
00639 {
00640     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00641     FIXME("(%p)->(%p)\n", This, p);
00642     return E_NOTIMPL;
00643 }
00644 
00645 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
00646 {
00647     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00648     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00649     return E_NOTIMPL;
00650 }
00651 
00652 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
00653 {
00654     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00655     FIXME("(%p)->(%p)\n", This, p);
00656     return E_NOTIMPL;
00657 }
00658 
00659 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
00660 {
00661     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00662     FIXME("(%p)->()\n", This);
00663     return E_NOTIMPL;
00664 }
00665 
00666 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
00667 {
00668     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00669     FIXME("(%p)->(%p)\n", This, p);
00670     return E_NOTIMPL;
00671 }
00672 
00673 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
00674 {
00675     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00676     FIXME("(%p)->()\n", This);
00677     return E_NOTIMPL;
00678 }
00679 
00680 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
00681 {
00682     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00683     FIXME("(%p)->(%p)\n", This, p);
00684     return E_NOTIMPL;
00685 }
00686 
00687 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
00688 {
00689     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00690     FIXME("(%p)->()\n", This);
00691     return E_NOTIMPL;
00692 }
00693 
00694 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
00695 {
00696     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00697     FIXME("(%p)->(%p)\n", This, p);
00698     return E_NOTIMPL;
00699 }
00700 
00701 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
00702 {
00703     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00704     FIXME("(%p)->(%d)\n", This, v);
00705     return E_NOTIMPL;
00706 }
00707 
00708 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
00709 {
00710     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00711     FIXME("(%p)->(%p)\n", This, p);
00712     return E_NOTIMPL;
00713 }
00714 
00715 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
00716 {
00717     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00718     FIXME("(%p)->(%d)\n", This, v);
00719     return E_NOTIMPL;
00720 }
00721 
00722 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
00723 {
00724     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00725     FIXME("(%p)->(%p)\n", This, p);
00726     return E_NOTIMPL;
00727 }
00728 
00729 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
00730 {
00731     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00732     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00733     return E_NOTIMPL;
00734 }
00735 
00736 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
00737 {
00738     HTMLInputElement *This = HTMLINPUT_THIS(iface);
00739     FIXME("(%p)->(%p)\n", This, p);
00740     return E_NOTIMPL;
00741 }
00742 
00743 #undef HTMLINPUT_THIS
00744 
00745 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
00746     HTMLInputElement_QueryInterface,
00747     HTMLInputElement_AddRef,
00748     HTMLInputElement_Release,
00749     HTMLInputElement_GetTypeInfoCount,
00750     HTMLInputElement_GetTypeInfo,
00751     HTMLInputElement_GetIDsOfNames,
00752     HTMLInputElement_Invoke,
00753     HTMLInputElement_put_type,
00754     HTMLInputElement_get_type,
00755     HTMLInputElement_put_value,
00756     HTMLInputElement_get_value,
00757     HTMLInputElement_put_name,
00758     HTMLInputElement_get_name,
00759     HTMLInputElement_put_status,
00760     HTMLInputElement_get_status,
00761     HTMLInputElement_put_disabled,
00762     HTMLInputElement_get_disabled,
00763     HTMLInputElement_get_form,
00764     HTMLInputElement_put_size,
00765     HTMLInputElement_get_size,
00766     HTMLInputElement_put_maxLength,
00767     HTMLInputElement_get_maxLength,
00768     HTMLInputElement_select,
00769     HTMLInputElement_put_onchange,
00770     HTMLInputElement_get_onchange,
00771     HTMLInputElement_put_onselect,
00772     HTMLInputElement_get_onselect,
00773     HTMLInputElement_put_defaultValue,
00774     HTMLInputElement_get_defaultValue,
00775     HTMLInputElement_put_readOnly,
00776     HTMLInputElement_get_readOnly,
00777     HTMLInputElement_createTextRange,
00778     HTMLInputElement_put_indeterminate,
00779     HTMLInputElement_get_indeterminate,
00780     HTMLInputElement_put_defaultChecked,
00781     HTMLInputElement_get_defaultChecked,
00782     HTMLInputElement_put_checked,
00783     HTMLInputElement_get_checked,
00784     HTMLInputElement_put_border,
00785     HTMLInputElement_get_border,
00786     HTMLInputElement_put_vspace,
00787     HTMLInputElement_get_vspace,
00788     HTMLInputElement_put_hspace,
00789     HTMLInputElement_get_hspace,
00790     HTMLInputElement_put_alt,
00791     HTMLInputElement_get_alt,
00792     HTMLInputElement_put_src,
00793     HTMLInputElement_get_src,
00794     HTMLInputElement_put_lowsrc,
00795     HTMLInputElement_get_lowsrc,
00796     HTMLInputElement_put_vrml,
00797     HTMLInputElement_get_vrml,
00798     HTMLInputElement_put_dynsrc,
00799     HTMLInputElement_get_dynsrc,
00800     HTMLInputElement_get_readyState,
00801     HTMLInputElement_get_complete,
00802     HTMLInputElement_put_loop,
00803     HTMLInputElement_get_loop,
00804     HTMLInputElement_put_align,
00805     HTMLInputElement_get_align,
00806     HTMLInputElement_put_onload,
00807     HTMLInputElement_get_onload,
00808     HTMLInputElement_put_onerror,
00809     HTMLInputElement_get_onerror,
00810     HTMLInputElement_put_onabort,
00811     HTMLInputElement_get_onabort,
00812     HTMLInputElement_put_width,
00813     HTMLInputElement_get_width,
00814     HTMLInputElement_put_height,
00815     HTMLInputElement_get_height,
00816     HTMLInputElement_put_start,
00817     HTMLInputElement_get_start
00818 };
00819 
00820 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
00821 
00822 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
00823         REFIID riid, void **ppv)
00824 {
00825     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00826 
00827     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
00828 }
00829 
00830 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
00831 {
00832     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00833 
00834     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
00835 }
00836 
00837 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
00838 {
00839     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00840 
00841     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
00842 }
00843 
00844 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
00845 {
00846     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00847     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
00848 }
00849 
00850 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
00851         LCID lcid, ITypeInfo **ppTInfo)
00852 {
00853     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00854     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
00855 }
00856 
00857 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
00858         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
00859 {
00860     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00861     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
00862 }
00863 
00864 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
00865                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
00866                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
00867 {
00868     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00869     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
00870             pVarResult, pExcepInfo, puArgErr);
00871 }
00872 
00873 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
00874 {
00875     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00876 
00877     TRACE("(%p)->(%p)\n", This, p);
00878 
00879     return IHTMLInputElement_get_type(HTMLINPUT(This), p);
00880 }
00881 
00882 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
00883 {
00884     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00885 
00886     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00887 
00888     return IHTMLInputElement_put_value(HTMLINPUT(This), v);
00889 }
00890 
00891 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
00892 {
00893     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00894 
00895     TRACE("(%p)->(%p)\n", This, p);
00896 
00897     return IHTMLInputElement_get_value(HTMLINPUT(This), p);
00898 }
00899 
00900 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
00901 {
00902     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00903 
00904     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00905 
00906     return IHTMLInputElement_put_name(HTMLINPUT(This), v);
00907 }
00908 
00909 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
00910 {
00911     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00912 
00913     TRACE("(%p)->(%p)\n", This, p);
00914 
00915     return IHTMLInputElement_get_name(HTMLINPUT(This), p);
00916 }
00917 
00918 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
00919 {
00920     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00921     FIXME("(%p)->(v)\n", This);
00922     return E_NOTIMPL;
00923 }
00924 
00925 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
00926 {
00927     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00928     TRACE("(%p)->(v)\n", This);
00929     return E_NOTIMPL;
00930 }
00931 
00932 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
00933 {
00934     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00935 
00936     TRACE("(%p)->(%x)\n", This, v);
00937 
00938     return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
00939 }
00940 
00941 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
00942 {
00943     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00944 
00945     TRACE("(%p)->(%p)\n", This, p);
00946 
00947     return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
00948 }
00949 
00950 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
00951 {
00952     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00953 
00954     TRACE("(%p)->(%p)\n", This, p);
00955 
00956     return IHTMLInputElement_get_form(HTMLINPUT(This), p);
00957 }
00958 
00959 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
00960 {
00961     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00962 
00963     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00964 
00965     return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
00966 }
00967 
00968 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
00969 {
00970     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00971 
00972     TRACE("(%p)->(%p)\n", This, p);
00973 
00974     return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
00975 }
00976 
00977 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
00978 {
00979     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00980 
00981     TRACE("(%p)->(%d)\n", This, v);
00982 
00983     return IHTMLInputElement_put_size(HTMLINPUT(This), v);
00984 }
00985 
00986 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
00987 {
00988     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00989 
00990     TRACE("(%p)->(%p)\n", This, p);
00991 
00992     return IHTMLInputElement_get_size(HTMLINPUT(This), p);
00993 }
00994 
00995 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
00996 {
00997     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
00998 
00999     TRACE("(%p)->(%d)\n", This, v);
01000 
01001     return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
01002 }
01003 
01004 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
01005 {
01006     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01007 
01008     TRACE("(%p)->(%p)\n", This, p);
01009 
01010     return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
01011 }
01012 
01013 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
01014 {
01015     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01016 
01017     TRACE("(%p)\n", This);
01018 
01019     return IHTMLInputElement_select(HTMLINPUT(This));
01020 }
01021 
01022 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
01023 {
01024     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01025 
01026     TRACE("(%p)->()\n", This);
01027 
01028     return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
01029 }
01030 
01031 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
01032 {
01033     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01034 
01035     TRACE("(%p)->(%p)\n", This, p);
01036 
01037     return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
01038 }
01039 
01040 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
01041 {
01042     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01043 
01044     TRACE("(%p)->()\n", This);
01045 
01046     return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
01047 }
01048 
01049 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
01050 {
01051     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01052 
01053     TRACE("(%p)->(%p)\n", This, p);
01054 
01055     return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
01056 }
01057 
01058 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
01059 {
01060     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01061 
01062     TRACE("(%p)->(%x)\n", This, v);
01063 
01064     return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
01065 }
01066 
01067 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
01068 {
01069     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01070 
01071     TRACE("(%p)->(%p)\n", This, p);
01072 
01073     return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
01074 }
01075 
01076 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
01077 {
01078     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
01079 
01080     TRACE("(%p)->(%p)\n", This, range);
01081 
01082     return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
01083 }
01084 
01085 #undef HTMLINPUT_THIS
01086 
01087 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
01088     HTMLInputTextElement_QueryInterface,
01089     HTMLInputTextElement_AddRef,
01090     HTMLInputTextElement_Release,
01091     HTMLInputTextElement_GetTypeInfoCount,
01092     HTMLInputTextElement_GetTypeInfo,
01093     HTMLInputTextElement_GetIDsOfNames,
01094     HTMLInputTextElement_Invoke,
01095     HTMLInputTextElement_get_type,
01096     HTMLInputTextElement_put_value,
01097     HTMLInputTextElement_get_value,
01098     HTMLInputTextElement_put_name,
01099     HTMLInputTextElement_get_name,
01100     HTMLInputTextElement_put_status,
01101     HTMLInputTextElement_get_status,
01102     HTMLInputTextElement_put_disabled,
01103     HTMLInputTextElement_get_disabled,
01104     HTMLInputTextElement_get_form,
01105     HTMLInputTextElement_put_defaultValue,
01106     HTMLInputTextElement_get_defaultValue,
01107     HTMLInputTextElement_put_size,
01108     HTMLInputTextElement_get_size,
01109     HTMLInputTextElement_put_maxLength,
01110     HTMLInputTextElement_get_maxLength,
01111     HTMLInputTextElement_select,
01112     HTMLInputTextElement_put_onchange,
01113     HTMLInputTextElement_get_onchange,
01114     HTMLInputTextElement_put_onselect,
01115     HTMLInputTextElement_get_onselect,
01116     HTMLInputTextElement_put_readOnly,
01117     HTMLInputTextElement_get_readOnly,
01118     HTMLInputTextElement_createTextRange
01119 };
01120 
01121 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
01122 
01123 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
01124 {
01125     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
01126 
01127     *ppv = NULL;
01128 
01129     if(IsEqualGUID(&IID_IUnknown, riid)) {
01130         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
01131         *ppv = HTMLINPUT(This);
01132     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
01133         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
01134         *ppv = HTMLINPUT(This);
01135     }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
01136         TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
01137         *ppv = HTMLINPUT(This);
01138     }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
01139         TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
01140         *ppv = HTMLINPUTTEXT(This);
01141     }
01142 
01143     if(*ppv) {
01144         IUnknown_AddRef((IUnknown*)*ppv);
01145         return S_OK;
01146     }
01147 
01148     return HTMLElement_QI(&This->element.node, riid, ppv);
01149 }
01150 
01151 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
01152 {
01153     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
01154 
01155     nsIDOMHTMLInputElement_Release(This->nsinput);
01156 
01157     HTMLElement_destructor(&This->element.node);
01158 }
01159 
01160 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
01161 {
01162     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
01163 
01164     if(eid == EVENTID_CLICK) {
01165         nsresult nsres;
01166 
01167         *handled = TRUE;
01168 
01169         nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
01170         if(NS_FAILED(nsres)) {
01171             ERR("Click failed: %08x\n", nsres);
01172             return E_FAIL;
01173         }
01174     }
01175 
01176     return S_OK;
01177 }
01178 
01179 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
01180 {
01181     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
01182     return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
01183 }
01184 
01185 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
01186 {
01187     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
01188     return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
01189 }
01190 
01191 #undef HTMLINPUT_NODE_THIS
01192 
01193 static const NodeImplVtbl HTMLInputElementImplVtbl = {
01194     HTMLInputElement_QI,
01195     HTMLInputElement_destructor,
01196     NULL,
01197     HTMLInputElementImpl_call_event,
01198     HTMLInputElementImpl_put_disabled,
01199     HTMLInputElementImpl_get_disabled,
01200 };
01201 
01202 static const tid_t HTMLInputElement_iface_tids[] = {
01203     HTMLELEMENT_TIDS,
01204     IHTMLInputElement_tid,
01205     0
01206 };
01207 static dispex_static_data_t HTMLInputElement_dispex = {
01208     NULL,
01209     DispHTMLInputElement_tid,
01210     NULL,
01211     HTMLInputElement_iface_tids
01212 };
01213 
01214 HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
01215 {
01216     HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
01217     nsresult nsres;
01218 
01219     ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
01220     ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
01221     ret->element.node.vtbl = &HTMLInputElementImplVtbl;
01222 
01223     HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
01224 
01225     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
01226                                              (void**)&ret->nsinput);
01227     if(NS_FAILED(nsres))
01228         ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
01229 
01230     return &ret->element;
01231 }

Generated on Sun May 27 2012 04:24:57 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.