/*
 * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

#ifndef DO_NO_IMPORTS
import "oaidl.idl";
import "ocidl.idl";
import "DOMCore.idl";
import "DOMCSS.idl";
#endif

interface IDOMCSSRuleList;
interface IDOMDocument;
interface IDOMElement;

[
    object,
    oleautomation,
    uuid(19126DDF-E82F-46c0-A2F9-16879D7DADC5),
    pointer_default(unique)
]
interface IDOMWindow : IDOMObject
{
    // DOM Level 2 AbstractView Interface
    //readonly attribute Document document;
    HRESULT document([out, retval] IDOMDocument** result);

    // DOM Level 2 Style Interface
    //CSSStyleDeclaration getComputedStyle(in Element element,
    //                                     in DOMString pseudoElement);
    HRESULT getComputedStyle([in] IDOMElement* element, [in] BSTR pseudoElement);

    // WebKit extensions
    //CSSRuleList getMatchedCSSRules(in Element element,
    //                               in DOMString pseudoElement,
    //                               in [Optional] boolean authorOnly);
    HRESULT getMatchedCSSRules([in] IDOMElement* element, [in] BSTR pseudoElement, [in] BOOL authorOnly, [out, retval] IDOMCSSRuleList** result);

    //readonly attribute double devicePixelRatio;
    HRESULT devicePixelRatio([out, retval] double* result);

    // Global constructors
    //attribute CSSPrimitiveValueConstructor CSSPrimitiveValue;
    //attribute CSSRuleConstructor CSSRule;
    //attribute CSSStyleDeclarationConstructor CSSStyleDeclaration;
    //attribute CSSValueConstructor CSSValue;
    //attribute DocumentConstructor Document;
    //attribute DocumentFragmentConstructor DocumentFragment;
    //attribute DOMParserConstructor DOMParser;
    //attribute ElementConstructor Element;
    //attribute EventConstructor Event;
    //attribute HTMLElementConstructor HTMLElement;
    //attribute HTMLDocumentConstructor HTMLDocument;
    //attribute MutationEventConstructor MutationEvent;
    //attribute NodeConstructor Node;
    //attribute NodeFilterConstructor NodeFilter;
    //attribute RangeConstructor Range;
    //attribute RangeExceptionConstructor RangeException;

    // Mozilla has a separate XMLDocument object for XML documents. 
    // We just use Document for this.
    //attribute DocumentConstructor XMLDocument;

    //attribute XMLSerializerConstructor XMLSerializer;

    //#ifdef XPATH_SUPPORT
    //attribute XPathEvaluatorConstructor XPathEvaluator;
    //attribute XPathResultConstructor XPathResult;
    //#endif
}
