Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
WebBrowserChrome Class Reference

#include <WebBrowserChrome.h>

Inheritance diagram for WebBrowserChrome:
Inheritance graph
[legend]
Collaboration diagram for WebBrowserChrome:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WebBrowserChrome ()
virtual ~WebBrowserChrome ()
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBBROWSERCHROME
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSIEMBEDDINGSITEWINDOW
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSISHISTORYLISTENER
NS_DECL_NSIOBSERVER
NS_DECL_NSICONTEXTMENULISTENER
NS_DECL_NSITOOLTIPLISTENER
nsresult 
CreateBrowser (PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, nsIWebBrowser **aBrowser)
void SetParent (nsIWebBrowserChrome *aParent)
 WebBrowserChrome ()
virtual ~WebBrowserChrome ()
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBBROWSERCHROME
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSIEMBEDDINGSITEWINDOW
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSISHISTORYLISTENER
NS_DECL_NSIOBSERVER
NS_DECL_NSICONTEXTMENULISTENER
NS_DECL_NSITOOLTIPLISTENER
nsresult 
CreateBrowser (PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, nsIWebBrowser **aBrowser)
void SetParent (nsIWebBrowserChrome *aParent)
 WebBrowserChrome ()
virtual ~WebBrowserChrome ()
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBBROWSERCHROME
NS_DECL_NSIEMBEDDINGSITEWINDOW
nsresult 
CreateBrowser (HWND hWnd, PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, nsIWebBrowser **aBrowser)
void setStatus (in unsigned long statusType, in wstring status)
 Called when the status text in the chrome needs to be updated.
void destroyBrowserWindow ()
 Asks the implementer to destroy the window associated with this WebBrowser object.
void sizeBrowserTo (in long aCX, in long aCY)
 Tells the chrome to size itself such that the browser will be the specified size.
void showAsModal ()
 Shows the window as a modal window.
boolean isWindowModal ()
 Is the window modal (that is, currently executing a modal loop)?
void exitModalEventLoop (in nsresult aStatus)
 Exit a modal event loop if we're in one.
void setDimensions (in unsigned long flags, in long x, in long y, in long cx, in long cy)
 Sets the dimensions for the window; the position & size.
void getDimensions (in unsigned long flags, out long x, out long y, out long cx, out long cy)
 Gets the dimensions of the window.
void setFocus ()
 Give the window focus.
void focusNextElement ()
 Set the focus at the next focusable element in the chrome.
void focusPrevElement ()
 Set the focus at the previous focusable element in the chrome.
void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus)
 Notification indicating the state has changed for one of the requests associated with aWebProgress.
void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress)
 Notification that the progress has changed for one of the requests associated with aWebProgress.
void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation)
 Called when the location of the window being watched changes.
void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage)
 Notification that the status of a request has changed.
void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState)
 Notification called for security progress.
void getInterface (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 Retrieves the specified interface pointer.
void OnHistoryNewEntry (in nsIURI aNewURI)
 called to notify a listener when a new document is added to session history.
boolean OnHistoryGoBack (in nsIURI aBackURI)
 called to notify a listener when the user presses the 'back' button of the browser OR when the user attempts to go back one page in history thro' other means, from javascript or using nsIWebNavigation
boolean OnHistoryGoForward (in nsIURI aForwardURI)
 called to notify a listener when the user presses the 'forward' button of the browser OR when the user attempts to go forward one page in history thro' other means, from javascript or using nsIWebNavigation
boolean OnHistoryReload (in nsIURI aReloadURI, in unsigned long aReloadFlags)
 called to notify a listener when the user presses the 'reload' button of the browser OR when the user attempts to reload the current document through other means, like from javascript or using nsIWebNavigation
boolean OnHistoryGotoIndex (in long aIndex, in nsIURI aGotoURI)
 called to notify a listener when the user visits a page using the 'Go' menu of the browser OR when the user attempts to go to a page at a particular index through other means, like from javascript or using nsIWebNavigation
boolean OnHistoryPurge (in long aNumEntries)
 called to notify a listener when documents are removed from session history.
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.
void onShowContextMenu (in unsigned long aContextFlags, in nsIDOMEvent aEvent, in nsIDOMNode aNode)
 Called when the browser receives a context menu event (e.g.
void onShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText)
 Called when a tooltip should be displayed.
void onHideTooltip ()
 Called when the tooltip should be hidden, either because the pointer has moved or the tooltip has timed out.

Public Attributes

const unsigned long STATUS_SCRIPT = 0x00000001
const unsigned long STATUS_SCRIPT_DEFAULT = 0x00000002
const unsigned long STATUS_LINK = 0x00000003
attribute nsIWebBrowser webBrowser
 The currently loaded WebBrowser.
const unsigned long CHROME_DEFAULT = 0x00000001
 Definitions for the chrome flags.
const unsigned long CHROME_WINDOW_BORDERS = 0x00000002
const unsigned long CHROME_WINDOW_CLOSE = 0x00000004
const unsigned long CHROME_WINDOW_RESIZE = 0x00000008
const unsigned long CHROME_MENUBAR = 0x00000010
const unsigned long CHROME_TOOLBAR = 0x00000020
const unsigned long CHROME_LOCATIONBAR = 0x00000040
const unsigned long CHROME_STATUSBAR = 0x00000080
const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100
const unsigned long CHROME_SCROLLBARS = 0x00000200
const unsigned long CHROME_TITLEBAR = 0x00000400
const unsigned long CHROME_EXTRA = 0x00000800
const unsigned long CHROME_WITH_SIZE = 0x00001000
const unsigned long CHROME_WITH_POSITION = 0x00002000
const unsigned long CHROME_WINDOW_MIN = 0x00004000
const unsigned long CHROME_WINDOW_POPUP = 0x00008000
const unsigned long CHROME_WINDOW_RAISED = 0x02000000
const unsigned long CHROME_WINDOW_LOWERED = 0x04000000
const unsigned long CHROME_CENTER_SCREEN = 0x08000000
const unsigned long CHROME_DEPENDENT = 0x10000000
const unsigned long CHROME_MODAL = 0x20000000
const unsigned long CHROME_OPENAS_DIALOG = 0x40000000
const unsigned long CHROME_OPENAS_CHROME = 0x80000000
const unsigned long CHROME_ALL = 0x00000ffe
attribute unsigned long chromeFlags
 The chrome flags for this browser chrome.
const unsigned long DIM_FLAGS_POSITION = 1
 Flag indicates that position of the top left corner of the outer area is required/specified.
const unsigned long DIM_FLAGS_SIZE_INNER = 2
 Flag indicates that the size of the inner area is required/specified.
const unsigned long DIM_FLAGS_SIZE_OUTER = 4
 Flag indicates that the size of the outer area is required/specified.
attribute boolean visibility
 Visibility of the window.
attribute wstring title
 Title of the window.
readonly attribute voidPtr siteWindow
 Native window for the site's window.
const unsigned long STATE_START = 0x00000001
 State Transition Flags.
const unsigned long STATE_REDIRECTING = 0x00000002
const unsigned long STATE_TRANSFERRING = 0x00000004
const unsigned long STATE_NEGOTIATING = 0x00000008
const unsigned long STATE_STOP = 0x00000010
const unsigned long STATE_IS_REQUEST = 0x00010000
 State Type Flags.
const unsigned long STATE_IS_DOCUMENT = 0x00020000
const unsigned long STATE_IS_NETWORK = 0x00040000
const unsigned long STATE_IS_WINDOW = 0x00080000
const unsigned long STATE_RESTORING = 0x01000000
 State Modifier Flags.
const unsigned long STATE_IS_INSECURE = 0x00000004
 State Security Flags.
const unsigned long STATE_IS_BROKEN = 0x00000001
const unsigned long STATE_IS_SECURE = 0x00000002
const unsigned long STATE_SECURE_HIGH = 0x00040000
 Security Strength Flags.
const unsigned long STATE_SECURE_MED = 0x00010000
const unsigned long STATE_SECURE_LOW = 0x00020000
const unsigned long CONTEXT_NONE = 0
 Flag.
const unsigned long CONTEXT_LINK = 1
 Flag.
const unsigned long CONTEXT_IMAGE = 2
 Flag.
const unsigned long CONTEXT_DOCUMENT = 4
 Flag.
const unsigned long CONTEXT_TEXT = 8
 Flag.
const unsigned long CONTEXT_INPUT = 16
 Flag.

Protected Member Functions

nsresult SendHistoryStatusMessage (nsIURI *aURI, char *operation, PRInt32 info1=0, PRUint32 info2=0)
void ContentFinishedLoading ()
nsresult SendHistoryStatusMessage (nsIURI *aURI, char *operation, PRInt32 info1=0, PRUint32 info2=0)
void ContentFinishedLoading ()

Protected Attributes

nativeWindow mNativeWindow
PRUint32 mChromeFlags
PRBool mContinueModalLoop
PRBool mSizeSet
nsCOMPtr< nsIWebBrowsermWebBrowser
nsCOMPtr< nsIWebBrowserChromemDependentParent

Detailed Description

Definition at line 74 of file WebBrowserChrome.h.


Constructor & Destructor Documentation

Definition at line 56 of file WebBrowserChrome.cpp.

Definition at line 62 of file WebBrowserChrome.cpp.

Here is the call graph for this function:

virtual WebBrowserChrome::~WebBrowserChrome ( ) [virtual]
virtual WebBrowserChrome::~WebBrowserChrome ( ) [virtual]

Member Function Documentation

Definition at line 443 of file WebBrowserChrome.cpp.

{
  // if it was a chrome window and no one has already specified a size,
  // size to content
  if (mWebBrowser && !mSizeSet &&
     (mChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)) {
    nsCOMPtr<nsIDOMWindow> contentWin;
    mWebBrowser->GetContentDOMWindow(getter_AddRefs(contentWin));
    if (contentWin)
        contentWin->SizeToContent();
    WebBrowserChromeUI::ShowWindow(this, PR_TRUE);
  }
}

Here is the call graph for this function:

nsresult WebBrowserChrome::CreateBrowser ( HWND  hWnd,
PRInt32  aX,
PRInt32  aY,
PRInt32  aCX,
PRInt32  aCY,
nsIWebBrowser **  aBrowser 
)

Definition at line 272 of file DotNETEmbed.cpp.

{
  NS_ENSURE_ARG_POINTER(aBrowser);
  *aBrowser = nsnull;

  mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);

  if (!mWebBrowser)
    return NS_ERROR_FAILURE;

  mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, this));

  nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser);
  dsti->SetItemType(nsIDocShellTreeItem::typeContentWrapper);

  nsCOMPtr<nsIBaseWindow> browserBaseWindow = do_QueryInterface(mWebBrowser);

  mNativeWindow = hWnd;

  if (!mNativeWindow)
    return NS_ERROR_FAILURE;

  browserBaseWindow->InitWindow(mNativeWindow, nsnull, aX, aY, aCX, aCY);
  browserBaseWindow->Create();

  if (mWebBrowser)
  {
    *aBrowser = mWebBrowser;
    NS_ADDREF(*aBrowser);
    return NS_OK;
  }

  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

NS_DECL_ISUPPORTS NS_DECL_NSIWEBBROWSERCHROME NS_DECL_NSIWEBBROWSERCHROMEFOCUS NS_DECL_NSIWEBPROGRESSLISTENER NS_DECL_NSIEMBEDDINGSITEWINDOW NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSISHISTORYLISTENER NS_DECL_NSIOBSERVER NS_DECL_NSICONTEXTMENULISTENER NS_DECL_NSITOOLTIPLISTENER nsresult WebBrowserChrome::CreateBrowser ( PRInt32  aX,
PRInt32  aY,
PRInt32  aCX,
PRInt32  aCY,
nsIWebBrowser **  aBrowser 
)
nsresult WebBrowserChrome::CreateBrowser ( PRInt32  aX,
PRInt32  aY,
PRInt32  aCX,
PRInt32  aCY,
nsIWebBrowser **  aBrowser 
)

Definition at line 67 of file WebBrowserChrome.cpp.

{
    NS_ENSURE_ARG_POINTER(aBrowser);
    *aBrowser = nsnull;

    mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);
    
    if (!mWebBrowser)
        return NS_ERROR_FAILURE;

    (void)mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, this));

    nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser);
    dsti->SetItemType(nsIDocShellTreeItem::typeContentWrapper);

    nsCOMPtr<nsIBaseWindow> browserBaseWindow = do_QueryInterface(mWebBrowser);

    mNativeWindow = WebBrowserChromeUI::CreateNativeWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, this));

    if (!mNativeWindow)
        return NS_ERROR_FAILURE;

    browserBaseWindow->InitWindow( mNativeWindow,
                             nsnull, 
                             aX, aY, aCX, aCY);
    browserBaseWindow->Create();

    nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
    nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
    (void)mWebBrowser->AddWebBrowserListener(thisListener, 
        NS_GET_IID(nsIWebProgressListener));

    // The window has been created. Now register for history notifications
    mWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsISHistoryListener));

    if (mWebBrowser)
    {
      *aBrowser = mWebBrowser;
      NS_ADDREF(*aBrowser);
      return NS_OK;
    }
    return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Asks the implementer to destroy the window associated with this WebBrowser object.

Exit a modal event loop if we're in one.

The implementation should also exit out of the loop if the window is destroyed.

Parameters:
aStatus- the result code to return from showAsModal

Set the focus at the next focusable element in the chrome.

Set the focus at the previous focusable element in the chrome.

void nsIEmbeddingSiteWindow::getDimensions ( in unsigned long  flags,
out long  x,
out long  y,
out long  cx,
out long  cy 
) [inherited]

Gets the dimensions of the window.

The caller may pass nsnull for any value it is uninterested in receiving.

Parameters:
flagsCombination of position, inner and outer size flag .
xLeft hand corner of the outer area; or nsnull.
yTop corner of the outer area; or nsnull.
cxWidth of the inner or outer area; or nsnull.
cyHeight of the inner or outer area; or nsnull.
See also:
setDimensions
DIM_FLAGS_POSITION
DIM_FLAGS_SIZE_OUTER
DIM_FLAGS_SIZE_INNER
void nsIInterfaceRequestor::getInterface ( in nsIIDRef  uuid,
[iid_is(uuid), retval] out nsQIResult  result 
) [inherited]

Retrieves the specified interface pointer.

Parameters:
uuidThe IID of the interface being requested.
result[out] The interface pointer to be filled in if the interface is accessible.
Returns:
NS_OK - interface was successfully returned. NS_NOINTERFACE - interface not accessible. NS_ERROR* - method failure.

Is the window modal (that is, currently executing a modal loop)?

Returns:
true if it's a modal window
void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.

Called when the tooltip should be hidden, either because the pointer has moved or the tooltip has timed out.

called to notify a listener when the user presses the 'back' button of the browser OR when the user attempts to go back one page in history thro' other means, from javascript or using nsIWebNavigation

Parameters:
aBackURIThe uri of the previous page which is to be loaded.
Returns:
aReturn A boolean flag returned by the listener to indicate if the back operation is to be aborted or continued. If the listener returns 'true', it indicates that the back operation can be continued. If the listener returns 'false', then the back operation will be aborted. This is a mechanism for the listener to control user's operations with history.

called to notify a listener when the user presses the 'forward' button of the browser OR when the user attempts to go forward one page in history thro' other means, from javascript or using nsIWebNavigation

Parameters:
aForwardURIThe uri of the next page which is to be loaded.
Returns:
aReturn A boolean flag returned by the listener to indicate if the forward operation is to be aborted or continued. If the listener returns 'true', it indicates that the forward operation can be continued. If the listener returns 'false', then the forward operation will be aborted. This is a mechanism for the listener to control user's operations with history.
boolean nsISHistoryListener::OnHistoryGotoIndex ( in long  aIndex,
in nsIURI  aGotoURI 
) [inherited]

called to notify a listener when the user visits a page using the 'Go' menu of the browser OR when the user attempts to go to a page at a particular index through other means, like from javascript or using nsIWebNavigation

Parameters:
aIndexThe index in history of the document to be loaded.
aGotoURIThe uri of the document to be loaded.
Returns:
aReturn A boolean flag returned by the listener to indicate if the GotoIndex operation is to be aborted or continued. If the listener returns 'true', it indicates that the GotoIndex operation can be continued. If the listener returns 'false', then the GotoIndex operation will be aborted. This is a mechanism for the listener to control user's operations with history.

called to notify a listener when a new document is added to session history.

New documents are added to session history by docshell when new pages are loaded in a frame or content area.

Parameters:
aNewURIThe uri of the document to be added to session history
Returns:
NS_OK notification sent out successfully
boolean nsISHistoryListener::OnHistoryPurge ( in long  aNumEntries) [inherited]

called to notify a listener when documents are removed from session history.

Documents can be removed from session history for various reasons. For example to control the memory usage of the browser, to prevent users from loading documents from history, to erase evidence of prior page loads etc... To purge documents from session history call nsISHistory::PurgeHistory()

Parameters:
aNumEntriesThe number of documents to be removed from session history.
Returns:
aReturn A boolean flag returned by the listener to indicate if the purge operation is to be aborted or continued. If the listener returns 'true', it indicates that the purge operation can be continued. If the listener returns 'false', then the purge operation will be aborted. This is a mechanism for the listener to control user's operations with history.
Note:
While purging history, the older documents are removed and newly loaded documents are kept. For example if there are 5 documents in history, and nsISHistory::PurgeHistory(3) is called, then, document 1, 2 and 3 are removed from history and most recently loaded document 4 and 5 are kept.
boolean nsISHistoryListener::OnHistoryReload ( in nsIURI  aReloadURI,
in unsigned long  aReloadFlags 
) [inherited]

called to notify a listener when the user presses the 'reload' button of the browser OR when the user attempts to reload the current document through other means, like from javascript or using nsIWebNavigation

Parameters:
aReloadURIThe uri of the current document to be reloaded.
aReloadFlagsFlags that indicate how the document is to be refreshed. For example, from cache or bypassing cache and/or Proxy server.
Returns:
aReturn A boolean flag returned by the listener to indicate if the reload operation is to be aborted or continued. If the listener returns 'true', it indicates that the reload operation can be continued. If the listener returns 'false', then the reload operation will be aborted. This is a mechanism for the listener to control user's operations with history.
See also:
nsIWebNavigation
void nsIWebProgressListener::onLocationChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in nsIURI  aLocation 
) [inherited]

Called when the location of the window being watched changes.

This is not when a load is requested, but rather once it is verified that the load is going to occur in the given window. For instance, a load that starts in a window might send progress and status messages for the new site, but it will not send the onLocationChange until we are sure that we are loading this new page here.

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe associated nsIRequest. This may be null in some cases.
aLocationThe URI of the location that is being loaded.
void nsIWebProgressListener::onProgressChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in long  aCurSelfProgress,
in long  aMaxSelfProgress,
in long  aCurTotalProgress,
in long  aMaxTotalProgress 
) [inherited]

Notification that the progress has changed for one of the requests associated with aWebProgress.

Progress totals are reset to zero when all requests in aWebProgress complete (corresponding to onStateChange being called with aStateFlags including the STATE_STOP and STATE_IS_WINDOW flags).

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe nsIRequest that has new progress.
aCurSelfProgressThe current progress for aRequest.
aMaxSelfProgressThe maximum progress for aRequest.
aCurTotalProgressThe current progress for all requests associated with aWebProgress.
aMaxTotalProgressThe total progress for all requests associated with aWebProgress.

NOTE: If any progress value is unknown, or if its value would exceed the maximum value of type long, then its value is replaced with -1.

NOTE: If the object also implements nsIWebProgressListener2 and the caller knows about that interface, this function will not be called. Instead, nsIWebProgressListener2::onProgressChange64 will be called.

void nsIWebProgressListener::onSecurityChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in unsigned long  aState 
) [inherited]

Notification called for security progress.

This method will be called on security transitions (eg HTTP -> HTTPS, HTTPS -> HTTP, FOO -> HTTPS) and after document load completion. It might also be called if an error occurs during network loading.

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe nsIRequest that has new security state.
aStateA value composed of the Security State Flags and the Security Strength Flags listed above. Any undefined bits are reserved for future use.

NOTE: These notifications will only occur if a security package is installed.

void nsIContextMenuListener::onShowContextMenu ( in unsigned long  aContextFlags,
in nsIDOMEvent  aEvent,
in nsIDOMNode  aNode 
) [inherited]

Called when the browser receives a context menu event (e.g.

user is right-mouse clicking somewhere on the document). The combination of flags, event and node provided in the call indicate where and what was clicked on.

The following table describes what context flags and node combinations are possible.

aContextFlagaNode
CONTEXT_LINK<A>
CONTEXT_IMAGE<IMG>
CONTEXT_IMAGE | CONTEXT_LINK<IMG> with an <A> as an ancestor
CONTEXT_INPUT<INPUT>
CONTEXT_TEXT<TEXTAREA>
CONTEXT_DOCUMENT<HTML>
Parameters:
aContextFlagsFlags indicating the kind of context.
aEventThe DOM context menu event.
aNodeThe DOM node most relevant to the context.
Returns:
NS_OK always.
void nsITooltipListener::onShowTooltip ( in long  aXCoords,
in long  aYCoords,
in wstring  aTipText 
) [inherited]

Called when a tooltip should be displayed.

Parameters:
aXCoordsThe tooltip left edge X coordinate.
aYCoordsThe tooltip top edge Y coordinate.
aTipTextThe text to display in the tooltip, typically obtained from the TITLE attribute of the node (or containing parent) over which the pointer has been positioned.
Note:
Coordinates are specified in pixels, relative to the top-left corner of the browser area.
Returns:
NS_OK if the tooltip was displayed.
void nsIWebProgressListener::onStateChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in unsigned long  aStateFlags,
in nsresult  aStatus 
) [inherited]

Notification indicating the state has changed for one of the requests associated with aWebProgress.

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification
aRequestThe nsIRequest that has changed state.
aStateFlagsFlags indicating the new state. This value is a combination of one of the State Transition Flags and one or more of the State Type Flags defined above. Any undefined bits are reserved for future use.
aStatusError status code associated with the state change. This parameter should be ignored unless aStateFlags includes the STATE_STOP bit. The status code indicates success or failure of the request associated with the state change. NOTE: aStatus may be a success code even for server generated errors, such as the HTTP 404 error. In such cases, the request itself should be queried for extended error information (e.g., for HTTP requests see nsIHttpChannel).
void nsIWebProgressListener::onStatusChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in nsresult  aStatus,
in wstring  aMessage 
) [inherited]

Notification that the status of a request has changed.

The status message is intended to be displayed to the user (e.g., in the status bar of the browser).

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe nsIRequest that has new status.
aStatusThis value is not an error code. Instead, it is a numeric value that indicates the current status of the request. This interface does not define the set of possible status codes. NOTE: Some status values are defined by nsITransport and nsISocketTransport.
aMessageLocalized text corresponding to aStatus.
nsresult WebBrowserChrome::SendHistoryStatusMessage ( nsIURI aURI,
char *  operation,
PRInt32  info1 = 0,
PRUint32  info2 = 0 
) [protected]
nsresult WebBrowserChrome::SendHistoryStatusMessage ( nsIURI aURI,
char *  operation,
PRInt32  info1 = 0,
PRUint32  info2 = 0 
) [protected]

Definition at line 373 of file WebBrowserChrome.cpp.

{
    nsCAutoString uriCStr;
    if (aURI)
    {
        aURI->GetSpec(uriCStr);
    }

    nsString uriAStr;

    if(!(nsCRT::strcmp(operation, "back")))
    {
        // Going back. XXX Get string from a resource file
        uriAStr.AppendLiteral("Going back to url:");
        AppendUTF8toUTF16(uriCStr, uriAStr);
    }
    else if (!(nsCRT::strcmp(operation, "forward")))
    {
        // Going forward. XXX Get string from a resource file
        uriAStr.AppendLiteral("Going forward to url:");
        AppendUTF8toUTF16(uriCStr, uriAStr);
    }
    else if (!(nsCRT::strcmp(operation, "reload")))
    {
        // Reloading. XXX Get string from a resource file
        if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY && 
            aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
        {
            uriAStr.Append(NS_LITERAL_STRING("Reloading url,(bypassing proxy and cache) :"));
        }
        else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY)
        {
            uriAStr.Append(NS_LITERAL_STRING("Reloading url, (bypassing proxy):"));
        }
        else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
        {
            uriAStr.Append(NS_LITERAL_STRING("Reloading url, (bypassing cache):"));
        }
        else
        {
            uriAStr.Append(NS_LITERAL_STRING("Reloading url, (normal):"));
        }
        AppendUTF8toUTF16(uriCStr, uriAStr);
    }
    else if (!(nsCRT::strcmp(operation, "add")))
    {
        // Adding new entry. XXX Get string from a resource file
        AppendUTF8toUTF16(uriCStr, uriAStr);
        uriAStr.AppendLiteral(" added to session History");
    }
    else if (!(nsCRT::strcmp(operation, "goto")))
    {
        // Goto. XXX Get string from a resource file
        uriAStr.AppendLiteral("Going to HistoryIndex:");
        uriAStr.AppendInt(info1);
        uriAStr.AppendLiteral(" Url:");
        AppendUTF8toUTF16(uriCStr, uriAStr);
    }
    else if (!(nsCRT::strcmp(operation, "purge")))
    {
        // Purging old entries
        uriAStr.AppendInt(info1);
        uriAStr.AppendLiteral(" purged from Session History");
    }

    WebBrowserChromeUI::UpdateStatusBarText(this, uriAStr.get());

    return NS_OK;
}

Here is the call graph for this function:

void nsIEmbeddingSiteWindow::setDimensions ( in unsigned long  flags,
in long  x,
in long  y,
in long  cx,
in long  cy 
) [inherited]

Sets the dimensions for the window; the position & size.

The flags to indicate what the caller wants to set and whether the size refers to the inner or outer area. The inner area refers to just the embedded area, wheras the outer area can also include any surrounding chrome, window frame, title bar, and so on.

Parameters:
flagsCombination of position, inner and outer size flags.
xLeft hand corner of the outer area.
yTop corner of the outer area.
cxWidth of the inner or outer area.
cyHeight of the inner or outer area.
Returns:
NS_OK if operation was performed correctly; NS_ERROR_UNEXPECTED if window could not be destroyed; NS_ERROR_INVALID_ARG for bad flag combination or illegal dimensions.
See also:
getDimensions
DIM_FLAGS_POSITION
DIM_FLAGS_SIZE_OUTER
DIM_FLAGS_SIZE_INNER

Give the window focus.

Definition at line 100 of file WebBrowserChrome.h.

               { mDependentParent = aParent; }

Definition at line 104 of file WebBrowserChrome.h.

               { mDependentParent = aParent; }

Here is the caller graph for this function:

void nsIWebBrowserChrome::setStatus ( in unsigned long  statusType,
in wstring  status 
) [inherited]

Called when the status text in the chrome needs to be updated.

Parameters:
statusTypeindicates what is setting the text
statusstatus string. null is an acceptable value meaning no status.

Shows the window as a modal window.

Returns:
(the function error code) the status value specified by in exitModalEventLoop.
void nsIWebBrowserChrome::sizeBrowserTo ( in long  aCX,
in long  aCY 
) [inherited]

Tells the chrome to size itself such that the browser will be the specified size.

Parameters:
aCXnew width of the browser
aCYnew height of the browser

Member Data Documentation

const unsigned long nsIWebBrowserChrome::CHROME_ALL = 0x00000ffe [inherited]

Definition at line 116 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_CENTER_SCREEN = 0x08000000 [inherited]

Definition at line 103 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_DEFAULT = 0x00000001 [inherited]

Definitions for the chrome flags.

Definition at line 80 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_DEPENDENT = 0x10000000 [inherited]

Definition at line 108 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_EXTRA = 0x00000800 [inherited]

Definition at line 91 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_LOCATIONBAR = 0x00000040 [inherited]

Definition at line 86 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_MENUBAR = 0x00000010 [inherited]

Definition at line 84 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_MODAL = 0x20000000 [inherited]

Definition at line 112 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_OPENAS_CHROME = 0x80000000 [inherited]

Definition at line 114 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_OPENAS_DIALOG = 0x40000000 [inherited]

Definition at line 113 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR = 0x00000100 [inherited]

Definition at line 88 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_SCROLLBARS = 0x00000200 [inherited]

Definition at line 89 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_STATUSBAR = 0x00000080 [inherited]

Definition at line 87 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_TITLEBAR = 0x00000400 [inherited]

Definition at line 90 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_TOOLBAR = 0x00000020 [inherited]

Definition at line 85 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_BORDERS = 0x00000002 [inherited]

Definition at line 81 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_CLOSE = 0x00000004 [inherited]

Definition at line 82 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_LOWERED = 0x04000000 [inherited]

Definition at line 102 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_MIN = 0x00004000 [inherited]

Definition at line 98 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_POPUP = 0x00008000 [inherited]

Definition at line 99 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_RAISED = 0x02000000 [inherited]

Definition at line 101 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_RESIZE = 0x00000008 [inherited]

Definition at line 83 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WITH_POSITION = 0x00002000 [inherited]

Definition at line 95 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::CHROME_WITH_SIZE = 0x00001000 [inherited]

Definition at line 94 of file nsIWebBrowserChrome.idl.

The chrome flags for this browser chrome.

The implementation should reflect the value of this attribute by hiding or showing its chrome appropriately.

Definition at line 123 of file nsIWebBrowserChrome.idl.

Flag.

Context is the whole document.

Definition at line 67 of file nsIContextMenuListener.idl.

Flag.

Context is an image element.

Definition at line 65 of file nsIContextMenuListener.idl.

Flag.

Context is an input element.

Definition at line 71 of file nsIContextMenuListener.idl.

Flag.

Context is a link element.

Definition at line 63 of file nsIContextMenuListener.idl.

Flag.

No context.

Definition at line 61 of file nsIContextMenuListener.idl.

Flag.

Context is a text area element.

Definition at line 69 of file nsIContextMenuListener.idl.

Flag indicates that position of the top left corner of the outer area is required/specified.

See also:
setDimensions
getDimensions

Definition at line 61 of file nsIEmbeddingSiteWindow.idl.

Flag indicates that the size of the inner area is required/specified.

Note:
The inner and outer flags are mutually exclusive and it is invalid to combine them.
See also:
setDimensions
getDimensions
DIM_FLAGS_SIZE_OUTER

Definition at line 73 of file nsIEmbeddingSiteWindow.idl.

Flag indicates that the size of the outer area is required/specified.

See also:
setDimensions
getDimensions
DIM_FLAGS_SIZE_INNER

Definition at line 82 of file nsIEmbeddingSiteWindow.idl.

Definition at line 113 of file WebBrowserChrome.h.

Definition at line 114 of file WebBrowserChrome.h.

Definition at line 118 of file WebBrowserChrome.h.

Definition at line 112 of file WebBrowserChrome.h.

Definition at line 115 of file WebBrowserChrome.h.

Definition at line 117 of file WebBrowserChrome.h.

readonly attribute voidPtr nsIEmbeddingSiteWindow::siteWindow [inherited]

Native window for the site's window.

The implementor should copy the native window object into the address supplied by the caller. The type of the native window that the address refers to is platform and OS specific as follows:

  • On Win32 it is an HWND.
  • On MacOS this is a WindowPtr.
  • On GTK this is a GtkWidget*.

Definition at line 154 of file nsIEmbeddingSiteWindow.idl.

const unsigned long nsIWebProgressListener::STATE_IS_BROKEN = 0x00000001 [inherited]

Definition at line 205 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_DOCUMENT = 0x00020000 [inherited]

Definition at line 163 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_INSECURE = 0x00000004 [inherited]

State Security Flags.

These flags describe the security state reported by a call to the onSecurityChange method. These flags are mutually exclusive.

STATE_IS_INSECURE This flag indicates that the data corresponding to the request was received over an insecure channel.

STATE_IS_BROKEN This flag indicates an unknown security state. This may mean that the request is being loaded as part of a page in which some content was received over an insecure channel.

STATE_IS_SECURE This flag indicates that the data corresponding to the request was received over a secure channel. The degree of security is expressed by STATE_SECURE_HIGH, STATE_SECURE_MED, or STATE_SECURE_LOW.

Definition at line 204 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_NETWORK = 0x00040000 [inherited]

Definition at line 164 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_REQUEST = 0x00010000 [inherited]

State Type Flags.

These flags further describe the entity for which the state transition is occuring. These flags are NOT mutually exclusive (i.e., an onStateChange event may indicate some combination of these flags).

STATE_IS_REQUEST This flag indicates that the state transition is for a request, which includes but is not limited to document requests. (See below for a description of document requests.) Other types of requests, such as requests for inline content (e.g., images and stylesheets) are considered normal requests.

STATE_IS_DOCUMENT This flag indicates that the state transition is for a document request. This flag is set in addition to STATE_IS_REQUEST. A document request supports the nsIChannel interface and its loadFlags attribute includes the nsIChannel::LOAD_DOCUMENT_URI flag.

A document request does not complete until all requests associated with the loading of its corresponding document have completed. This includes other document requests (e.g., corresponding to HTML <iframe> elements). The document corresponding to a document request is available via the DOMWindow attribute of onStateChange's aWebProgress parameter.

STATE_IS_NETWORK This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

Unlike STATE_IS_WINDOW, this flag is only set when activity within the nsIWebProgress instance being observed starts or stops. If activity only occurs in a child nsIWebProgress instance, then this flag will be set to indicate the start and stop of that activity.

For example, in the case of navigation within a single frame of a HTML frameset, a nsIWebProgressListener instance attached to the nsIWebProgress of the frameset window will receive onStateChange calls with the STATE_IS_NETWORK flag set to indicate the start and stop of said navigation. In other words, an observer of an outer window can determine when activity, that may be constrained to a child window or set of child windows, starts and stops.

STATE_IS_WINDOW This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

This flag is similar to STATE_IS_DOCUMENT. However, when a document request completes, two onStateChange calls with STATE_STOP are generated. The document request is passed as aRequest to both calls. The first has STATE_IS_REQUEST and STATE_IS_DOCUMENT set, and the second has the STATE_IS_WINDOW flag set (and possibly the STATE_IS_NETWORK flag set as well -- see above for a description of when the STATE_IS_NETWORK flag may be set). This second STATE_STOP event may be useful as a way to partition the work that occurs when a document request completes.

Definition at line 162 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_SECURE = 0x00000002 [inherited]

Definition at line 206 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_WINDOW = 0x00080000 [inherited]

Definition at line 165 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_NEGOTIATING = 0x00000008 [inherited]

Definition at line 98 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_REDIRECTING = 0x00000002 [inherited]

Definition at line 96 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_RESTORING = 0x01000000 [inherited]

State Modifier Flags.

These flags further describe the transition which is occuring. These flags are NOT mutually exclusive (i.e., an onStateChange event may indicate some combination of these flags).

STATE_RESTORING This flag indicates that the state transition corresponds to the start or stop of activity for restoring a previously-rendered presentation. As such, there is no actual network activity associated with this request, and any modifications made to the document or presentation when it was originally loaded will still be present.

Definition at line 182 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_SECURE_HIGH = 0x00040000 [inherited]

Security Strength Flags.

These flags describe the security strength and accompany STATE_IS_SECURE in a call to the onSecurityChange method. These flags are mutually exclusive.

These flags are not meant to provide a precise description of data transfer security. These are instead intended as a rough indicator that may be used to, for example, color code a security indicator or otherwise provide basic data transfer security feedback to the user.

STATE_SECURE_HIGH This flag indicates a high degree of security.

STATE_SECURE_MED This flag indicates a medium degree of security.

STATE_SECURE_LOW This flag indicates a low degree of security.

Definition at line 229 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_SECURE_LOW = 0x00020000 [inherited]

Definition at line 231 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_SECURE_MED = 0x00010000 [inherited]

Definition at line 230 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_START = 0x00000001 [inherited]

State Transition Flags.

These flags indicate the various states that requests may transition through as they are being loaded. These flags are mutually exclusive.

For any given request, onStateChange is called once with the STATE_START flag, zero or more times with the STATE_TRANSFERRING flag or once with the STATE_REDIRECTING flag, and then finally once with the STATE_STOP flag. NOTE: For document requests, a second STATE_STOP is generated (see the description of STATE_IS_WINDOW for more details).

STATE_START This flag indicates the start of a request. This flag is set when a request is initiated. The request is complete when onStateChange is called for the same request with the STATE_STOP flag set.

STATE_REDIRECTING This flag indicates that a request is being redirected. The request passed to onStateChange is the request that is being redirected. When a redirect occurs, a new request is generated automatically to process the new request. Expect a corresponding STATE_START event for the new request, and a STATE_STOP for the redirected request.

STATE_TRANSFERRING This flag indicates that data for a request is being transferred to an end consumer. This flag indicates that the request has been targeted, and that the user may start seeing content corresponding to the request.

STATE_NEGOTIATING This flag is not used.

STATE_STOP This flag indicates the completion of a request. The aStatus parameter to onStateChange indicates the final status of the request.

Definition at line 95 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_STOP = 0x00000010 [inherited]

Definition at line 99 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_TRANSFERRING = 0x00000004 [inherited]

Definition at line 97 of file nsIWebProgressListener.idl.

const unsigned long nsIWebBrowserChrome::STATUS_LINK = 0x00000003 [inherited]

Definition at line 57 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::STATUS_SCRIPT = 0x00000001 [inherited]

Definition at line 55 of file nsIWebBrowserChrome.idl.

const unsigned long nsIWebBrowserChrome::STATUS_SCRIPT_DEFAULT = 0x00000002 [inherited]

Definition at line 56 of file nsIWebBrowserChrome.idl.

Title of the window.

Definition at line 140 of file nsIEmbeddingSiteWindow.idl.

Visibility of the window.

Definition at line 135 of file nsIEmbeddingSiteWindow.idl.

The currently loaded WebBrowser.

The browser chrome may be told to set the WebBrowser object to a new object by setting this attribute. In this case the implementer is responsible for taking the new WebBrowser object and doing any necessary initialization or setup as if it had created the WebBrowser itself. This includes positioning setting up listeners etc.

Definition at line 75 of file nsIWebBrowserChrome.idl.


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