1 /* 2 * Copyright (C) 2004-2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 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 * 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27 #import <WebCore/DOM.h> 28 29 @interface DOMNode (DOMNodeExtensionsPendingPublic) 30 - (NSImage *)renderedImage; 31 - (NSArray *)textRects; 32 @end 33 34 // FIXME: this should be removed as soon as all internal Apple uses of it have been replaced with 35 // calls to the public method - (NSColor *)color. 36 @interface DOMRGBColor (WebPrivate) 37 - (NSColor *)_color; 38 @end 39 40 // FIXME: this should be removed as soon as all internal Apple uses of it have been replaced with 41 // calls to the public method - (NSString *)text. 42 @interface DOMRange (WebPrivate) 43 - (NSString *)_text; 44 @end 45 46 @interface DOMRange (DOMRangeExtensions) 47 - (NSRect)boundingBox; 48 - (NSArray *)lineBoxRects; // Deprecated. Use textRects instead. 49 - (NSArray *)textRects; 50 @end 51 52 @interface DOMElement (WebPrivate) 53 - (NSFont *)_font; 54 - (NSData *)_imageTIFFRepresentation; 55 - (NSURL *)_getURLAttribute:(NSString *)name; 56 - (BOOL)isFocused; 57 @end 58 59 @interface DOMCSSStyleDeclaration (WebPrivate) 60 - (NSString *)_fontSizeDelta; 61 - (void)_setFontSizeDelta:(NSString *)fontSizeDelta; 62 @end 63 64 @interface DOMHTMLDocument (WebPrivate) 65 - (DOMDocumentFragment *)_createDocumentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString; 66 - (DOMDocumentFragment *)_createDocumentFragmentWithText:(NSString *)text; 67 @end 68 69 // All the methods in this category are used by Safari forms autofill and should not be used for any other purpose. 70 // Each one should eventually be replaced by public DOM API, and when that happens Safari will switch to implementations 71 // using that public API, and these will be deleted. 72 @interface DOMHTMLInputElement (FormAutoFillTransition) 73 - (BOOL)_isAutofilled; 74 - (BOOL)_isTextField; 75 - (NSRect)_rectOnScreen; // bounding box of the text field, in screen coordinates 76 - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index; 77 - (NSRange)_selectedRange; 78 - (void)_setAutofilled:(BOOL)filled; 79 @end 80 81 // These changes are necessary to detect whether a form input was modified by a user 82 // or javascript 83 @interface DOMHTMLInputElement (FormPromptAdditions) 84 - (BOOL)_isEdited; 85 @end 86 87 @interface DOMHTMLTextAreaElement (FormPromptAdditions) 88 - (BOOL)_isEdited; 89 @end 90 91 // All the methods in this category are used by Safari forms autofill and should not be used for any other purpose. 92 // They are stopgap measures until we finish transitioning form controls to not use NSView. Each one should become 93 // replaceable by public DOM API, and when that happens Safari will switch to implementations using that public API, 94 // and these will be deleted. 95 @interface DOMHTMLSelectElement (FormAutoFillTransition) 96 - (void)_activateItemAtIndex:(int)index; 97 - (void)_activateItemAtIndex:(int)index allowMultipleSelection:(BOOL)allowMultipleSelection; 98 @end 99