Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
QGeckoEmbedPrivate Class Reference
Collaboration diagram for QGeckoEmbedPrivate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QGeckoEmbedPrivate (QGeckoEmbed *qq)
 ~QGeckoEmbedPrivate ()
void initGUI ()
void init ()
void ApplyChromeMask ()

Public Attributes

QGeckoEmbedq
QWidget * mMainWidget
EmbedWindowwindow
nsCOMPtr< nsISupports > windowGuard
EmbedProgressprogress
nsCOMPtr< nsISupports > progressGuard
EmbedContentListenercontentListener
nsCOMPtr< nsISupports > contentListenerGuard
EmbedEventListenereventListener
nsCOMPtr< nsISupports > eventListenerGuard
EmbedStreamstream
nsCOMPtr< nsISupports > streamGuard
nsCOMPtr< nsIWebNavigationnavigation
nsCOMPtr< nsISHistorysessionHistory
nsCOMPtr< nsIDOMEventReceivereventReceiver
PRUint32 chromeMask
bool isChrome
bool chromeLoaded
bool listenersAttached

Detailed Description

Definition at line 82 of file qgeckoembed.cpp.


Constructor & Destructor Documentation

Definition at line 123 of file qgeckoembed.cpp.

Here is the call graph for this function:

Definition at line 135 of file qgeckoembed.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 234 of file qgeckoembed.cpp.

{
   if (window) {
      nsCOMPtr<nsIWebBrowser> webBrowser;
      window->GetWebBrowser(getter_AddRefs(webBrowser));

      nsCOMPtr<nsIDOMWindow> domWindow;
      webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
      if (domWindow) {
          nsCOMPtr<nsIDOMBarProp> scrollbars;
          domWindow->GetScrollbars(getter_AddRefs(scrollbars));
          if (scrollbars) {

              scrollbars->SetVisible(
                  chromeMask & nsIWebBrowserChrome::CHROME_SCROLLBARS ?
                  PR_TRUE : PR_FALSE);
          }
      }
   }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 142 of file qgeckoembed.cpp.

{
    QGeckoGlobals::initializeGlobalObjects();
    QGeckoGlobals::pushStartup();
    QGeckoGlobals::addEngine(q);

    // Create our embed window, and create an owning reference to it and
    // initialize it.  It is assumed that this window will be destroyed
    // when we go out of scope.
    window = new EmbedWindow();
    windowGuard = NS_STATIC_CAST(nsIWebBrowserChrome *, window);
    window->Init(q);
    // Create our progress listener object, make an owning reference,
    // and initialize it.  It is assumed that this progress listener
    // will be destroyed when we go out of scope.
    progress = new EmbedProgress(q);
    progressGuard = NS_STATIC_CAST(nsIWebProgressListener *,
                                   progress);

    // Create our content listener object, initialize it and attach it.
    // It is assumed that this will be destroyed when we go out of
    // scope.
    contentListener = new EmbedContentListener(q);
    contentListenerGuard = NS_STATIC_CAST(nsISupports*,
                                          NS_STATIC_CAST(nsIURIContentListener*, contentListener));

    // Create our key listener object and initialize it.  It is assumed
    // that this will be destroyed before we go out of scope.
    eventListener = new EmbedEventListener(q);
    eventListenerGuard =
        NS_STATIC_CAST(nsISupports *, NS_STATIC_CAST(nsIDOMKeyListener *,
                                                     eventListener));

    // has the window creator service been set up?
    static int initialized = PR_FALSE;
    // Set up our window creator ( only once )
    if (!initialized) {
        // create our local object
        nsCOMPtr<nsIWindowCreator> windowCreator = new EmbedWindowCreator();

        // Attach it via the watcher service
        nsCOMPtr<nsIWindowWatcher> watcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
        if (watcher)
            watcher->SetWindowCreator(windowCreator);
        initialized = PR_TRUE;
    }

    // Get the nsIWebBrowser object for our embedded window.
    nsCOMPtr<nsIWebBrowser> webBrowser;
    window->GetWebBrowser(getter_AddRefs(webBrowser));

    // get a handle on the navigation object
    navigation = do_QueryInterface(webBrowser);

    // Create our session history object and tell the navigation object
    // to use it.  We need to do this before we create the web browser
    // window.
    sessionHistory = do_CreateInstance(NS_SHISTORY_CONTRACTID);
    navigation->SetSessionHistory(sessionHistory);

    // create the window
    window->CreateWindow();

    // bind the progress listener to the browser object
    nsCOMPtr<nsISupportsWeakReference> supportsWeak;
    supportsWeak = do_QueryInterface(progressGuard);
    nsCOMPtr<nsIWeakReference> weakRef;
    supportsWeak->GetWeakReference(getter_AddRefs(weakRef));
    webBrowser->AddWebBrowserListener(weakRef,
                                      nsIWebProgressListener::GetIID());

    // set ourselves as the parent uri content listener
    webBrowser->SetParentURIContentListener(contentListener);

    // save the window id of the newly created window
    nsCOMPtr<nsIWidget> qtWidget;
    window->mBaseWindow->GetMainWidget(getter_AddRefs(qtWidget));
    // get the native drawing area
    mMainWidget = NS_STATIC_CAST(QWidget*, qtWidget->GetNativeData(NS_NATIVE_WINDOW));

    // Apply the current chrome mask
    ApplyChromeMask();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 227 of file qgeckoembed.cpp.

{
    QBoxLayout *l = new QHBoxLayout(q);
    l->setAutoAdd(TRUE);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 114 of file qgeckoembed.cpp.

Definition at line 111 of file qgeckoembed.cpp.

Definition at line 97 of file qgeckoembed.cpp.

Definition at line 98 of file qgeckoembed.cpp.

Definition at line 99 of file qgeckoembed.cpp.

Definition at line 100 of file qgeckoembed.cpp.

Definition at line 108 of file qgeckoembed.cpp.

Definition at line 113 of file qgeckoembed.cpp.

Definition at line 115 of file qgeckoembed.cpp.

Definition at line 90 of file qgeckoembed.cpp.

Definition at line 104 of file qgeckoembed.cpp.

Definition at line 95 of file qgeckoembed.cpp.

Definition at line 96 of file qgeckoembed.cpp.

Definition at line 88 of file qgeckoembed.cpp.

Definition at line 105 of file qgeckoembed.cpp.

Definition at line 101 of file qgeckoembed.cpp.

Definition at line 102 of file qgeckoembed.cpp.

Definition at line 93 of file qgeckoembed.cpp.

Definition at line 94 of file qgeckoembed.cpp.


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