Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes
Silverstone.Manticore.Layout.WebBrowser Class Reference
Collaboration diagram for Silverstone.Manticore.Layout.WebBrowser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WebBrowser (BrowserWindow aBrowserWindow)
void RealizeLayoutEngine ()
void SwitchLayoutEngine (String id)
void LoadURL (String url, Boolean bypassCache)
void RefreshPage ()
void Stop ()
void GoBack ()
void GoForward ()
void GoHome ()
void OnProgressGecko (Object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_ProgressChangeEvent e)
void OnProgressTrident (Object sender, AxSHDocVw.DWebBrowserEvents2_ProgressChangeEvent e)
void OnNavigateComplete2Gecko (Object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_NavigateComplete2Event e)
void OnNavigateComplete2Trident (Object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
void OnTitleChangeGecko (Object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_TitleChangeEvent e)
void OnTitleChangeTrident (Object sender, AxSHDocVw.DWebBrowserEvents2_TitleChangeEvent e)
void OnStatusChangeGecko (Object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_StatusTextChangeEvent e)
void OnStatusChangeTrident (Object sender, AxSHDocVw.DWebBrowserEvents2_StatusTextChangeEvent e)
void OnNewWindowGecko (Object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_NewWindow2Event e)
void OnNewWindowTrident (Object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e)
void OnFileDownloadTrident (Object sender, AxSHDocVw.DWebBrowserEvents2_FileDownloadEvent e)

Protected Member Functions

override void OnPaint (PaintEventArgs e)
override void OnResize (EventArgs e)

Protected Attributes

AxWebBrowser trident
AxMozillaBrowser gecko

Properties

AxWebBrowser Trident [get]
AxMozillaBrowser Gecko [get]
Object currentLayoutEngine [get]
String URL [get, set]

Private Member Functions

void AddListeners ()
void AddProgressListener ()
void AddNavigateComplete2Listener ()
void AddTitleChangeListener ()
void AddStatusChangeListener ()
void AddNewWindowListener ()
void AddFileDownloadListener ()

Private Attributes

BrowserWindow mBrowserWindow
bool mBlankView = false
bool mProgressChangeGecko = false
bool mProgressChangeTrident = false
bool mNavigateComplete2Gecko = false
bool mNavigateComplete2Trident = false
bool mTitleChangeGecko = false
bool mTitleChangeTrident = false
bool mStatusChangeGecko = false
bool mStatusChangeTrident = false
bool mNewWindowGecko = false
bool mNewWindowTrident = false
bool mFileDownloadGecko = false
bool mFileDownloadTrident = false

Detailed Description

Definition at line 59 of file layoutabstraction.cs.


Constructor & Destructor Documentation

Definition at line 83 of file layoutabstraction.cs.

    {
      mBrowserWindow = aBrowserWindow;
    }

Member Function Documentation

Definition at line 422 of file layoutabstraction.cs.

    {
      if (gecko != null && !mFileDownloadGecko) 
      {
        mFileDownloadGecko = true;
      }
      else if (trident != null && !mFileDownloadTrident) 
      {
        trident.FileDownload += new AxSHDocVw.DWebBrowserEvents2_FileDownloadEventHandler(OnFileDownloadTrident);
        mFileDownloadTrident = true;
      }
    }

Definition at line 313 of file layoutabstraction.cs.

    {
      if (gecko != null && !mNavigateComplete2Gecko) 
      {
        gecko.NavigateComplete2 += new AxMOZILLACONTROLLib.DWebBrowserEvents2_NavigateComplete2EventHandler(OnNavigateComplete2Gecko);
        mNavigateComplete2Gecko = true;
      }
      else if (trident != null && !mNavigateComplete2Trident) 
      {
        trident.NavigateComplete2 += new AxSHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(OnNavigateComplete2Trident);
        mNavigateComplete2Trident = true;
      }
    }

Definition at line 381 of file layoutabstraction.cs.

    {
      if (gecko != null && !mNewWindowGecko) {
        gecko.NewWindow2 += new AxMOZILLACONTROLLib.DWebBrowserEvents2_NewWindow2EventHandler(OnNewWindowGecko);
        mNewWindowGecko = true;
      }
      else if (trident != null && !mNewWindowTrident) {
        trident.NewWindow2 += new AxSHDocVw.DWebBrowserEvents2_NewWindow2EventHandler(OnNewWindowTrident);
        mNewWindowTrident = true;
      }
    }

Definition at line 291 of file layoutabstraction.cs.

    {
      if (gecko != null && !mProgressChangeGecko) {
        gecko.ProgressChange += new AxMOZILLACONTROLLib.DWebBrowserEvents2_ProgressChangeEventHandler(OnProgressGecko);
        mProgressChangeGecko = true;
      }
      else if (trident != null && !mProgressChangeTrident) {
        trident.ProgressChange += new AxSHDocVw.DWebBrowserEvents2_ProgressChangeEventHandler(OnProgressTrident);
        mProgressChangeTrident = true;
      }
    }

Definition at line 359 of file layoutabstraction.cs.

    {
      if (gecko != null && !mStatusChangeGecko) {
        gecko.StatusTextChange += new AxMOZILLACONTROLLib.DWebBrowserEvents2_StatusTextChangeEventHandler(OnStatusChangeGecko);
        mStatusChangeGecko = true;
      }
      else if (trident != null && !mStatusChangeTrident) {
        trident.StatusTextChange += new AxSHDocVw.DWebBrowserEvents2_StatusTextChangeEventHandler(OnStatusChangeTrident);
        mStatusChangeTrident = true;
      }
    }

Definition at line 337 of file layoutabstraction.cs.

    {
      if (gecko != null && !mTitleChangeGecko) {
        gecko.TitleChange += new AxMOZILLACONTROLLib.DWebBrowserEvents2_TitleChangeEventHandler(OnTitleChangeGecko);
        mTitleChangeGecko = true;
      }
      else if (trident != null && !mTitleChangeTrident) {
        trident.TitleChange += new AxSHDocVw.DWebBrowserEvents2_TitleChangeEventHandler(OnTitleChangeTrident);
        mTitleChangeTrident = true;
      }
    }

Definition at line 255 of file layoutabstraction.cs.

    {
      RealizeLayoutEngine();
      if (gecko != null)
        gecko.GoBack();
      else if (trident != null)
        trident.GoBack();
    }

Definition at line 264 of file layoutabstraction.cs.

    {
      RealizeLayoutEngine();
      if (gecko != null)
        gecko.GoForward();
      else if (trident != null)
        trident.GoForward();
    }

Definition at line 273 of file layoutabstraction.cs.

    {
      // XXX - need to implement "Home" preference
      String homepageURL = ServiceManager.Preferences.GetStringPref("browser.homepage");
      LoadURL(homepageURL, false);
    }

Here is the call graph for this function:

Definition at line 201 of file layoutabstraction.cs.

    {
      if (!mBlankView)
        mBlankView = true;

      // XXX - neither IE nor Mozilla implement all of the
      //       load flags properly. Mozilla should at least be 
      //       made to support ignore-cache and ignore-history.
      //       This will require modification to the ActiveX
      //       control.

      RealizeLayoutEngine();
      Object o = null;
      if (gecko != null)
        gecko.Navigate(url, ref o, ref o, ref o, ref o);
      else if (trident != null)
        trident.Navigate(url, ref o, ref o, ref o, ref o);
    }
void Silverstone.Manticore.Layout.WebBrowser.OnFileDownloadTrident ( Object  sender,
AxSHDocVw.DWebBrowserEvents2_FileDownloadEvent  e 
) [inline]

Definition at line 434 of file layoutabstraction.cs.

    {
      e.cancel = false;
    }
void Silverstone.Manticore.Layout.WebBrowser.OnNavigateComplete2Gecko ( Object  sender,
AxMOZILLACONTROLLib.DWebBrowserEvents2_NavigateComplete2Event  e 
) [inline]

Definition at line 326 of file layoutabstraction.cs.

    {
      mBrowserWindow.OnNavigateComplete2(e.uRL as string);
    }
void Silverstone.Manticore.Layout.WebBrowser.OnNavigateComplete2Trident ( Object  sender,
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event  e 
) [inline]

Definition at line 330 of file layoutabstraction.cs.

    {
      mBrowserWindow.OnNavigateComplete2(e.uRL as string);
    }
void Silverstone.Manticore.Layout.WebBrowser.OnNewWindowGecko ( Object  sender,
AxMOZILLACONTROLLib.DWebBrowserEvents2_NewWindow2Event  e 
) [inline]

Definition at line 392 of file layoutabstraction.cs.

    {
      bool allowPopups = ServiceManager.Preferences.GetBoolPref("browser.allowpopups");
      if (allowPopups) 
      {
        BrowserWindow window = new BrowserWindow();
        window.WebBrowser.RealizeLayoutEngine();
        window.Show();
        e.ppDisp = window.WebBrowser.Gecko;
      }
      else 
        e.cancel = true;
    }

Here is the call graph for this function:

void Silverstone.Manticore.Layout.WebBrowser.OnNewWindowTrident ( Object  sender,
AxSHDocVw.DWebBrowserEvents2_NewWindow2Event  e 
) [inline]

Definition at line 405 of file layoutabstraction.cs.

    {
      bool allowPopups = ServiceManager.Preferences.GetBoolPref("browser.allowpopups");
      if (allowPopups) 
      {
        BrowserWindow window = new BrowserWindow();
//        window.ShouldLoadHomePage = false;
        window.WebBrowser.RealizeLayoutEngine();
        window.Show();
        e.ppDisp = window.WebBrowser.Trident;
      }
      else 
        e.cancel = true;
    }

Here is the call graph for this function:

override void Silverstone.Manticore.Layout.WebBrowser.OnPaint ( PaintEventArgs  e) [inline, protected]

Definition at line 88 of file layoutabstraction.cs.

    {
      // Draw an inset border around the client area for
      // blank documents. 
      Graphics g = e.Graphics;

      g.DrawLine(SystemPens.ControlDark, 
                 new Point(0, 0), 
                 new Point(this.Width, 0));
      g.DrawLine(SystemPens.ControlDark,
                 new Point(0, 0),
                 new Point(0, this.Height));
      g.DrawLine(SystemPens.ControlDarkDark, 
                 new Point(1, 1),
                 new Point(1 + (this.Width - 1), 1));
      g.DrawLine(SystemPens.ControlDarkDark,
                 new Point(1, 1),
                 new Point(1, 1 + (this.Height - 1)));
      g.DrawLine(SystemPens.ControlLightLight, 
                 new Point(this.Width - 1, 0),
                 new Point(this.Width - 1, this.Height));
      g.DrawLine(SystemPens.ControlLightLight,
                 new Point(0, this.Height - 1),
                 new Point(this.Width, this.Height - 1));
      g.DrawLine(SystemPens.ControlLight,
                 new Point(this.Width - 2, 1),
                 new Point(this.Width - 2, this.Height - 2));
      g.DrawLine(SystemPens.ControlLight,
                 new Point(1, this.Height - 2),
                 new Point(this.Width - 2, this.Height - 2));
    }
void Silverstone.Manticore.Layout.WebBrowser.OnProgressGecko ( Object  sender,
AxMOZILLACONTROLLib.DWebBrowserEvents2_ProgressChangeEvent  e 
) [inline]

Definition at line 302 of file layoutabstraction.cs.

    {
      mBrowserWindow.OnProgress(e.progress, e.progressMax);
    }
void Silverstone.Manticore.Layout.WebBrowser.OnProgressTrident ( Object  sender,
AxSHDocVw.DWebBrowserEvents2_ProgressChangeEvent  e 
) [inline]

Definition at line 306 of file layoutabstraction.cs.

    {
      mBrowserWindow.OnProgress(e.progress, e.progressMax);
    }
override void Silverstone.Manticore.Layout.WebBrowser.OnResize ( EventArgs  e) [inline, protected]

Definition at line 120 of file layoutabstraction.cs.

    {
      if (mBlankView)
        Invalidate();
      if (gecko != null)
        gecko.Size = new Size(this.ClientSize.Width, this.ClientSize.Height);
      else if (trident != null)
        trident.Size = new Size(this.ClientSize.Width, this.ClientSize.Height);
    }
void Silverstone.Manticore.Layout.WebBrowser.OnStatusChangeGecko ( Object  sender,
AxMOZILLACONTROLLib.DWebBrowserEvents2_StatusTextChangeEvent  e 
) [inline]

Definition at line 370 of file layoutabstraction.cs.

void Silverstone.Manticore.Layout.WebBrowser.OnStatusChangeTrident ( Object  sender,
AxSHDocVw.DWebBrowserEvents2_StatusTextChangeEvent  e 
) [inline]

Definition at line 374 of file layoutabstraction.cs.

void Silverstone.Manticore.Layout.WebBrowser.OnTitleChangeGecko ( Object  sender,
AxMOZILLACONTROLLib.DWebBrowserEvents2_TitleChangeEvent  e 
) [inline]

Definition at line 348 of file layoutabstraction.cs.

void Silverstone.Manticore.Layout.WebBrowser.OnTitleChangeTrident ( Object  sender,
AxSHDocVw.DWebBrowserEvents2_TitleChangeEvent  e 
) [inline]

Definition at line 352 of file layoutabstraction.cs.

Definition at line 130 of file layoutabstraction.cs.

    {
      if (gecko == null && trident == null) 
      {
        String layoutEngine = ServiceManager.Preferences.GetStringPref("browser.layoutengine");
        if (layoutEngine == "") 
          layoutEngine = "trident";
        SwitchLayoutEngine(layoutEngine);
      }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 235 of file layoutabstraction.cs.

    {
      // XXX Should take a refresh level and use Refresh2.
      RealizeLayoutEngine();
      Object o = 0 as Object;
      if (gecko != null)
        gecko.Refresh2(ref o);
      else if (trident != null)
        trident.Refresh2(ref o);
    }

Here is the call graph for this function:

Definition at line 246 of file layoutabstraction.cs.

    {
      RealizeLayoutEngine();
      if (gecko != null)
        gecko.Stop();
      else if (trident != null)
        trident.Stop();
    }

Definition at line 141 of file layoutabstraction.cs.

    {
      AxHost host = null;
      String url = "about:blank";
      
      switch (id) {
      case "trident":
        if (gecko != null) {
          url = gecko.LocationURL;
          this.Controls.Remove(gecko as AxHost);
          gecko = null;
        }

        if (trident == null) {
          trident = new AxWebBrowser();
          host = trident as AxHost;
        }

        break;
      default:
        if (trident != null) {
          url = trident.LocationURL;
          this.Controls.Remove(trident as AxHost);
          trident = null;
        }

        if (gecko == null) {
          gecko = new AxMozillaBrowser(); 
          host = gecko as AxHost;
        }
        break;
      }

      if (host != null) {
        host.BeginInit();
        host.TabIndex = 1;
        host.Dock = DockStyle.Fill;
        host.EndInit();
        this.Controls.Add(host);
      }
      
      // Add appropriate content area listeners
      AddListeners();

      ServiceManager.Preferences.SetStringPref("browser.layoutengine", id);

      LoadURL(url, false);
    }

Here is the call graph for this function:


Member Data Documentation

AxMozillaBrowser Silverstone.Manticore.Layout.WebBrowser.gecko [protected]

Definition at line 70 of file layoutabstraction.cs.

Definition at line 81 of file layoutabstraction.cs.

Definition at line 79 of file layoutabstraction.cs.

Definition at line 420 of file layoutabstraction.cs.

Definition at line 421 of file layoutabstraction.cs.

Definition at line 311 of file layoutabstraction.cs.

Definition at line 312 of file layoutabstraction.cs.

Definition at line 379 of file layoutabstraction.cs.

Definition at line 380 of file layoutabstraction.cs.

Definition at line 289 of file layoutabstraction.cs.

Definition at line 290 of file layoutabstraction.cs.

Definition at line 357 of file layoutabstraction.cs.

Definition at line 358 of file layoutabstraction.cs.

Definition at line 335 of file layoutabstraction.cs.

Definition at line 336 of file layoutabstraction.cs.

Definition at line 61 of file layoutabstraction.cs.


Property Documentation

Definition at line 191 of file layoutabstraction.cs.

Definition at line 72 of file layoutabstraction.cs.

Definition at line 63 of file layoutabstraction.cs.

Definition at line 221 of file layoutabstraction.cs.


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