API 0.9.5
CPWebView Class Reference

#import <CPWebView.h>

Inheritance diagram for CPWebView:

List of all members.

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

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

- (WebBackForwardList) backForwardList

Definition at line 650 of file CPWebView.j.

- (BOOL) canGoBack

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 634 of file CPWebView.j.

- (BOOL) canGoForward

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 645 of file CPWebView.j.

- (void) close

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 660 of file CPWebView.j.

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

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 724 of file CPWebView.j.

- (DOMWindow) DOMWindow

Returns the window object of the webview.

Returns:
DOMWindow - The window object.

Definition at line 670 of file CPWebView.j.

- (id) downloadDelegate

Definition at line 860 of file CPWebView.j.

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

Definition at line 739 of file CPWebView.j.

- (int) effectiveScrollMode

Returns the effective scroll mode of the receiver.

Valied values are: CPWebViewScrollAuto CPWebViewScrollAppKit CPWebViewScrollNative CPWebViewScrollNone

Definition at line 336 of file CPWebView.j.

- (void) encodeWithCoder: (CPCoder aCoder

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

Parameters:
aCoderthe coder to which to write the data

Reimplemented from CPView.

Definition at line 1009 of file CPWebView.j.

- (id) frameLoadDelegate

Definition at line 868 of file CPWebView.j.

- (BOOL) goBack

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 591 of file CPWebView.j.

- (action) goBack: (id)  sender

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

Parameters:
sender- the sender of the action.

Definition at line 798 of file CPWebView.j.

- (BOOL) goForward

Tells the receiver to go forward in page history.

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

Definition at line 612 of file CPWebView.j.

- (action) goForward: (id)  sender

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

Parameters:
sender- the sender of the action.

Definition at line 808 of file CPWebView.j.

- (id) initWithCoder: (CPCoder aCoder

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.

Definition at line 979 of file CPWebView.j.

- (id) initWithFrame: (CPRect)  aFrame

Definition at line 137 of file CPWebView.j.

- (id) initWithFrame: (CPRect)  frameRect
frameName: (CPString frameName
groupName: (CPString groupName 

Definition at line 127 of file CPWebView.j.

- (BOOL) isLoading

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.

- (void) loadHTMLString: (CPString aString

Loads a string of HTML into the receiver.

Parameters:
CPString- The string to load.

Definition at line 417 of file CPWebView.j.

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

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.

- (CPString) mainFrameURL

Returns the URL of the main frame.

Returns:
CPString - The URL of the main frame.

Definition at line 566 of file CPWebView.j.

- (JSObject) objectByEvaluatingJavaScriptFromString: (CPString script

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 712 of file CPWebView.j.

- (id) policyDelegate

Definition at line 876 of file CPWebView.j.

- (action) print: (id)  sender

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 843 of file CPWebView.j.

- (action) reload: (id)  sender

Reloads the webview.

Parameters:
sender- the sender of the action.

Definition at line 828 of file CPWebView.j.

- (id) resourceLoadDelegate

Definition at line 884 of file CPWebView.j.

- (void) setBackgroundColor: (CPColor aColor

Sets the background color of the receiver.

Parameters:
aColorthe new color for the receiver's background

Reimplemented from CPView.

Definition at line 764 of file CPWebView.j.

- (void) setDownloadDelegate: (id)  anObject

Definition at line 864 of file CPWebView.j.

- (void) setDrawsBackground: (BOOL)  drawsBackground

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 755 of file CPWebView.j.

- (void) setFrameLoadDelegate: (id)  anObject

Definition at line 872 of file CPWebView.j.

- (void) setFrameSize: (CPSize)  aSize

Definition at line 222 of file CPWebView.j.

- (void) setMainFrameURL: (CPString URLString

Sets the URL of the main frame.

Parameters:
CPString- the url to set.

Definition at line 576 of file CPWebView.j.

- (void) setPolicyDelegate: (id)  anObject

Definition at line 880 of file CPWebView.j.

- (void) setResourceLoadDelegate: (id)  anObject

Definition at line 888 of file CPWebView.j.

- (void) setScrollMode: (int)  aScrollMode

Sets the scroll mode of the receiver.

Valid values are: CPWebViewScrollAuto CPWebViewScrollAppKit CPWebViewScrollNative CPWebViewScrollNone

CPWebViewScrollAuto

Definition at line 317 of file CPWebView.j.

- (void) setUIDelegate: (id)  anObject

Definition at line 896 of file CPWebView.j.

- (action) stopLoading: (id)  sender

Stops loading the webview. (not yet implemented)

Parameters:
sender- the sender of the action.

Definition at line 818 of file CPWebView.j.

- (CPString) stringByEvaluatingJavaScriptFromString: (CPString script

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 700 of file CPWebView.j.

- (action) takeStringURLFrom: (id)  sender

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 788 of file CPWebView.j.

- (id) UIDelegate

Definition at line 892 of file CPWebView.j.

- (void) viewDidUnhide

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 228 of file CPWebView.j.

- (CPWebScriptObject) windowScriptObject

Returns the root Object of the webview as a CPWebScriptObject.

Returns:
CPWebScriptObject - the Object of the webview.

Definition at line 680 of file CPWebView.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines