1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
|
/*
* Copyright 2011,2012 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "mshtmdid.h"
#include "wine/debug.h"
#include "mshtml_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
struct HTMLTitleElement {
HTMLElement element;
IHTMLTitleElement IHTMLTitleElement_iface;
};
static inline HTMLTitleElement *impl_from_IHTMLTitleElement(IHTMLTitleElement *iface)
{
return CONTAINING_RECORD(iface, HTMLTitleElement, IHTMLTitleElement_iface);
}
static HRESULT WINAPI HTMLTitleElement_QueryInterface(IHTMLTitleElement *iface,
REFIID riid, void **ppv)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLTitleElement_AddRef(IHTMLTitleElement *iface)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLTitleElement_Release(IHTMLTitleElement *iface)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLTitleElement_GetTypeInfoCount(IHTMLTitleElement *iface, UINT *pctinfo)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLTitleElement_GetTypeInfo(IHTMLTitleElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
ppTInfo);
}
static HRESULT WINAPI HTMLTitleElement_GetIDsOfNames(IHTMLTitleElement *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLTitleElement_Invoke(IHTMLTitleElement *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLTitleElement_put_text(IHTMLTitleElement *iface, BSTR v)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const IHTMLTitleElementVtbl HTMLTitleElementVtbl = {
HTMLTitleElement_QueryInterface,
HTMLTitleElement_AddRef,
HTMLTitleElement_Release,
HTMLTitleElement_GetTypeInfoCount,
HTMLTitleElement_GetTypeInfo,
HTMLTitleElement_GetIDsOfNames,
HTMLTitleElement_Invoke,
HTMLTitleElement_put_text,
HTMLTitleElement_get_text
};
static inline HTMLTitleElement *HTMLTitleElement_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLTitleElement, element.node);
}
static HRESULT HTMLTitleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
HTMLTitleElement *This = HTMLTitleElement_from_HTMLDOMNode(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IHTMLTitleElement, riid))
*ppv = &This->IHTMLTitleElement_iface;
else
return HTMLElement_QI(&This->element.node, riid, ppv);
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static void HTMLTitleElement_destructor(HTMLDOMNode *iface)
{
HTMLTitleElement *This = HTMLTitleElement_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node);
}
static const NodeImplVtbl HTMLTitleElementImplVtbl = {
&CLSID_HTMLTitleElement,
HTMLTitleElement_QI,
HTMLTitleElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
static const tid_t HTMLTitleElement_iface_tids[] = {
HTMLELEMENT_TIDS,
IHTMLTitleElement_tid,
0
};
static dispex_static_data_t HTMLTitleElement_dispex = {
NULL,
DispHTMLTitleElement_tid,
HTMLTitleElement_iface_tids,
HTMLElement_init_dispex_info
};
HRESULT HTMLTitleElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
{
HTMLTitleElement *ret;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return E_OUTOFMEMORY;
ret->IHTMLTitleElement_iface.lpVtbl = &HTMLTitleElementVtbl;
ret->element.node.vtbl = &HTMLTitleElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTitleElement_dispex);
*elem = &ret->element;
return S_OK;
}
struct HTMLHtmlElement {
HTMLElement element;
IHTMLHtmlElement IHTMLHtmlElement_iface;
};
static inline HTMLHtmlElement *impl_from_IHTMLHtmlElement(IHTMLHtmlElement *iface)
{
return CONTAINING_RECORD(iface, HTMLHtmlElement, IHTMLHtmlElement_iface);
}
static HRESULT WINAPI HTMLHtmlElement_QueryInterface(IHTMLHtmlElement *iface,
REFIID riid, void **ppv)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLHtmlElement_AddRef(IHTMLHtmlElement *iface)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLHtmlElement_Release(IHTMLHtmlElement *iface)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement *iface, UINT *pctinfo)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
ppTInfo);
}
static HRESULT WINAPI HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLHtmlElement_Invoke(IHTMLHtmlElement *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLHtmlElement_put_version(IHTMLHtmlElement *iface, BSTR v)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLHtmlElement_get_version(IHTMLHtmlElement *iface, BSTR *p)
{
HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl = {
HTMLHtmlElement_QueryInterface,
HTMLHtmlElement_AddRef,
HTMLHtmlElement_Release,
HTMLHtmlElement_GetTypeInfoCount,
HTMLHtmlElement_GetTypeInfo,
HTMLHtmlElement_GetIDsOfNames,
HTMLHtmlElement_Invoke,
HTMLHtmlElement_put_version,
HTMLHtmlElement_get_version
};
static inline HTMLHtmlElement *HTMLHtmlElement_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLHtmlElement, element.node);
}
static HRESULT HTMLHtmlElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IHTMLHtmlElement, riid))
*ppv = &This->IHTMLHtmlElement_iface;
else
return HTMLElement_QI(&This->element.node, riid, ppv);
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static void HTMLHtmlElement_destructor(HTMLDOMNode *iface)
{
HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node);
}
static BOOL HTMLHtmlElement_is_settable(HTMLDOMNode *iface, DISPID dispid)
{
switch(dispid) {
case DISPID_IHTMLELEMENT_OUTERTEXT:
return FALSE;
default:
return TRUE;
}
}
static const NodeImplVtbl HTMLHtmlElementImplVtbl = {
&CLSID_HTMLHtmlElement,
HTMLHtmlElement_QI,
HTMLHtmlElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLHtmlElement_is_settable
};
static const tid_t HTMLHtmlElement_iface_tids[] = {
HTMLELEMENT_TIDS,
IHTMLHtmlElement_tid,
0
};
static dispex_static_data_t HTMLHtmlElement_dispex = {
NULL,
DispHTMLHtmlElement_tid,
HTMLHtmlElement_iface_tids,
HTMLElement_init_dispex_info
};
HRESULT HTMLHtmlElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
{
HTMLHtmlElement *ret;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return E_OUTOFMEMORY;
ret->IHTMLHtmlElement_iface.lpVtbl = &HTMLHtmlElementVtbl;
ret->element.node.vtbl = &HTMLHtmlElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLHtmlElement_dispex);
*elem = &ret->element;
return S_OK;
}
struct HTMLMetaElement {
HTMLElement element;
IHTMLMetaElement IHTMLMetaElement_iface;
};
static inline HTMLMetaElement *impl_from_IHTMLMetaElement(IHTMLMetaElement *iface)
{
return CONTAINING_RECORD(iface, HTMLMetaElement, IHTMLMetaElement_iface);
}
static HRESULT WINAPI HTMLMetaElement_QueryInterface(IHTMLMetaElement *iface, REFIID riid, void **ppv)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLMetaElement_AddRef(IHTMLMetaElement *iface)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLMetaElement_Release(IHTMLMetaElement *iface)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLMetaElement_GetTypeInfoCount(IHTMLMetaElement *iface, UINT *pctinfo)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLMetaElement_GetTypeInfo(IHTMLMetaElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
ppTInfo);
}
static HRESULT WINAPI HTMLMetaElement_GetIDsOfNames(IHTMLMetaElement *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLMetaElement_Invoke(IHTMLMetaElement *iface, DISPID dispIdMember, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BSTR v)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLMetaElement_get_httpEquiv(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
static const PRUnichar httpEquivW[] = {'h','t','t','p','-','e','q','u','i','v',0};
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, httpEquivW, TRUE, p);
}
static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR v)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLMetaElement_get_content(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
static const PRUnichar contentW[] = {'c','o','n','t','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, contentW, TRUE, p);
}
static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLMetaElement_get_name(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
static const PRUnichar nameW[] = {'n','a','m','e',0};
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, nameW, TRUE, p);
}
static HRESULT WINAPI HTMLMetaElement_put_url(IHTMLMetaElement *iface, BSTR v)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const WCHAR charsetW[] = {'c','h','a','r','s','e','t',0};
static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
return elem_string_attr_setter(&This->element, charsetW, v);
}
static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
TRACE("(%p)->(%p)\n", This, p);
return elem_string_attr_getter(&This->element, charsetW, TRUE, p);
}
static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
HTMLMetaElement_QueryInterface,
HTMLMetaElement_AddRef,
HTMLMetaElement_Release,
HTMLMetaElement_GetTypeInfoCount,
HTMLMetaElement_GetTypeInfo,
HTMLMetaElement_GetIDsOfNames,
HTMLMetaElement_Invoke,
HTMLMetaElement_put_httpEquiv,
HTMLMetaElement_get_httpEquiv,
HTMLMetaElement_put_content,
HTMLMetaElement_get_content,
HTMLMetaElement_put_name,
HTMLMetaElement_get_name,
HTMLMetaElement_put_url,
HTMLMetaElement_get_url,
HTMLMetaElement_put_charset,
HTMLMetaElement_get_charset
};
static inline HTMLMetaElement *HTMLMetaElement_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLMetaElement, element.node);
}
static HRESULT HTMLMetaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = &This->IHTMLMetaElement_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = &This->IHTMLMetaElement_iface;
}else if(IsEqualGUID(&IID_IHTMLMetaElement, riid)) {
TRACE("(%p)->(IID_IHTMLMetaElement %p)\n", This, ppv);
*ppv = &This->IHTMLMetaElement_iface;
}else {
return HTMLElement_QI(&This->element.node, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static void HTMLMetaElement_destructor(HTMLDOMNode *iface)
{
HTMLMetaElement *This = HTMLMetaElement_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node);
}
static const NodeImplVtbl HTMLMetaElementImplVtbl = {
&CLSID_HTMLMetaElement,
HTMLMetaElement_QI,
HTMLMetaElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
static const tid_t HTMLMetaElement_iface_tids[] = {
HTMLELEMENT_TIDS,
IHTMLMetaElement_tid,
0
};
static dispex_static_data_t HTMLMetaElement_dispex = {
NULL,
DispHTMLMetaElement_tid,
HTMLMetaElement_iface_tids,
HTMLElement_init_dispex_info
};
HRESULT HTMLMetaElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
{
HTMLMetaElement *ret;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return E_OUTOFMEMORY;
ret->IHTMLMetaElement_iface.lpVtbl = &HTMLMetaElementVtbl;
ret->element.node.vtbl = &HTMLMetaElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLMetaElement_dispex);
*elem = &ret->element;
return S_OK;
}
struct HTMLHeadElement {
HTMLElement element;
IHTMLHeadElement IHTMLHeadElement_iface;
};
static inline HTMLHeadElement *impl_from_IHTMLHeadElement(IHTMLHeadElement *iface)
{
return CONTAINING_RECORD(iface, HTMLHeadElement, IHTMLHeadElement_iface);
}
static HRESULT WINAPI HTMLHeadElement_QueryInterface(IHTMLHeadElement *iface,
REFIID riid, void **ppv)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLHeadElement_AddRef(IHTMLHeadElement *iface)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLHeadElement_Release(IHTMLHeadElement *iface)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLHeadElement_GetTypeInfoCount(IHTMLHeadElement *iface, UINT *pctinfo)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLHeadElement_GetTypeInfo(IHTMLHeadElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
ppTInfo);
}
static HRESULT WINAPI HTMLHeadElement_GetIDsOfNames(IHTMLHeadElement *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLHeadElement_Invoke(IHTMLHeadElement *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLHeadElement_put_profile(IHTMLHeadElement *iface, BSTR v)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLHeadElement_get_profile(IHTMLHeadElement *iface, BSTR *p)
{
HTMLHeadElement *This = impl_from_IHTMLHeadElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static const IHTMLHeadElementVtbl HTMLHeadElementVtbl = {
HTMLHeadElement_QueryInterface,
HTMLHeadElement_AddRef,
HTMLHeadElement_Release,
HTMLHeadElement_GetTypeInfoCount,
HTMLHeadElement_GetTypeInfo,
HTMLHeadElement_GetIDsOfNames,
HTMLHeadElement_Invoke,
HTMLHeadElement_put_profile,
HTMLHeadElement_get_profile
};
static inline HTMLHeadElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLHeadElement, element.node);
}
static HRESULT HTMLHeadElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{
HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IHTMLHeadElement, riid))
*ppv = &This->IHTMLHeadElement_iface;
else
return HTMLElement_QI(&This->element.node, riid, ppv);
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static void HTMLHeadElement_destructor(HTMLDOMNode *iface)
{
HTMLHeadElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node);
}
static const NodeImplVtbl HTMLHeadElementImplVtbl = {
&CLSID_HTMLHeadElement,
HTMLHeadElement_QI,
HTMLHeadElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
static const tid_t HTMLHeadElement_iface_tids[] = {
HTMLELEMENT_TIDS,
IHTMLHeadElement_tid,
0
};
static dispex_static_data_t HTMLHeadElement_dispex = {
NULL,
DispHTMLHeadElement_tid,
HTMLHeadElement_iface_tids,
HTMLElement_init_dispex_info
};
HRESULT HTMLHeadElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
{
HTMLHeadElement *ret;
ret = heap_alloc_zero(sizeof(*ret));
if(!ret)
return E_OUTOFMEMORY;
ret->IHTMLHeadElement_iface.lpVtbl = &HTMLHeadElementVtbl;
ret->element.node.vtbl = &HTMLHeadElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLHeadElement_dispex);
*elem = &ret->element;
return S_OK;
}
|