Web Kit Objective-C Framework Reference
Total Page:16
File Type:pdf, Size:1020Kb
Web Kit Objective-C Framework Reference 2006-05-23 Java and all Java-based trademarks are Apple Computer, Inc. trademarks or registered trademarks of Sun © 2006 Apple Computer, Inc. Microsystems, Inc. in the U.S. and other All rights reserved. countries. Simultaneously published in the United No part of this publication may be States and Canada. reproduced, stored in a retrieval system, or Even though Apple has reviewed this document, transmitted, in any form or by any means, APPLE MAKES NO WARRANTY OR mechanical, electronic, photocopying, REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS recording, or otherwise, without prior DOCUMENT, ITS QUALITY, ACCURACY, written permission of Apple Computer, Inc., MERCHANTABILITY, OR FITNESS FOR A with the following exceptions: Any person PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND is hereby authorized to store documentation YOU, THE READER, ARE ASSUMING THE on a single computer for personal use only ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. and to print copies of documentation for IN NO EVENT WILL APPLE BE LIABLE FOR personal use provided that the DIRECT, INDIRECT, SPECIAL, INCIDENTAL, documentation contains Apple’s copyright OR CONSEQUENTIAL DAMAGES notice. RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if The Apple logo is a trademark of Apple advised of the possibility of such damages. Computer, Inc. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN Use of the “keyboard” Apple logo LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, (Option-Shift-K) for commercial purposes or employee is authorized to make any without the prior written consent of Apple modification, extension, or addition to this may constitute trademark infringement and warranty. unfair competition in violation of federal Some states do not allow the exclusion or limitation of implied warranties or liability for and state laws. incidental or consequential damages, so the above limitation or exclusion may not apply to No licenses, express or implied, are granted you. This warranty gives you specific legal with respect to any of the technology rights, and you may also have other rights which vary from state to state. described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled or Apple-licensed computers. Every effort has been made to ensure that the information in this document is accurate. Apple is not responsible for typographical errors. Apple Computer, Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Logic, Mac, and Mac OS are trademarks of Apple Computer, Inc., registered in the United States and other countries. Finder and Safari are trademarks of Apple Computer, Inc. Objective-C is a registered trademark of NeXT Software, Inc. WebScript is a trademark of NeXT Software, Inc. Contents Introduction Web Kit Objective-C Reference 9 Introduction 9 Part I Classes 11 Chapter 1 DOMDocument Web Kit Additions Reference 13 Class Description 13 Methods by Task 13 Instance Methods 14 Chapter 2 DOMHTMLFrameElement Web Kit Additions Reference 15 Class Description 15 Methods by Task 15 Instance Methods 16 Chapter 3 DOMHTMLIFrameElement Web Kit Additions Reference 17 Class Description 17 Methods by Task 17 Instance Methods 18 Chapter 4 DOMHTMLObjectElement Web Kit Additions Reference 19 Class Description 19 Methods by Task 19 Instance Methods 20 Chapter 5 DOMNode Web Kit Additions Reference 21 Class Description 21 Methods by Task 21 Instance Methods 22 3 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. CONTENTS Chapter 6 DOMRange Web Kit Additions Reference 23 Class Description 23 Methods by Task 23 Instance Methods 24 Chapter 7 WebArchive Class Reference 25 Class Description 25 Methods by Task 25 Instance Methods 26 Constants 27 Chapter 8 WebBackForwardList Class Reference 29 Class Description 29 Methods by Task 30 Instance Methods 31 Chapter 9 WebDataSource Class Reference 37 Class Description 37 Methods by Task 38 Instance Methods 39 Chapter 10 WebDownload Class Reference 45 Class Description 45 Delegate Methods by Task 45 Delegate Methods 46 Chapter 11 WebFrame Class Reference 47 Class Description 47 Methods by Task 48 Instance Methods 49 Chapter 12 WebFrameView Class Reference 57 Class Description 57 Methods by Task 57 Instance Methods 58 Chapter 13 WebHistory Class Reference 61 Class Description 61 4 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. CONTENTS Methods by Task 61 Class Methods 63 Instance Methods 63 Constants 67 Notifications 67 Chapter 14 WebHistoryItem Class Reference 71 Class Description 71 Adopted Protocols 71 Methods by Task 72 Instance Methods 72 Notifications 75 Chapter 15 WebPreferences Class Reference 77 Class Description 77 Adopted Protocols 78 Methods by Task 78 Class Methods 82 Instance Methods 82 Notifications 97 Chapter 16 WebResource Class Reference 99 Class Description 99 Methods by Task 99 Instance Methods 100 Chapter 17 WebScriptObject Class Reference 103 Class Description 103 Methods by Task 104 Class Methods 104 Instance Methods 105 Chapter 18 WebUndefined Class Reference 109 Class Description 109 Methods by Task 109 Class Methods 110 Chapter 19 WebView Class Reference 111 Class Description 111 Methods by Task 112 5 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. CONTENTS Class Methods 120 Instance Methods 122 Constants 156 Notifications 157 Part II Protocols 159 Chapter 20 WebDocumentRepresentation Protocol Reference 161 Protocol Description 161 Methods by Task 161 Instance Methods 162 Chapter 21 WebDocumentSearching Protocol Reference 165 Protocol Description 165 Methods by Task 165 Instance Methods 165 Chapter 22 WebDocumentText Protocol Reference 167 Protocol Description 167 Methods by Task 167 Instance Methods 168 Chapter 23 WebDocumentView Protocol Reference 171 Protocol Description 171 Methods by Task 171 Instance Methods 172 Chapter 24 WebEditingDelegate Protocol Reference 175 Protocol Description 175 Methods by Task 175 Instance Methods 176 Constants 181 Chapter 25 WebFrameLoadDelegate Protocol Reference 183 Protocol Description 183 Methods by Task 183 Instance Methods 184 6 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. CONTENTS Chapter 26 WebJavaPlugIn Protocol Reference 191 Protocol Description 191 Methods by Task 191 Instance Methods 192 Chapter 27 WebOpenPanelResultListener Protocol Reference 193 Protocol Description 193 Methods by Task 193 Instance Methods 194 Chapter 28 WebPlugIn Protocol Reference 195 Protocol Description 195 Methods by Task 195 Instance Methods 196 Chapter 29 WebPlugInContainer Protocol Reference 199 Protocol Description 199 Methods by Task 199 Instance Methods 200 Chapter 30 WebPlugInViewFactory Protocol Reference 203 Protocol Description 203 Methods by Task 203 Class Methods 203 Constants 204 Chapter 31 WebPolicyDecisionListener Protocol Reference 205 Protocol Description 205 Methods by Task 205 Instance Methods 206 Chapter 32 WebPolicyDelegate Protocol Reference 209 Protocol Description 209 Methods by Task 210 Instance Methods 210 Constants 212 7 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. CONTENTS Chapter 33 WebResourceLoadDelegate Protocol Reference 215 Protocol Description 215 Methods by Task 215 Instance Methods 216 Chapter 34 WebScripting Protocol Reference 221 Protocol Description 221 Methods by Task 222 Class Methods 223 Instance Methods 224 Chapter 35 WebUIDelegate Protocol Reference 227 Protocol Description 227 Methods by Task 227 Instance Methods 230 Constants 241 Part III Constants 245 Chapter 36 Web Kit Constants Reference 247 Introduction 247 Constants 247 Document Revision History 253 Index 255 8 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. INTRODUCTION Web Kit Objective-C Reference Framework /System/Library/Frameworks/WebKit.framework Header file directories /System/Library/Frameworks/WebKit.framework/Headers Introduction This document was previously titled Web Kit Reference for Objective-C. The Web Kit provides a set of classes to display web content in windows, and implements browser features such as following links when clicked by the user, managing a back-forward list, and managing a history of pages recently visited. The Web Kit greatly simplifies the complicated process of loading web pages—that is, asynchronously requesting web content from an HTTP server where the response may arrive incrementally, in random order, or partially due to network errors. The Web Kit also simplifies the process of displaying that content which can contain various MIME types, and compound frame elements each with their own set of scroll bars. Introduction 9 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. INTRODUCTION Web Kit Objective-C Reference 10 Introduction 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. PART I Classes 11 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. PART I Classes 12 2006-05-23 | © 2006 Apple Computer, Inc. All Rights Reserved. CHAPTER 1 DOMDocument Web Kit Additions Reference Inherits from: DOMNode : DOMObject : WebScriptObject : NSObject Conforms to: DOMEventTarget (DOMNode) NSCopying (DOMObject) NSObject (NSObject) Framework /System/Library/Frameworks/WebKit.framework Declared in: WebKit/WebDOMOperations.h Availability: Available in Mac OS X v10.3.9 and later. Companion guides: Safari