1/*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef DO_NO_IMPORTS
27import "oaidl.idl";
28import "ocidl.idl";
29import "IWebFrame.idl";
30#endif
31
32interface IWebFrame;
33interface IWebScriptWorld;
34
35typedef enum {
36    WebFrameLoadTypeStandard,
37    WebFrameLoadTypeBack,
38    WebFrameLoadTypeForward,
39    WebFrameLoadTypeIndexedBackForward, // a multi-item hop in the backforward list
40    WebFrameLoadTypeReload,
41    WebFrameLoadTypeReloadAllowingStaleData,
42    WebFrameLoadTypeSame,               // user loads same URL again (but not reload button)
43    WebFrameLoadTypeRedirectWithLockedBackForwardList,
44    WebFrameLoadTypeReplace,
45    WebFrameLoadTypeReloadFromOrigin,
46    WebFrameLoadTypeBackWMLDeckNotAccessible
47} WebFrameLoadType;
48
49[
50    object,
51    oleautomation,
52    uuid(A1657D07-4881-4475-9D10-76548731D448),
53    pointer_default(unique)
54]
55
56interface IWebFramePrivate : IUnknown
57{
58    HRESULT unused1([out, retval] BSTR*);
59    HRESULT scrollOffset([out, retval] SIZE* offset);
60
61    // FIXME: This shouldn't be needed once IWebDocumentView is implemented.
62    HRESULT layout();
63    HRESULT firstLayoutDone([out, retval] BOOL* result);
64    HRESULT loadType([out, retval] WebFrameLoadType* type);
65
66    HRESULT setInPrintingMode([in] BOOL value, [in] HDC printDC);
67    HRESULT getPrintedPageCount([in] HDC printDC, [out, retval] UINT* pageCount);
68    [local] HRESULT spoolPages([in] HDC printDC, [in] UINT startPage, [in] UINT endPage, [out, retval] void* ctx);
69
70    HRESULT isFrameSet([out, retval] BOOL* result);
71    HRESULT string([out, retval] BSTR* result);
72
73    HRESULT size([out, retval] SIZE* size);
74    HRESULT hasScrollBars([out, retval] BOOL* result);
75    HRESULT contentBounds([out, retval] RECT* result);
76    HRESULT frameBounds([out, retval] RECT* result);
77
78    HRESULT isDescendantOfFrame([in] IWebFrame* ancestor, [out, retval] BOOL* result);
79
80    HRESULT pendingFrameUnloadEventCount([out, retval] UINT* result);
81
82    HRESULT unused2();
83
84    HRESULT paintDocumentRectToContext([in] RECT rect, [in] OLE_HANDLE deviceContext);
85
86    HRESULT elementDoesAutoComplete([in] IDOMElement* element, [out, retval] BOOL* result);
87
88    HRESULT pauseAnimation([in] BSTR animationName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning);
89    HRESULT pauseTransition([in] BSTR propertyName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* transitionWasRunning);
90    HRESULT numberOfActiveAnimations([out, retval] UINT* number);
91
92    HRESULT isDisplayingStandaloneImage([out, retval] BOOL* result);
93
94    HRESULT allowsFollowingLink([in] BSTR url, [out, retval] BOOL* result);
95
96    [local] HRESULT stringByEvaluatingJavaScriptInScriptWorld([in] IWebScriptWorld*, [in] JSObjectRef globalObject, [in] BSTR script, [out, retval] BSTR* result);
97
98    [local] JSGlobalContextRef globalContextForScriptWorld([in] IWebScriptWorld*);
99
100    HRESULT counterValueForElementById([in] BSTR id, [out, retval] BSTR* result);
101
102    HRESULT pauseSVGAnimation([in] BSTR elementId, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning);
103
104    HRESULT visibleContentRect([out, retval] RECT*);
105
106    HRESULT pageNumberForElementById([in] BSTR id, [in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber);
107
108    HRESULT numberOfPages([in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber);
109
110    HRESULT layerTreeAsText([out, retval] BSTR* result);
111
112    HRESULT paintScrollViewRectToContextAtPoint([in] RECT rect, [in] POINT pt, [in] OLE_HANDLE deviceContext);
113
114    HRESULT renderTreeAsExternalRepresentation([in] BOOL forPrinting, [out, retval] BSTR* result);
115
116    HRESULT suspendAnimations();
117    HRESULT resumeAnimations();
118
119    HRESULT loadPlainTextString([in] BSTR string, [in] BSTR url);
120
121    HRESULT hasSpellingMarker([in] UINT from, [in] UINT length, [out, retval] BOOL* result);
122
123    HRESULT clearOpener();
124}
125