WebKitDisplayWebContentWord文档下载推荐.docx

上传人:b****6 文档编号:18590371 上传时间:2022-12-28 格式:DOCX 页数:58 大小:159.78KB
下载 相关 举报
WebKitDisplayWebContentWord文档下载推荐.docx_第1页
第1页 / 共58页
WebKitDisplayWebContentWord文档下载推荐.docx_第2页
第2页 / 共58页
WebKitDisplayWebContentWord文档下载推荐.docx_第3页
第3页 / 共58页
WebKitDisplayWebContentWord文档下载推荐.docx_第4页
第4页 / 共58页
WebKitDisplayWebContentWord文档下载推荐.docx_第5页
第5页 / 共58页
点击查看更多>>
下载资源
资源描述

WebKitDisplayWebContentWord文档下载推荐.docx

《WebKitDisplayWebContentWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《WebKitDisplayWebContentWord文档下载推荐.docx(58页珍藏版)》请在冰豆网上搜索。

WebKitDisplayWebContentWord文档下载推荐.docx

withrespecttoanyofthetechnologydescribed

inthisdocument.Appleretainsallintellectualpropertyrightsassociatedwiththetechnologydescribedinthisdocument.ThisdocumentisintendedtoassistapplicationdeveloperstodevelopapplicationsonlyforApple-labeledcomputers.

1InfiniteLoop

Cupertino,CA95014

408-996-1010

Apple,theApplelogo,Carbon,Cocoa,Mac,MacOS,Objective-C,Pages,QuickTime,Safari,andXcodearetrademarksofAppleInc.,registeredintheUnitedStatesandothercountries.

WebScriptisatrademarkofAppleInc.

JavaisaregisteredtrademarkofOracleand/oritsaffiliates.

EventhoughApplehasreviewedthisdocument,APPLEMAKESNOWARRANTYORREPRESENTATION,EITHEREXPRESSORIMPLIED,WITHRESPECTTOTHISDOCUMENT,ITSQUALITY,ACCURACY,MERCHANTABILITY,ORFITNESSFORAPARTICULARPURPOSE.ASARESULT,THISDOCUMENTISPROVIDED“ASIS,”ANDYOU,THEREADER,AREASSUMINGTHEENTIRERISKASTOITSQUALITYANDACCURACY.

INNOEVENTWILLAPPLEBELIABLEFORDIRECT,INDIRECT,SPECIAL,INCIDENTAL,ORCONSEQUENTIALDAMAGESRESULTINGFROMANYDEFECTORINACCURACYINTHISDOCUMENT,evenifadvisedofthepossibilityofsuchdamages.

THEWARRANTYANDREMEDIESSETFORTHABOVEAREEXCLUSIVEANDINLIEUOFALLOTHERS,ORALORWRITTEN,EXPRESSORIMPLIED.NoAppledealer,agent,oremployeeisauthorizedtomakeanymodification,extension,oradditiontothiswarranty.

Somestatesdonotallowtheexclusionorlimitationofimpliedwarrantiesorliabilityforincidentalorconsequentialdamages,sotheabovelimitationorexclusionmaynotapplytoyou.Thiswarrantygivesyouspecificlegalrights,andyoumayalsohaveotherrightswhichvaryfromstatetostate.

Contents

IntroductiontoWebKitObjective-CProgrammingGuide9

WhatIstheWebKit?

9

WhoShouldReadThisDocument?

OrganizationofThisDocument10

SeeAlso11

WhyUsetheWebKit?

13

CoreWebKitClasses15

FrameModelandViewClasses15

DataModelandViewClasses16

Provisionalvs.CommittedDataSources17

WebViewDelegates18

SimpleBrowsing21

MultipleWindows23

OpeningWindows23

EnteringURLs23

HandlingNewWindowRequests24

LoadingPages27

SequenceofFrameLoadDelegateMessages27

TestingfortheMainFrame28

DisplayingtheCurrentURL28

DisplayingthePageTitle28

DisplayingLoadStatus29

LoadingResources31

SequenceofResourceLoadDelegateMessages31

IdentifyingResources31

TrackingResourceLoadProgress32

PagingBackandForward35

EnablingandDisablingtheBack-ForwardList35

AddingBackandForwardButtons35

3

2009-07-28|©

2003,2009AppleInc.AllRightsReserved.

SettingthePageCache35

SettingtheCapacity36

TheCurrentItem36

ManagingState36

ManagingHistory37

SharingHistoryObjects37

AddingandRemovingHistoryItems37

LoadingaHistoryItem38

SavingandLoadingHistoryObjects38

MakingPolicyDecisions39

EnablingEditing41

SavingandLoadingWebContent43

ModifyingtheCurrentSelection45

ChangingEditingBehavior47

ShouldMethods47

DidMethods47

UsingUndoWhenEditing49

UsingtheDocumentObjectModelfromObjective-C51

InterpretingtheDOMSpecification51

HandlingExceptions53

UsingtheDocumentObjectModelExtensions55

UsingJavaScriptFromObjective-C57

Spoofing59

AccessingtheWebKitFromCarbonApplications61

DeterminingWebKitAvailability63

TestingforURLLoadingSystemAvailability63

4

TestingforWebKitAvailability63

IsolatingYourWebKitandURLLoadingSystemSymbols64

ConditionallyLoadingCode64

WeakLinkingSymbols64

DocumentRevisionHistory67

5

6

FiguresandListings

Figure1WebViewandWebFrameViewobjects16

Figure2WebFrameandWebDataSourceobjects17

Figure3Typicalwebsite18

Listing1DeterminingiftheURLLoadingsystemisavailable.63

Listing2DeterminingiftheWebKitframeworkisavailable63

Listing3LoadingWebKitconstantsdynamicallyusingCFBundle65

7

8

IntroductiontoWebKitObjective-CProgrammingGuide

ConcurrencyNote:

TheWebKitframeworkisnotthreadsafe.Ifyoucallfunctionsormethodsinthisframework,youmustdosoexclusivelyonthemainprogramthread.

TheWebKitprovidesasetofcoreclassestodisplaywebcontentinwindows,andbydefault,implementsfeaturessuchasfollowinglinksclickedbytheuser.TheWebKitgreatlysimplifiesthecomplicatedprocess

ofloadingwebpages—thatis,asynchronouslyrequestingwebcontentfromanHTTPserveroverthenetworkwheretheresponsemayarriveincrementally,inrandomorder,orpartiallyduetonetworkerrors.TheWebKitalsosimplifiestheprocessofdisplayingcontentthatcancontainvariousMIMEtypes,andmultipleframeseachwiththeirownsetofscrollbars.

YouusetheWebKittodisplaywebcontentinawindowofyourapplication.It’sassimpleascreatingaview,placingitinawindow,andsendingaURLloadrequestmessage.Bydefault,yourWebKitapplicationbehavesasyouwouldexpectwithouterror.TheWebKitconvenientlycreatesandmanagesalltheviewsneededtohandledifferentMIMEtypes.Whentheuserclicksonalinkinapage,theWebKitautomaticallycreatestheviewsneededtodisplaythenextpage.

However,theWebKitdoesn’timplementacompletesetofwebbrowserfeatures.Youcan,however,extendtheWebKitbyimplementingcustomdelegate,view,andmodelobjects.Forexample,youcanimplementadelegatetodisplayloadstatus,andthecurrentURL.

TheWebKitalsoofferswebcontentediting.IfyouenableeditinginyourWebView,userscaneditthewebcontentitdisplays.YoucanprogrammaticallycontrolthecurrentselectionandcontroleditingbehaviorusingaWebViewdelegate.YoucanalsomodifytheDocumentObjectModeldirectlyusinganObjective-CAPI.

YoucanalsoaccessJavaScriptfromObjective-Candviceversa.

TheWebKitObjective-CAPIisspecificallydesignedforembeddingwebcontentinyourCocoaorCarbonapplications—developingwebclientapplicationsnotwebserverapplicationsorwebcontent.Itisalsonotsuitableforimplementingnon-GUIapplicationssuchaswebcrawlers.IfyouareawebcontentcreatororJavaScriptprogrammer,refertoWebKitDOMProgrammingTopics.

9

Important:

Currently,thisAPIisavailableinObjective-Conly.AminimalCAPIisprovidedforembeddingwebbrowserviewsinCarbonapplications.YoucanuseObjective-CincombinationwithC.TheWebKitworkswithallversionsofMacOSX10.2thathaveSafari1.0installed.

OrganizationofThisDocument

ThefollowingarticlescoverkeyconceptsinunderstandinghowtheWebKitworks:

●“WhyUsetheWebKit?

”(page13)describesthepurposeoftheWebKitandwhyyoumightwanttouseitinyourapplications.

●“CoreWebKitClasses”(page15)describesthecoreWebKitclassesandtheobject-orienteddesignthatisfundamentaltounderstandinghowtheWebKitworks.

Thefollowingarticlesexplainhowtodisplaywebcontentinviews:

●“SimpleBrowsing”(page21)showshowtoembedwebcontentinyourapplicationbyfollowingafewsimplesteps.

●“MultipleWindows”(page23)showshowtoaddsupportformultiplewindows,andopenwindowsautomatically.

●“LoadingPages”(page27)showshowtotracktheprogressofloadingframecontent.

●“LoadingResources”(page31)showshowtotracktheprogressofloadingindividualresourcesonapage.

●“PagingBackandForward”(page35)showshowtoimplementaback-forwardlistandaddBackand

Forwardbuttonstoyourapplication.

●“ManagingHistory”(page37)showshowtomaintainahistoryofallthevisitedpages,andallowtheusertogotoapreviouslyvisitedpage.

●“Spoofing”(page59)showshowtouseuser-agentstrings.

●“AccessingtheWebKitFromCarbonApplications”(page61)explainshowtoembedwebcontentin

Carbonapplications.

●“DeterminingWebKitAvailability”(page63)explainshowtodetermineiftheWebKitisavailableonyoursystem.

Thefollowingarticlesexplainhowtoimplementwebcontentediting:

●“EnablingEditing”(page41)showshowtoenableusereditinginaWebView.

●“SavingandLoadingWebContent”(page43)showshowtosaveandloadwebcontenteditedbytheuser.

●“ModifyingtheCurrentSelection”(page45)showshowtoprogrammaticallymodifyth

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1