Esempio n. 1
0
static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    nsAString link_str;
    nsresult nsres;

    TRACE("(%p)->(v%d)\n", This, V_VT(&v));

    if(!variant_to_nscolor(&v, &link_str))
        return S_OK;

    nsres = nsIDOMHTMLBodyElement_SetLink(This->nsbody, &link_str);
    nsAString_Finish(&link_str);
    if(NS_FAILED(nsres))
        ERR("SetLink failed: %08x\n", nsres);

    return S_OK;
}
Esempio n. 2
0
static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIANT v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    nsAString strColor;
    nsresult nsres;

    TRACE("(%p)->()\n", This);

    if(!variant_to_nscolor(&v, &strColor))
        return S_OK;

    nsres = nsIDOMHTMLBodyElement_SetBgColor(This->nsbody, &strColor);
    nsAString_Finish(&strColor);
    if(NS_FAILED(nsres))
        ERR("SetBgColor failed: %08x\n", nsres);

    return S_OK;
}
Esempio n. 3
0
static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    nsAString text;
    nsresult nsres;

    TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));

    if(!variant_to_nscolor(&v, &text))
        return S_OK;

    nsres = nsIDOMHTMLBodyElement_SetText(This->nsbody, &text);
    nsAString_Finish(&text);
    if(NS_FAILED(nsres)) {
        ERR("SetText failed: %08x\n", nsres);
        return E_FAIL;
    }

    return S_OK;
}
Esempio n. 4
0
static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    static const WCHAR *val;

    TRACE("(%p)->(%s)\n", This, debugstr_w(v));

    /* Emulate with CSS visibility attribute */
    if(!strcmpW(v, yesW)) {
        val = scrollW;
    }else if(!strcmpW(v, autoW)) {
        val = visibleW;
    }else if(!strcmpW(v, noW)) {
        val = hiddenW;
    }else {
        WARN("Invalid argument %s\n", debugstr_w(v));
        return E_INVALIDARG;
    }

    return set_elem_style(&This->textcont.element, STYLEID_OVERFLOW, val);
}
Esempio n. 5
0
static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, IHTMLTxtRange **range)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    nsIDOMDocumentRange *nsdocrange;
    nsIDOMRange *nsrange = NULL;
    nsresult nsres;
    HRESULT hres;

    TRACE("(%p)->(%p)\n", This, range);

    if(!This->textcont.element.node.doc->nsdoc) {
        WARN("No nsdoc\n");
        return E_UNEXPECTED;
    }

    nsres = nsIDOMDocument_QueryInterface(This->textcont.element.node.doc->nsdoc, &IID_nsIDOMDocumentRange,
            (void**)&nsdocrange);
    if(NS_FAILED(nsres)) {
        ERR("Could not get nsIDOMDocumentRabge iface: %08x\n", nsres);
        return E_FAIL;
    }

    nsres = nsIDOMDocumentRange_CreateRange(nsdocrange, &nsrange);
    if(NS_SUCCEEDED(nsres)) {
        nsres = nsIDOMRange_SelectNodeContents(nsrange, This->textcont.element.node.nsnode);
        if(NS_FAILED(nsres))
            ERR("SelectNodeContents failed: %08x\n", nsres);
    }else {
        ERR("CreateRange failed: %08x\n", nsres);
    }

    nsIDOMDocumentRange_Release(nsdocrange);

    hres = HTMLTxtRange_Create(This->textcont.element.node.doc->basedoc.doc_node, nsrange, range);

    nsIDOMRange_Release(nsrange);
    return hres;
}
Esempio n. 6
0
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    const WCHAR *ret = NULL;
    BSTR overflow;
    HRESULT hres;

    TRACE("(%p)->(%p)\n", This, p);

    /* Emulate with CSS visibility attribute */
    hres = get_elem_style(&This->textcont.element, STYLEID_OVERFLOW, &overflow);
    if(FAILED(hres))
        return hres;

    if(!overflow || !*overflow) {
        *p = NULL;
        hres = S_OK;
    }else if(!strcmpW(overflow, visibleW) || !strcmpW(overflow, autoW)) {
        ret = autoW;
    }else if(!strcmpW(overflow, scrollW)) {
        ret = yesW;
    }else if(!strcmpW(overflow, hiddenW)) {
        ret = noW;
    }else {
        TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
        *p = NULL;
        hres = S_OK;
    }

    SysFreeString(overflow);
    if(ret) {
        *p = SysAllocString(ret);
        hres = *p ? S_OK : E_OUTOFMEMORY;
    }

    return hres;
}
Esempio n. 7
0
static HRESULT WINAPI HTMLBodyElement_get_onbeforeunload(IHTMLBodyElement *iface, VARIANT *p)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    FIXME("(%p)->(%p)\n", This, p);
    return E_NOTIMPL;
}
Esempio n. 8
0
static HRESULT WINAPI HTMLBodyElement_put_onbeforeunload(IHTMLBodyElement *iface, VARIANT v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
    return E_NOTIMPL;
}
Esempio n. 9
0
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    FIXME("(%p)->(%p)\n", This, p);
    return E_NOTIMPL;
}
Esempio n. 10
0
static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
    return E_NOTIMPL;
}
Esempio n. 11
0
static HRESULT WINAPI HTMLBodyElement_get_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL *p)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    FIXME("(%p)->(%p)\n", This, p);
    return E_NOTIMPL;
}
Esempio n. 12
0
static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    return IDispatchEx_GetTypeInfoCount(&This->textcont.element.node.dispex.IDispatchEx_iface,
            pctinfo);
}
Esempio n. 13
0
static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);

    return IHTMLDOMNode_Release(&This->textcont.element.node.IHTMLDOMNode_iface);
}
Esempio n. 14
0
static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
{
    HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}