[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

api[apple,WebKit] methods


WKBackForwardList comment: '
	A WKBackForwardList object is a list of webpages previously visited in a web view that can be reached by going back or forward.
 '!
WKBackForwardList buildTypedGetters:#(
	#( currentItem #WKBackForwardListItem )
	#( backItem #WKBackForwardListItem )
	#( forwardItem #WKBackForwardListItem )
)!
WKBackForwardList buildFunctions:#(
	#( #itemAtIndex: #(offset) #WKBackForwardListItem )
	#backList #forwardList
)!
! WKBackForwardList methodsFor:#accessing !
backItems
	" Returns the collection of items preceding the receiver. "

	^self backList collect: [:each| WKBackForwardListItem @ each ]! !

! WKBackForwardList methodsFor:#accessing !
forwardItems
	" Returns the collection of items following the receiver. "

	^self forwardList collect: [:each| WKBackForwardListItem @ each ]! !

WKBackForwardListItem buildGetters: #(
	#title
)!
WKBackForwardListItem buildTypedGetters: #(
	#( initialURL #NSURL )
)!
! WKBackForwardListItem methodsFor:#accessing !
url
	" Returns the URL of the webpage represented by the receiver. "

	^NSURL @ handle[#URL]! !

WKFrameInfo buildPool: #WKErrorCode with: #(
    1 #WKErrorUnknown
    #WKErrorWebContentProcessTerminated
    #WKErrorWebViewInvalidated
    #WKErrorJavaScriptExceptionOccurred
)!

WKFrameInfo buildTypedGetters: #(
	#(#request #NSURLRequest)
)!

WKFrameInfo buildIsBooleanGetters: #(
	mainFrame
)!

WKNavigationAction buildPool: #WKNavigationType with: #(
    1 #WKNavigationTypeLinkActivated
    #WKNavigationTypeFormSubmitted
    #WKNavigationTypeBackForward
    #WKNavigationTypeReload
    #WKNavigationTypeFormResubmitted
    -1 #WKNavigationTypeOther
)!

WKNavigationAction comment: '
	A WKNavigationAction object contains information about an action that may cause a navigation, used for making policy decisions.
'!

WKNavigationAction buildTypedGetters: #(
	#(sourceFrame #WKFrameInfo)
	#(targetFrame #WKFrameInfo)
	#(#request #NSURLRequest)
)!
WKNavigationAction buildNumberGetters: #(
	navigationType buttonNumber
)!
#iOS = TargetOS ifFalse: [
	WKNavigationAction buildTypedGetters: #(
		#(modifierFlags #NSEventModifierFlags)
	).
	WKNavigationAction buildNumberGetters: #(
		buttonNumber
	).
]!

WKNavigationResponse buildBooleanGetters: #(
	isForMainFrame canShowMIMEType
).
WKNavigationResponse buildTypedGetters: #(
	#(#response #NSURLResponse)
)!

WKPreferences buildNumberAccessors: #(
	minimumFontSize
)!
WKPreferences buildBooleanAccessors: #(
	javaScriptEnabled
	javaScriptCanOpenWindowsAutomatically
)!
#iOS = TargetOS ifFalse: [
	WKPreferences buildBooleanAccessors: #(
		javaEnabled
		plugInsEnabled
	)
]!

WKScriptMessage buildGetters: #(
	body name
)!
WKScriptMessage buildTypedGetters: #(
	#(webView #WKWebView) 
	#(frameInfo #WKFrameInfo)
)!

WKUserScript buildPool: #WKUserScriptInjectionTime with: #(
    #WKUserScriptInjectionTimeAtDocumentStart
    #WKUserScriptInjectionTimeAtDocumentEnd
)!

WKUserScript buildGetters: #(
	source
)!
WKUserScript buildTypedGetters: #(
	#(injectionTime #WKUserScriptInjectionTime)
)!
WKUserScript buildBooleanGetters: #(
	isForMainFrameOnly
)!
! WKUserScript class methodsFor: #instantiation !
withSource: source injectionTime: injectionTime forMainFrameOnly: forMainFrameOnly

	^self @ (self nativeClass
		instanceWithSource: source
		injectionTime: injectionTime handle
		forMainFrameOnly: forMainFrameOnly)! !

WKWebView buildGetters: #(
	title
)!
WKWebView buildBooleanGetters: #(
	isLoading hasOnlySecureContent
	canGoBack canGoForward
)!
WKWebView buildNumberGetters: #(
	estimatedProgress
)!
WKWebView buildTypedGetters: #(
	#(configuration #WKWebViewConfiguration)
	#(backForwardList #WKBackForwardList)
)!
WKWebView buildTypedAccessors: #(
	#(navigationDelegate #NSObject)
	"#(#UIDelegate #NSObject)"
)!
WKWebView buildBooleanAccessors: #(
	allowsBackForwardNavigationGestures
)!
! WKWebView class methodsFor: #instantiation !
withFrame: frame configuration: configuration

	^self @ (self nativeClass
		instanceWithFrame: frame handle
		configuration: configuration handle)! !

WKWebView buildFunctions: #(
	#(#loadRequest: #(#(request handle)) #WKNavigation)
	#(#loadHTMLString:baseURL: #(string #(baseURL handle)) #WKNavigation)
	#(#goToBackForwardListItem: #(#(item handle)) #WKNavigation)
	#(#goBack #() #WKNavigation)
	#(#goForward #() #WKNavigation)
	#(#reload #() #WKNavigation)
	#(#reloadFromOrigin #() #WKNavigation)
	stopLoading
	#(#evaluateJavaScript:completionHandler: #(javaScriptString #(completionHandler handle)))
)!
! WKWebView methodsFor:#accessing !
url
	" Returns the URL of the webpage represented by the receiver. "

	^NSURL @ handle[#URL]! !

#iOS = TargetOS ifTrue: [
	WKWebView buildTypedAccessors: #(
		#(scrollView #UIScrollView)
	)
] ifFalse: [
	WKWebView buildBooleanAccessors: #(
		allowsMagnification
	).
	WKWebView buildNumberAccessors: #(
		magnification
	).
	WKWebView buildFunctions: #(
		#(#setMagnification:centeredAtPoint: #(magnification #(center handle)))
	).
]!

WKUserContentController buildGetters: #(
	userScripts
)!
WKUserContentController buildFunctions: #(
	#(#addUserScript: #(#(script handle)))
	#removeAllUserScripts
	#(#addScriptMessageHandler:name: #(#(scriptMessageHandler handle) name))
	#(#removeScriptMessageHandlerForName: #(name))
)!
! WKUserContentController methodsFor: #accessing !
scripts
	" Return a collection with the user scripts of the receiver. "

	^self userScripts collect: [:each| WKUserScript @ each ]! !

#iOS = TargetOS ifTrue: [
	WKWebViewConfiguration buildPool: #WKSelectionGranularity with: #(
		#WKSelectionGranularityDynamic
		#WKSelectionGranularityCharacter
	).
]!

WKWebViewConfiguration buildTypedAccessors: #(
	#(processPool #WKProcessPool)
	#(preferences #WKPreferences)
	#(userContentController #WKUserContentController)
)!
#iOS = TargetOS ifTrue: [
	WKWebViewConfiguration buildTypedAccessors: #(
		#(selectionGranularity #WKSelectionGranularity)
	).
	WKWebViewConfiguration buildBooleanAccessors: #(
		suppressesIncrementalRendering
		allowsInlineMediaPlayback
		mediaPlaybackRequiresUserAction
		mediaPlaybackAllowsAirPlay
	).
]!

WKWindowFeatures buildBooleanGetters: #(
	menuBarVisibility
	statusBarVisibility
	toolbarsVisibility
	allowsResizing
	x y width height
)!