API  1.0.0
CPWebView Class Reference

#import <CPWebView.h>

+ Inheritance diagram for CPWebView:

Instance Methods

(WebBackForwardList) - backForwardList
 
(BOOL) - canGoBack
 
(BOOL) - canGoForward
 
(void) - close
 
(DOMCSSStyleDeclaration) - computedStyleForElement:pseudoElement:
 
(DOMWindow) - DOMWindow
 
(id) - downloadDelegate
 
(BOOL) - drawsBackground
 
(int) - effectiveScrollMode
 
(void) - encodeWithCoder:
 
(id) - frameLoadDelegate
 
(BOOL) - goBack
 
(action) - goBack:
 
(BOOL) - goForward
 
(action) - goForward:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(id) - initWithFrame:frameName:groupName:
 
(BOOL) - isLoading
 
(void) - loadHTMLString:
 
(void) - loadHTMLString:baseURL:
 
(CPString- mainFrameURL
 
(JSObject) - objectByEvaluatingJavaScriptFromString:
 
(id) - policyDelegate
 
(action) - print:
 
(action) - reload:
 
(id) - resourceLoadDelegate
 
(void) - setBackgroundColor:
 
(void) - setDownloadDelegate:
 
(void) - setDrawsBackground:
 
(void) - setFrameLoadDelegate:
 
(void) - setFrameSize:
 
(void) - setMainFrameURL:
 
(void) - setPolicyDelegate:
 
(void) - setResourceLoadDelegate:
 
(void) - setScrollMode:
 
(void) - setUIDelegate:
 
(action) - stopLoading:
 
(CPString- stringByEvaluatingJavaScriptFromString:
 
(action) - takeStringURLFrom:
 
(id) - UIDelegate
 
(void) - viewDidUnhide
 
(CPWebScriptObject- windowScriptObject
 
- Instance Methods inherited from CPView
(BOOL) - acceptsFirstMouse:
 
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(void) - addTrackingArea:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(CAAnimation- animationForKey:
 
(CPDictionary- animations
 
(id) - animator
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(CPView- createEphemeralSubviewNamed:
 
(CPString- debug_description
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPAppearance- effectiveAppearance
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGRect) - frameRectOfView:inSuperviewSize:
 
(CGSize) - frameSize
 
(CGRect) - frameWithNewSuperviewSize:
 
(BOOL) - hasCustomDrawRect
 
(BOOL) - hasCustomLayoutSubviews
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(void) - layout
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - layoutSubviews
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(void) - mouseDown:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(BOOL) - needsPanelToBecomeKey
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(void) - objectDidChangeTheme
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeFromSuperview
 
(void) - removeTrackingArea:
 
(void) - replaceSubview:with:
 
(BOOL) - resignFirstResponder
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAnimations:
 
(void) - setAppearance:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBounds:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setDOMClassName:
 
(void) - setFrame:
 
(void) - setFrameOrigin:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(void) - updateTrackingAreas
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidLayout
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewWillDraw
 
(void) - viewWillLayout
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 

Additional Inherited Members

- Class Methods inherited from CPView
(Class) + animatorClass
 
(CAAnimation+ defaultAnimationForKey:
 
(CPMenu+ defaultMenu
 
(CPString+ defaultThemeClass
 
(void) + initialize
 
(BOOL) + isHighDPIDrawingEnabled
 
(CPSet) + keyPathsForValuesAffectingBounds
 
(CPSet) + keyPathsForValuesAffectingFrame
 
(void) + setHighDPIDrawingEnabled:
 
(CPDictionary+ themeAttributes
 

Detailed Description

CPWebView allows you to display arbitrary HTML or embed a webpage inside your application.

It's important to note that the same origin policy applies to this view. That is, if the web page being displayed is not located in the same origin (protocol, domain, and port) as the application, you will have limited control over the view and no access to its contents. Furthermore, Cappuccino style scrollbars can't be used to scroll it.

Definition at line 2 of file CPWebView.h.

Method Documentation

◆ backForwardList()

- (WebBackForwardList) backForwardList
implementation

Definition at line 655 of file CPWebView.j.

◆ canGoBack()

- (BOOL) canGoBack
implementation

Checks to see if the webview has a history stack you can navigate back through.

Returns
BOOL - YES if the receiver can navigate backward through history, otherwise NO.

Definition at line 639 of file CPWebView.j.

◆ canGoForward()

- (BOOL) canGoForward
implementation

Checks to see if the webview has a history stack you can navigate forward through.

Returns
BOOL - YES if the receiver can navigate forward through history, otherwise NO.

Definition at line 650 of file CPWebView.j.

◆ close()

- (void) close
implementation

Closes the webview by unloading the webpage. The webview will no longer respond to load requests or delegate methods once this is called.

Definition at line 665 of file CPWebView.j.

◆ computedStyleForElement:pseudoElement:()

- (DOMCSSStyleDeclaration) computedStyleForElement: (DOMElement)  element
pseudoElement: (CPString pseudoElement 
implementation

Gets the computed style for an element.

Parameters
DOMElement- An Element.
pseudoElement- A pseudoElement.
Returns
DOMCSSStyleDeclaration - The computed style for an element.

Definition at line 738 of file CPWebView.j.

◆ DOMWindow()

- (DOMWindow) DOMWindow
implementation

Returns the window object of the webview.

Returns
DOMWindow - The window object.

Definition at line 675 of file CPWebView.j.

◆ downloadDelegate()

- (id) downloadDelegate
implementation

Definition at line 876 of file CPWebView.j.

◆ drawsBackground()

- (BOOL) drawsBackground
implementation
Returns
BOOL - YES if the webview draws its own background, otherwise NO.

Definition at line 754 of file CPWebView.j.

◆ effectiveScrollMode()

- (int) effectiveScrollMode
implementation

Returns the effective scroll mode of the receiver.

Valied values are: CPWebViewScrollAuto CPWebViewScrollAppKit CPWebViewScrollNative CPWebViewScrollNone

Definition at line 336 of file CPWebView.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Writes out the web view's instance information to a coder.

Parameters
aCoderthe coder to which to write the data

Reimplemented from CPView.

Provided by category CPWebView(CPCoding).

Definition at line 1041 of file CPWebView.j.

◆ frameLoadDelegate()

- (id) frameLoadDelegate
implementation

Definition at line 886 of file CPWebView.j.

◆ goBack()

- (BOOL) goBack
implementation

Tells the webview to navigate to the previous page.

Returns
BOOL - YES if the receiver was able to go back, otherwise NO.

Definition at line 592 of file CPWebView.j.

◆ goBack:()

- (action) goBack: (id)  sender
implementation

Same as -goBack but takes a sender as a param.

Parameters
sender- the sender of the action.

Definition at line 814 of file CPWebView.j.

◆ goForward()

- (BOOL) goForward
implementation

Tells the receiver to go forward in page history.

Returns
- YES if the receiver was able to go forward, otherwise NO.

Definition at line 615 of file CPWebView.j.

◆ goForward:()

- (action) goForward: (id)  sender
implementation

Same as -goForward but takes a sender as a param.

Parameters
sender- the sender of the action.

Definition at line 824 of file CPWebView.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the web view from the data in a coder.

Parameters
aCoderthe coder from which to read the data
Returns
the initialized web view

Reimplemented from CPView.

Provided by category CPWebView(CPCoding).

Definition at line 1011 of file CPWebView.j.

◆ initWithFrame:()

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPView.

Definition at line 138 of file CPWebView.j.

◆ initWithFrame:frameName:groupName:()

- (id) initWithFrame: (CGRect)  frameRect
frameName: (CPString frameName
groupName: (CPString groupName 
implementation

Definition at line 128 of file CPWebView.j.

◆ isLoading()

- (BOOL) isLoading
implementation

Returns whether the web view is loading. Note: due to browser limitations this value is not particularly reliable.

Definition at line 556 of file CPWebView.j.

◆ loadHTMLString:()

- (void) loadHTMLString: (CPString aString
implementation

Loads a string of HTML into the receiver.

Parameters
CPString- The string to load.

Definition at line 417 of file CPWebView.j.

◆ loadHTMLString:baseURL:()

- (void) loadHTMLString: (CPString aString
baseURL: (CPURL URL 
implementation

Loads a string of HTML into the receiver.

Parameters
CPString- The string to load.
CPURL- The base url of the string. (not implemented)

Definition at line 428 of file CPWebView.j.

◆ mainFrameURL()

- (CPString) mainFrameURL
implementation

Returns the URL of the main frame.

Returns
CPString - The URL of the main frame.

Definition at line 566 of file CPWebView.j.

◆ objectByEvaluatingJavaScriptFromString:()

- (JSObject) objectByEvaluatingJavaScriptFromString: (CPString script
implementation

Evaluates a string of javascript in the webview and returns the result.

Parameters
script- A string of javascript.
Returns
JSObject - A JSObject resulting from the evaluation.

Definition at line 726 of file CPWebView.j.

◆ policyDelegate()

- (id) policyDelegate
implementation

Definition at line 896 of file CPWebView.j.

◆ print:()

- (action) print: (id)  sender
implementation

Tells the webview to print. If the webview is unable to print due to browser restrictions the user is alerted to print from the file menu.

Parameters
sender- the sender of the receiver.

Definition at line 859 of file CPWebView.j.

◆ reload:()

- (action) reload: (id)  sender
implementation

Reloads the webview.

Parameters
sender- the sender of the action.

Definition at line 844 of file CPWebView.j.

◆ resourceLoadDelegate()

- (id) resourceLoadDelegate
implementation

Definition at line 906 of file CPWebView.j.

◆ setBackgroundColor:()

- (void) setBackgroundColor: (CPColor aColor
implementation

Sets the background color of the receiver.

Parameters
aColorthe new color for the receiver's background

Reimplemented from CPView.

Definition at line 780 of file CPWebView.j.

◆ setDownloadDelegate:()

- (void) setDownloadDelegate: (id)  anObject
implementation

Definition at line 881 of file CPWebView.j.

◆ setDrawsBackground:()

- (void) setDrawsBackground: (BOOL)  drawsBackground
implementation

Sets whether the webview draws its own background when the displayed contents do not.

If you are trying to create a transparent iframe:

A) call this method with NO A) call setBackground:[CPColor transparent] B) ensure the content does not draw a background, e.g. it has <body style="background-color: transparent;">

Parameters
BOOL- YES if the webview should draw its background, otherwise NO.

Definition at line 770 of file CPWebView.j.

◆ setFrameLoadDelegate:()

- (void) setFrameLoadDelegate: (id)  anObject
implementation

Definition at line 891 of file CPWebView.j.

◆ setFrameSize:()

- (void) setFrameSize: (CGSize)  aSize
implementation

Sets the receiver's frame size. If aSize is the same as the frame's current dimensions, this method simply returns. The method posts a CPViewFrameDidChangeNotification to the default notification center if the receiver is configured to do so.

Parameters
aSizethe new size for the frame

Reimplemented from CPView.

Definition at line 223 of file CPWebView.j.

◆ setMainFrameURL:()

- (void) setMainFrameURL: (CPString URLString
implementation

Sets the URL of the main frame.

Parameters
CPString- the url to set.

Definition at line 576 of file CPWebView.j.

◆ setPolicyDelegate:()

- (void) setPolicyDelegate: (id)  anObject
implementation

Definition at line 901 of file CPWebView.j.

◆ setResourceLoadDelegate:()

- (void) setResourceLoadDelegate: (id)  anObject
implementation

Definition at line 911 of file CPWebView.j.

◆ setScrollMode:()

- (void) setScrollMode: (int)  aScrollMode
implementation

Sets the scroll mode of the receiver.

Valid values are: CPWebViewScrollAuto CPWebViewScrollAppKit CPWebViewScrollNative CPWebViewScrollNone

CPWebViewScrollAuto

Definition at line 317 of file CPWebView.j.

◆ setUIDelegate:()

- (void) setUIDelegate: (id)  anObject
implementation

Definition at line 921 of file CPWebView.j.

◆ stopLoading:()

- (action) stopLoading: (id)  sender
implementation

Stops loading the webview. (not yet implemented)

Parameters
sender- the sender of the action.

Definition at line 834 of file CPWebView.j.

◆ stringByEvaluatingJavaScriptFromString:()

- (CPString) stringByEvaluatingJavaScriptFromString: (CPString script
implementation

Evaluates a javascript string in the webview and returns the result of that evaluation as a string.

Parameters
script- A string of javascript.
Returns
CPString - The result of the evaluation.

Definition at line 714 of file CPWebView.j.

◆ takeStringURLFrom:()

- (action) takeStringURLFrom: (id)  sender
implementation

Used with the target/action mechanism to automatically set the webviews mainFrameURL to the senders stringValue.

Parameters
sender- the sender of the action. Should respond to -stringValue.

Definition at line 804 of file CPWebView.j.

◆ UIDelegate()

- (id) UIDelegate
implementation

Definition at line 916 of file CPWebView.j.

◆ viewDidUnhide()

- (void) viewDidUnhide
implementation

Called when the return value of isHiddenOrHasHiddenAncestor becomes NO, e.g. when this view stops being hidden due to a setHidden:NO message to itself or to one of its superviews.

Note: in the current implementation, viewDidUnhide may be called multiple times if additional superviews are unhidden, even if isHiddenOrHasHiddenAncestor was already NO.

Reimplemented from CPView.

Definition at line 229 of file CPWebView.j.

◆ windowScriptObject()

- (CPWebScriptObject) windowScriptObject
implementation

Returns the root Object of the webview as a CPWebScriptObject.

Returns
CPWebScriptObject - the Object of the webview.

Definition at line 692 of file CPWebView.j.


The documentation for this class was generated from the following files: