Back to index

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

#include <nsContentTreeOwner.h>

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

List of all members.

Public Member Functions

void contentShellAdded2 (in nsIDocShellTreeItem aContentShell, in boolean aPrimary, in boolean aTargetable, in AString aID)
 Called when a content shell is added to the docshell tree.
void contentShellRemoved (in nsIDocShellTreeItem aContentShell)
 Called when a content shell is removed from the docshell tree.
nsIDocShellTreeItem findItemWithName (in wstring name, in nsIDocShellTreeItem aRequestor, in nsIDocShellTreeItem aOriginalRequestor)
void contentShellAdded (in nsIDocShellTreeItem aContentShell, in boolean aPrimary, in wstring aID)
void sizeShellTo (in nsIDocShellTreeItem shell, in long cx, in long cy)
void setPersistence (in boolean aPersistPosition, in boolean aPersistSize, in boolean aPersistSizeMode)
void getPersistence (out boolean aPersistPosition, out boolean aPersistSize, out boolean aPersistSizeMode)
void initWindow (in nativeWindow parentNativeWindow, in nsIWidget parentWidget, in long x, in long y, in long cx, in long cy)
void create ()
void destroy ()
void setPosition (in long x, in long y)
void getPosition (out long x, out long y)
void setSize (in long cx, in long cy, in boolean fRepaint)
void getSize (out long cx, out long cy)
void setPositionAndSize (in long x, in long y, in long cx, in long cy, in boolean fRepaint)
void getPositionAndSize (out long x, out long y, out long cx, out long cy)
void repaint (in boolean force)
 Tell the window to repaint itself.
void setFocus ()
 Give the window focus.
void getInterface (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 Retrieves the specified interface pointer.
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.
nsIDOMWindow provideWindow (in nsIDOMWindow aParent, in unsigned long aChromeFlags, in boolean aPositionSpecified, in boolean aSizeSpecified, in nsIURI aURI, in AString aName, in AUTF8String aFeatures, out boolean aWindowIsNew)
 A method to request that this provider provide a window.

Public Attributes

readonly attribute
nsIDocShellTreeItem 
primaryContentShell
attribute nsIWidget parentWidget
attribute nativeWindow parentNativeWindow
attribute boolean visibility
attribute boolean enabled
attribute boolean blurSuppression
 set blurSuppression to true to suppress handling of blur events.
readonly attribute nsIWidget mainWidget
attribute wstring title
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.

Protected Member Functions

 nsContentTreeOwner (PRBool fPrimary)
virtual ~nsContentTreeOwner ()
void XULWindow (nsXULWindow *aXULWindow)
nsXULWindowXULWindow ()

Protected Attributes

nsXULWindowmXULWindow
nsSiteWindow2mSiteWindow2
PRBool mPrimary
PRBool mContentTitleSetting
nsString mWindowTitleModifier
nsString mTitleSeparator
nsString mTitlePreface
nsString mTitleDefault

Friends

class nsXULWindow
class nsSiteWindow2

Detailed Description

Definition at line 58 of file nsContentTreeOwner.h.


Constructor & Destructor Documentation

Definition at line 99 of file nsContentTreeOwner.cpp.

                                                      : mXULWindow(nsnull), 
   mPrimary(fPrimary), mContentTitleSetting(PR_FALSE)
{
  // note if this fails, QI on nsIEmbeddingSiteWindow(2) will simply fail
  mSiteWindow2 = new nsSiteWindow2(this);
}
nsContentTreeOwner::~nsContentTreeOwner ( ) [protected, virtual]

Definition at line 106 of file nsContentTreeOwner.cpp.

{
  delete mSiteWindow2;
}

Member Function Documentation

void nsIDocShellTreeOwner::contentShellAdded ( in nsIDocShellTreeItem  aContentShell,
in boolean  aPrimary,
in wstring  aID 
) [inherited]
void nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH::contentShellAdded2 ( in nsIDocShellTreeItem  aContentShell,
in boolean  aPrimary,
in boolean  aTargetable,
in AString  aID 
) [inherited]

Called when a content shell is added to the docshell tree.

This is only called for "root" content shells (that is, ones whose parent is a chrome shell).

Parameters:
aContentShellthe shell being added.
aPrimarywhether the shell is primary.
aTargetablewhether the shell can be a target for named window targeting.
aIDthe "id" of the shell. What this actually means is undefined. Don't rely on this for anything.

Called when a content shell is removed from the docshell tree.

This is only called for "root" content shells (that is, ones whose parent is a chrome shell). Note that if aContentShell was never added, contentShellRemoved should just do nothing.

Parameters:
aContentShellthe shell being removed.
void nsIBaseWindow::create ( ) [inherited]
void nsIBaseWindow::destroy ( ) [inherited]

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
nsIDocShellTreeItem nsIDocShellTreeOwner::findItemWithName ( in wstring  name,
in nsIDocShellTreeItem  aRequestor,
in nsIDocShellTreeItem  aOriginalRequestor 
) [inherited]
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.
void nsIDocShellTreeOwner::getPersistence ( out boolean  aPersistPosition,
out boolean  aPersistSize,
out boolean  aPersistSizeMode 
) [inherited]
void nsIBaseWindow::getPosition ( out long  x,
out long  y 
) [inherited]
void nsIBaseWindow::getPositionAndSize ( out long  x,
out long  y,
out long  cx,
out long  cy 
) [inherited]
void nsIBaseWindow::getSize ( out long  cx,
out long  cy 
) [inherited]
void nsIBaseWindow::initWindow ( in nativeWindow  parentNativeWindow,
in nsIWidget  parentWidget,
in long  x,
in long  y,
in long  cx,
in long  cy 
) [inherited]

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

Returns:
true if it's a modal window
nsIDOMWindow nsIWindowProvider::provideWindow ( in nsIDOMWindow  aParent,
in unsigned long  aChromeFlags,
in boolean  aPositionSpecified,
in boolean  aSizeSpecified,
in nsIURI  aURI,
in AString  aName,
in AUTF8String  aFeatures,
out boolean  aWindowIsNew 
) [inherited]

A method to request that this provider provide a window.

The window returned need not to have the right name or parent set on it; setting those is the caller's responsibility. The provider can always return null to have the caller create a brand-new window.

Parameters:
aParentMust not be null. This is the window that the caller wants to use as the parent for the new window. Generally, nsIWindowProvider implementors can expect to be somehow related to aParent; the relationship may depend on the nsIWindowProvider implementation.
aChromeFlagsThe chrome flags the caller will use to create a new window if this provider returns null. See nsIWebBrowserChrome for the possible values of this field.
aPositionSpecifiedWhether the attempt to create a window is trying to specify a position for the new window.
aSizeSpecifiedWhether the attempt to create a window is trying to specify a size for the new window.
aURIThe URI to be loaded in the new window. The nsIWindowProvider implementation MUST NOT load this URI in the window it returns. This URI is provided solely to help the nsIWindowProvider implenentation make decisions; the caller will handle loading the URI in the window returned if provideWindow returns a window. Note that the URI may be null if the load cannot be represented by a single URI (e.g. if the load has extra load flags, POST data, etc).
aNameThe name of the window being opened. Setting the name on the return value of provideWindow will be handled by the caller; aName is provided solely to help the nsIWindowProvider implementation make decisions.
aFeaturesThe feature string for the window being opened. This may be empty. The nsIWindowProvider implementation is allowed to apply the feature string to the window it returns in any way it sees fit. See the nsIWindowWatcher interface for details on feature strings.
aWindowIsNew[out] Whether the window being returned was just created by the window provider implementation. This can be used by callers to keep track of which windows were opened by the user as opposed to being opened programmatically. This should be set to false if the window being returned existed before the provideWindow() call. The value of this out parameter is meaningless if provideWindow() returns null.
Returns:
A window the caller should use or null if the caller should just create a new window. The returned window may be newly opened by the nsIWindowProvider implementation or may be a window that already existed.
See also:
nsIWindowWatcher for more information on aFeatures.
nsIWebBrowserChrome for more information on aChromeFlags.
void nsIBaseWindow::repaint ( in boolean  force) [inherited]

Tell the window to repaint itself.

Parameters:
aForce- if true, repaint immediately if false, the window may defer repainting as it sees fit.
void nsIBaseWindow::setFocus ( ) [inherited]

Give the window focus.

void nsIDocShellTreeOwner::setPersistence ( in boolean  aPersistPosition,
in boolean  aPersistSize,
in boolean  aPersistSizeMode 
) [inherited]
void nsIBaseWindow::setPosition ( in long  x,
in long  y 
) [inherited]
void nsIBaseWindow::setPositionAndSize ( in long  x,
in long  y,
in long  cx,
in long  cy,
in boolean  fRepaint 
) [inherited]
void nsIBaseWindow::setSize ( in long  cx,
in long  cy,
in boolean  fRepaint 
) [inherited]
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
void nsIDocShellTreeOwner::sizeShellTo ( in nsIDocShellTreeItem  shell,
in long  cx,
in long  cy 
) [inherited]
void nsContentTreeOwner::XULWindow ( nsXULWindow aXULWindow) [protected]

Definition at line 842 of file nsContentTreeOwner.cpp.

{
   mXULWindow = aXULWindow;
   if(mXULWindow && mPrimary)
      {
      // Get the window title modifiers
      nsCOMPtr<nsIDOMElement> docShellElement;
      mXULWindow->GetWindowDOMElement(getter_AddRefs(docShellElement));

      nsAutoString   contentTitleSetting;

      if(docShellElement)  
         {
         docShellElement->GetAttribute(NS_LITERAL_STRING("contenttitlesetting"), contentTitleSetting);
         if(contentTitleSetting.EqualsLiteral("true"))
            {
            mContentTitleSetting = PR_TRUE;
            docShellElement->GetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault);
            docShellElement->GetAttribute(NS_LITERAL_STRING("titlemodifier"), mWindowTitleModifier);
            docShellElement->GetAttribute(NS_LITERAL_STRING("titlepreface"), mTitlePreface);
            
#if defined(XP_MACOSX) && defined(MOZ_XUL_APP)
            // On OS X, treat the titlemodifier like it's the titledefault, and don't ever append
            // the separator + appname.
            if (mTitleDefault.IsEmpty()) {
                docShellElement->SetAttribute(NS_LITERAL_STRING("titledefault"),
                                              mWindowTitleModifier);
                docShellElement->RemoveAttribute(NS_LITERAL_STRING("titlemodifier"));
                mTitleDefault = mWindowTitleModifier;
                mWindowTitleModifier.Truncate();
            }
#endif
            docShellElement->GetAttribute(NS_LITERAL_STRING("titlemenuseparator"), mTitleSeparator);
            }
         }
      else
         {
         NS_ERROR("This condition should never happen.  If it does, "
            "we just won't get a modifier, but it still shouldn't happen.");
         }
      }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 885 of file nsContentTreeOwner.cpp.

{
   return mXULWindow;
}

Friends And Related Function Documentation

friend class nsSiteWindow2 [friend]

Definition at line 65 of file nsContentTreeOwner.h.

friend class nsXULWindow [friend]

Definition at line 64 of file nsContentTreeOwner.h.


Member Data Documentation

set blurSuppression to true to suppress handling of blur events.

set it false to re-enable them. query it to determine whether blur events are suppressed. The implementation should allow for blur events to be suppressed multiple times.

Definition at line 205 of file nsIBaseWindow.idl.

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.

Definition at line 198 of file nsIBaseWindow.idl.

Definition at line 212 of file nsIBaseWindow.idl.

Definition at line 88 of file nsContentTreeOwner.h.

Definition at line 87 of file nsContentTreeOwner.h.

Definition at line 86 of file nsContentTreeOwner.h.

Definition at line 92 of file nsContentTreeOwner.h.

Definition at line 91 of file nsContentTreeOwner.h.

Definition at line 90 of file nsContentTreeOwner.h.

Definition at line 89 of file nsContentTreeOwner.h.

Definition at line 85 of file nsContentTreeOwner.h.

Definition at line 185 of file nsIBaseWindow.idl.

Definition at line 174 of file nsIBaseWindow.idl.

Definition at line 81 of file nsIDocShellTreeOwner.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.

attribute wstring nsIBaseWindow::title [inherited]

Definition at line 222 of file nsIBaseWindow.idl.

Definition at line 192 of file nsIBaseWindow.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: