WebKit/mac/WebView/WebFrameInternal.h
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2  * Copyright (C) 2005, 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  *
       
     8  * 1.  Redistributions of source code must retain the above copyright
       
     9  *     notice, this list of conditions and the following disclaimer. 
       
    10  * 2.  Redistributions in binary form must reproduce the above copyright
       
    11  *     notice, this list of conditions and the following disclaimer in the
       
    12  *     documentation and/or other materials provided with the distribution. 
       
    13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
       
    14  *     its contributors may be used to endorse or promote products derived
       
    15  *     from this software without specific prior written permission. 
       
    16  *
       
    17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
       
    18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
    19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       
    20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
       
    21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
       
    22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
       
    23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
       
    24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
       
    25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
       
    26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    27  */
       
    28 
       
    29 // This header contains WebFrame declarations that can be used anywhere in WebKit, but are neither SPI nor API.
       
    30 
       
    31 #import "WebFramePrivate.h"
       
    32 #import "WebPreferencesPrivate.h"
       
    33 
       
    34 #import <WebCore/EditAction.h>
       
    35 #import <WebCore/FrameLoaderTypes.h>
       
    36 #import <WebCore/SelectionController.h>
       
    37 #import <WebCore/Settings.h>
       
    38 
       
    39 @class DOMCSSStyleDeclaration;
       
    40 @class DOMDocumentFragment;
       
    41 @class DOMElement;
       
    42 @class DOMNode;
       
    43 @class DOMRange;
       
    44 @class WebFrameView;
       
    45 @class WebHistoryItem;
       
    46 
       
    47 class WebScriptDebugger;
       
    48 
       
    49 namespace WebCore {
       
    50     class CSSStyleDeclaration;
       
    51     class Document;
       
    52     class DocumentLoader;
       
    53     class Element;
       
    54     class Frame;
       
    55     class Frame;
       
    56     class HistoryItem;
       
    57     class HTMLElement;
       
    58     class HTMLFrameOwnerElement;
       
    59     class Node;
       
    60     class Page;
       
    61     class Range;
       
    62 }
       
    63 
       
    64 typedef WebCore::HistoryItem WebCoreHistoryItem;
       
    65 
       
    66 WebCore::Frame* core(WebFrame *);
       
    67 WebFrame *kit(WebCore::Frame *);
       
    68 
       
    69 WebCore::Page* core(WebView *);
       
    70 WebView *kit(WebCore::Page*);
       
    71 
       
    72 WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior);
       
    73 WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior);
       
    74 WebCore::EditingBehaviorType core(WebKitEditingBehavior);
       
    75 
       
    76 WebView *getWebView(WebFrame *webFrame);
       
    77 
       
    78 @interface WebFramePrivate : NSObject {
       
    79 @public
       
    80     WebCore::Frame* coreFrame;
       
    81     WebFrameView *webFrameView;
       
    82     WebScriptDebugger* scriptDebugger;
       
    83     id internalLoadDelegate;
       
    84     BOOL shouldCreateRenderers;
       
    85     BOOL includedInWebKitStatistics;
       
    86 }
       
    87 @end
       
    88 
       
    89 @protocol WebCoreRenderTreeCopier <NSObject>
       
    90 - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)position rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
       
    91 @end
       
    92 
       
    93 @interface WebFrame (WebInternal)
       
    94 
       
    95 + (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView;
       
    96 + (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView;
       
    97 - (id)_initWithWebFrameView:(WebFrameView *)webFrameView webView:(WebView *)webView;
       
    98 
       
    99 - (void)_clearCoreFrame;
       
   100 
       
   101 - (BOOL)_isIncludedInWebKitStatistics;
       
   102 
       
   103 - (void)_updateBackgroundAndUpdatesWhileOffscreen;
       
   104 - (void)_setInternalLoadDelegate:(id)internalLoadDelegate;
       
   105 - (id)_internalLoadDelegate;
       
   106 #ifndef BUILDING_ON_TIGER
       
   107 - (void)_unmarkAllBadGrammar;
       
   108 #endif
       
   109 - (void)_unmarkAllMisspellings;
       
   110 
       
   111 - (BOOL)_hasSelection;
       
   112 - (void)_clearSelection;
       
   113 - (WebFrame *)_findFrameWithSelection;
       
   114 - (void)_clearSelectionInOtherFrames;
       
   115 
       
   116 - (void)_attachScriptDebugger;
       
   117 - (void)_detachScriptDebugger;
       
   118 
       
   119 // dataSource reports null for the initial empty document's data source; this is needed
       
   120 // to preserve compatibility with Mail and Safari among others. But internal to WebKit,
       
   121 // we need to be able to get the initial data source as well, so the _dataSource method
       
   122 // should be used instead.
       
   123 - (WebDataSource *)_dataSource;
       
   124 
       
   125 - (BOOL)_needsLayout;
       
   126 - (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly;
       
   127 - (BOOL)_getVisibleRect:(NSRect*)rect;
       
   128 - (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
       
   129 
       
   130 - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string;
       
   131 - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture;
       
   132 
       
   133 - (NSString *)_selectedString;
       
   134 - (NSString *)_stringForRange:(DOMRange *)range;
       
   135 
       
   136 - (NSString *)_markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes;
       
   137 
       
   138 - (NSRect)_caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
       
   139 - (NSRect)_firstRectForDOMRange:(DOMRange *)range;
       
   140 - (void)_scrollDOMRangeToVisible:(DOMRange *)range;
       
   141 
       
   142 - (id)_accessibilityTree;
       
   143 
       
   144 - (DOMRange *)_rangeByAlteringCurrentSelection:(WebCore::SelectionController::EAlteration)alteration direction:(WebCore::SelectionController::EDirection)direction granularity:(WebCore::TextGranularity)granularity;
       
   145 - (void)_smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
       
   146 - (NSRange)_convertToNSRange:(WebCore::Range*)range;
       
   147 - (DOMRange *)_convertNSRangeToDOMRange:(NSRange)range;
       
   148 - (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range;
       
   149 
       
   150 - (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
       
   151 - (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes;
       
   152 
       
   153 - (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
       
   154 
       
   155 - (void)_insertParagraphSeparatorInQuotedContent;
       
   156 
       
   157 - (DOMRange *)_characterRangeAtPoint:(NSPoint)point;
       
   158 
       
   159 - (DOMCSSStyleDeclaration *)_typingStyle;
       
   160 - (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebCore::EditAction)undoAction;
       
   161 
       
   162 - (void)_dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
       
   163 
       
   164 - (BOOL)_canProvideDocumentSource;
       
   165 - (BOOL)_canSaveAsWebArchive;
       
   166 
       
   167 - (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
       
   168 
       
   169 @end
       
   170 
       
   171 @interface NSObject (WebInternalFrameLoadDelegate)
       
   172 - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error;
       
   173 @end