+2007-11-08 Andreia Gaita <avidigal@novell.com>\r
+\r
+ * Mono.Mozilla.dll.sources,\r
+ Mono.Mozilla/DOM/Navigation.cs,\r
+ Mono.Mozilla/interfaces/nsIHistoryEntry.cs,\r
+ Mono.Mozilla/interfaces/nsIInputStream.cs,\r
+ Mono.Mozilla/interfaces/nsISHistory.cs,\r
+ Mono.Mozilla/interfaces/nsISHistoryListener.cs,\r
+ Mono.Mozilla/interfaces/nsISimpleEnumerator.cs,\r
+ Mono.Mozilla/interfaces/nsIURI.cs,\r
+ Mono.Mozilla/interfaces/nsIWebNavigation.cs,\r
+ Mono.WebBrowser/DOM/INavigation.cs:\r
+\r
+ Add nsIWebNavigation interface and related \r
+ dependencies to access navigation-related properties directly (CanGoBack, etc). \r
+ Add INavigation interface and implementation to expose navigation properties. \r
+ Navigation is now done through this interface (Reload(), Stop(), etc).\r
+ \r
+ Please note: Due to threading issues on linux (namely, mozilla being run \r
+ on a different thread), only methods that do not affect drawing can be \r
+ invoked through the interfaces, so although Reload is now called from \r
+ the INavigation interface, it is still being routed through the Base \r
+ class and the glue code (and not through the nsIWebNavigation.Reload \r
+ call, as are other non-drawing-affecting methods like GetTitle).\r
+\r
+ * Mono.Mozilla/ICallback.cs, Callback.cs: Remove unneeded events, adjust parameters, \r
+ add support enumeration for tracking loading state.\r
+\r
+ * Mono.Mozilla/DOM/DOMHTMLDocument.cs, Mono.WebBrowser/DOM/IDOMHTMLDocument.cs: \r
+ Add URL getter.\r
+\r
+ * Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: \r
+ Add Navigation interface getter.\r
+ Add Navigated event support through the StateChange and LocationChange\r
+ events.\r
+ Clean up cached objects when navigating.\r
+ Remove Reload, Forward, Stop, Home methods, these are now accessible \r
+ through the INavigation interface.\r
+\r
+ * Mono.Mozilla/Base.cs: Add call to return the navigation interface. \r
+ Add MarshalAs so that returning interfaces directly works on mono.\r
+\r
2007-10-31 Andreia Gaita <avidigal@novell.com>\r
\r
* Base.cs: Send (and create if needed) user dir to store local mozilla data\r
Mono.Mozilla/DOM/DOMHTMLElement.cs
Mono.Mozilla/DOM/DOMNode.cs
Mono.Mozilla/DOM/DOMObject.cs
+Mono.Mozilla/DOM/Navigation.cs
Mono.Mozilla/interfaces/nsIDOMAttr.cs
Mono.Mozilla/interfaces/nsIDOMCDATASection.cs
Mono.Mozilla/interfaces/nsIDOMCharacterData.cs
Mono.Mozilla/interfaces/nsIDOMNodeList.cs
Mono.Mozilla/interfaces/nsIDOMProcessingInstruction.cs
Mono.Mozilla/interfaces/nsIDOMText.cs
+Mono.Mozilla/interfaces/nsIHistoryEntry.cs
+Mono.Mozilla/interfaces/nsIInputStream.cs
+Mono.Mozilla/interfaces/nsISHistory.cs
+Mono.Mozilla/interfaces/nsISHistoryListener.cs
+Mono.Mozilla/interfaces/nsISimpleEnumerator.cs
+Mono.Mozilla/interfaces/nsIURI.cs
+Mono.Mozilla/interfaces/nsIWebNavigation.cs
Mono.WebBrowser/IWebBrowser.cs
Mono.WebBrowser/Manager.cs
Mono.WebBrowser/DOM/IDOMHTMLDocument.cs
Mono.WebBrowser/DOM/IDOMHTMLElement.cs
Mono.WebBrowser/DOM/IDOMNode.cs
+Mono.WebBrowser/DOM/INavigation.cs
return null;\r
BindingInfo info = getBinding (control);\r
\r
- return gluezilla_getDomDocument (info.gluezilla);\r
+ return gluezilla_getDomDocument (info.gluezilla);
+ }\r
+\r
+ public static nsIWebNavigation GetWebNavigation (IWebBrowser control)\r
+ {\r
+ if (!isInitialized ())\r
+ return null;\r
+ BindingInfo info = getBinding (control);\r
+\r
+ return gluezilla_getWebNavigation (info.gluezilla);\r
}\r
\r
public static IntPtr StringInit ()\r
private static extern int gluezilla_reload (IntPtr instance, ReloadOption option);\r
\r
// dom\r
- [DllImport ("gluezilla")]\r
+ [DllImport ("gluezilla")]
+ [return:MarshalAs(UnmanagedType.Interface)]\r
private static extern nsIDOMHTMLDocument gluezilla_getDomDocument (IntPtr instance);\r
+ [DllImport ("gluezilla")]
+ [return:MarshalAs(UnmanagedType.Interface)]\r
+ private static extern nsIWebNavigation gluezilla_getWebNavigation (IntPtr instance);\r
\r
[DllImport ("gluezilla")]\r
private static extern IntPtr gluezilla_stringInit ();\r
\r
public delegate void CallbackDelegate ();\r
\r
- public delegate void CallbackDelegateStringString (string arg1, string arg2);\r
+ public delegate void CallbackDelegateString (string arg1);\r
+ public delegate void CallbackDelegateStringString (string arg1, string arg2);\r
public delegate void CallbackDelegateStringInt (string arg1, Int32 arg2);\r
public delegate void CallbackDelegateStringIntInt (string arg1, Int32 arg2, Int32 arg3);\r
public delegate void CallbackDelegateStringIntUint (string arg1, Int32 arg2, UInt32 arg3);\r
\r
\r
- public delegate void CallbackDelegateIntInt (Int32 arg1, Int32 arg2);\r
+ public delegate void CallbackDelegateIntInt (Int32 arg1, Int32 arg2);
+ public delegate void CallbackDelegateIntUint (Int32 arg2, UInt32 arg3);\r
\r
public delegate void CallbackDelegateUint (UInt32 arg1);\r
- public delegate void CallbackDelegateUintInt (UInt32 arg1, Int32 arg2);\r
+ public delegate void CallbackDelegateUintInt (UInt32 arg1, Int32 arg2);\r
\r
public delegate void CallbackDelegatePtrPtr (IntPtr arg1, IntPtr arg2);\r
\r
- //Don't have to worry about marshelling bool, PRBool seems very constant and uses 4 bit int underneath\r
+ //Don't have to worry about marshalling bool, PRBool seems very constant and uses 4 bit int underneath\r
public delegate void CallbackDelegateBool (bool val);
public delegate bool DomKeyCallbackDelegate (KeyInfo keyInfo, ModifierKeys modifiers);
public delegate bool MouseCallbackDelegate (MouseInfo mouseInfo, ModifierKeys modifiers);\r
\r
- public delegate void GetControlSizeCallbackDelegate (ref SizeInfo sz);\r
-\r
- public delegate void GenericCallbackDelegate (IntPtr type);\r
+ public delegate void GenericCallbackDelegate (IntPtr type);\r
\r
public delegate bool CallbackDelegate2 ();\r
- public delegate bool CallbackDelegate2String (string arg1);\r
+ public delegate bool CallbackDelegate2String (string arg1);\r
public delegate bool CallbackDelegate2OnAlertCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);
public delegate bool CallbackDelegate2OnConfirm (IntPtr title, IntPtr text);
- public delegate bool CallbackDelegate2OnConfirmCheck(IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);\r
+ public delegate bool CallbackDelegate2OnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);\r
public delegate bool CallbackDelegate2OnConfirmEx (IntPtr title, IntPtr text, Mono.WebBrowser.DialogButtonFlags flags,
- IntPtr title0, IntPtr title1, IntPtr title2,\r
- IntPtr chkMsg, ref bool chkState, out Int32 retVal);\r
+ IntPtr title0, IntPtr title1, IntPtr title2,\r
+ IntPtr chkMsg, ref bool chkState, out Int32 retVal);\r
public delegate bool CallbackDelegate2OnPrompt (IntPtr title, IntPtr text,\r
- ref IntPtr retVal);\r
+ ref IntPtr retVal);\r
public delegate bool CallbackDelegate2OnPromptUsernameAndPassword \r
- (IntPtr title, IntPtr text,\r
- IntPtr chkMsg, ref bool chkState, \r
- out IntPtr username, out IntPtr password);\r
+ (IntPtr title, IntPtr text,\r
+ IntPtr chkMsg, ref bool chkState, \r
+ out IntPtr username, out IntPtr password);\r
public delegate bool CallbackDelegate2OnPromptPassword\r
- (IntPtr title, IntPtr text,\r
- IntPtr chkMsg, ref bool chkState,
- out IntPtr password);\r
+ (IntPtr title, IntPtr text,\r
+ IntPtr chkMsg, ref bool chkState,
+ out IntPtr password);\r
public delegate bool CallbackDelegate2OnSelect (IntPtr title, IntPtr text,
- UInt32 count, IntPtr list,
- out Int32 retVal);
+ UInt32 count, IntPtr list,
+ out Int32 retVal);
[StructLayout (LayoutKind.Sequential)]
public struct CallbackBinder {
- public CallbackDelegate OnWidgetLoaded;
+ public CallbackDelegate OnWidgetLoaded;
public CallbackDelegate OnJSStatus;
public CallbackDelegate OnLinkStatus;
public CallbackDelegate OnDestroyBrowser;\r
public CallbackDelegate OnFocusNext;
public CallbackDelegate OnFocusPrev;
public CallbackDelegate OnTitleChanged;\r
- public CallbackDelegateStringIntInt OnShowTooltipWindow;
+ public CallbackDelegateStringIntInt OnShowTooltipWindow;
public CallbackDelegate OnHideTooltipWindow;
public CallbackDelegate OnStateNetStart;
public CallbackDelegate OnStateNetStop;\r
public CallbackDelegateUintInt OnStateSpecial;\r
- public CallbackDelegateStringIntUint OnStateChange;\r
+ public CallbackDelegateIntUint OnStateChange;\r
public CallbackDelegateIntInt OnProgress;\r
- public CallbackDelegateStringIntInt OnProgressAll;
- public CallbackDelegate OnLocationChanged;\r
+ public CallbackDelegateStringIntInt OnProgressAll;
+ public CallbackDelegateString OnLocationChanged;\r
public CallbackDelegateStringInt OnStatusChange;\r
- public CallbackDelegateUint OnSecurityChange;\r
- public CallbackDelegateBool OnVisibility;
- public GetControlSizeCallbackDelegate GetControlSize;
+ public CallbackDelegateUint OnSecurityChange;\r
+ public CallbackDelegateBool OnVisibility;
public DomKeyCallbackDelegate OnDomKeyDown;
public DomKeyCallbackDelegate OnDomKeyUp;
public DomKeyCallbackDelegate OnDomKeyPress;
public CallbackDelegate2 OnFocusIn;\r
public CallbackDelegate2 OnFocusOut;\r
public CallbackDelegate2String OnBeforeURIOpen;\r
- public CallbackDelegate OnFocus;\r
+ public CallbackDelegate OnFocus;\r
public CallbackDelegate2 OnCreateNewWindow;\r
public CallbackDelegatePtrPtr OnAlert;
public GenericCallbackDelegate OnGeneric;
internal CallbackBinder (ICallback callback) {
- this.OnWidgetLoaded = new CallbackDelegate (callback.OnWidgetLoaded);
- this.GetControlSize = new GetControlSizeCallbackDelegate (callback.GetControlSize);
- this.OnJSStatus = new CallbackDelegate (callback.OnJSStatus);
+ this.OnWidgetLoaded = new CallbackDelegate (callback.OnWidgetLoaded);
+ this.OnJSStatus = new CallbackDelegate (callback.OnJSStatus);
this.OnLinkStatus = new CallbackDelegate (callback.OnLinkStatus);
this.OnDestroyBrowser = new CallbackDelegate (callback.OnDestroyBrowser);\r
this.OnSizeTo = new CallbackDelegateIntInt (callback.OnClientSizeTo);
this.OnFocusNext = new CallbackDelegate (callback.OnFocusNext);
this.OnFocusPrev = new CallbackDelegate (callback.OnFocusPrev);
- this.OnTitleChanged = new CallbackDelegate (callback.OnTitleChanged);\r
+ this.OnTitleChanged = new CallbackDelegate (callback.OnTitleChanged);\r
this.OnShowTooltipWindow = new CallbackDelegateStringIntInt (callback.OnShowTooltipWindow);
this.OnHideTooltipWindow = new CallbackDelegate (callback.OnHideTooltipWindow);
this.OnStateNetStart = new CallbackDelegate (callback.OnStateNetStart);
- this.OnStateNetStop = new CallbackDelegate (callback.OnStateNetStop);\r
- this.OnStateSpecial = new CallbackDelegateUintInt (callback.OnStateSpecial);\r
- this.OnStateChange = new CallbackDelegateStringIntUint (callback.OnStateChange);\r
- this.OnProgress = new CallbackDelegateIntInt (callback.OnProgress);\r
+ this.OnStateNetStop = new CallbackDelegate (callback.OnStateNetStop);\r
+ this.OnStateSpecial = new CallbackDelegateUintInt (callback.OnStateSpecial);\r
+ this.OnStateChange = new CallbackDelegateIntUint (callback.OnStateChange);\r
+ this.OnProgress = new CallbackDelegateIntInt (callback.OnProgress);\r
this.OnProgressAll = new CallbackDelegateStringIntInt (callback.OnProgressAll);
- this.OnLocationChanged = new CallbackDelegate (callback.OnLocationChanged);\r
- this.OnStatusChange = new CallbackDelegateStringInt (callback.OnStatusChange);\r
+ this.OnLocationChanged = new CallbackDelegateString (callback.OnLocationChanged);\r
+ this.OnStatusChange = new CallbackDelegateStringInt (callback.OnStatusChange);\r
this.OnSecurityChange = new CallbackDelegateUint (callback.OnSecurityChange);\r
this.OnVisibility = new CallbackDelegateBool (callback.OnVisibility);
this.OnDomKeyDown = new DomKeyCallbackDelegate (callback.OnClientDomKeyDown);
- this.OnDomKeyUp = new DomKeyCallbackDelegate (callback.OnClientDomKeyUp);
+ this.OnDomKeyUp = new DomKeyCallbackDelegate (callback.OnClientDomKeyUp);
this.OnDomKeyPress = new DomKeyCallbackDelegate (callback.OnClientDomKeyPress);
this.OnMouseDown = new MouseCallbackDelegate (callback.OnClientMouseDown);
this.OnMouseUp = new MouseCallbackDelegate (callback.OnClientMouseUp);
this.OnMouseClick = new MouseCallbackDelegate (callback.OnClientMouseClick);
- this.OnMouseDoubleClick = new MouseCallbackDelegate (callback.OnClientMouseDoubleClick);
+ this.OnMouseDoubleClick = new MouseCallbackDelegate (callback.OnClientMouseDoubleClick);
this.OnMouseOver = new MouseCallbackDelegate (callback.OnClientMouseOver);
- this.OnMouseOut = new MouseCallbackDelegate (callback.OnClientMouseOut);\r
- this.OnActivate = new CallbackDelegate2 (callback.OnClientActivate);\r
+ this.OnMouseOut = new MouseCallbackDelegate (callback.OnClientMouseOut);\r
+ this.OnActivate = new CallbackDelegate2 (callback.OnClientActivate);\r
this.OnFocusIn = new CallbackDelegate2 (callback.OnClientFocusIn);\r
- this.OnFocusOut = new CallbackDelegate2 (callback.OnClientFocusOut);\r
+ this.OnFocusOut = new CallbackDelegate2 (callback.OnClientFocusOut);\r
this.OnBeforeURIOpen = new CallbackDelegate2String (callback.OnBeforeURIOpen);\r
this.OnFocus = new CallbackDelegate (callback.OnFocus);\r
this.OnCreateNewWindow = new CallbackDelegate2 (callback.OnCreateNewWindow);\r
this.OnAlert = new CallbackDelegatePtrPtr (callback.OnAlert);\r
\r
- this.OnAlertCheck= new CallbackDelegate2OnAlertCheck (callback.OnAlertCheck);\r
- this.OnConfirm = new CallbackDelegate2OnConfirm (callback.OnConfirm);\r
- this.OnConfirmCheck = new CallbackDelegate2OnConfirmCheck (callback.OnConfirmCheck);\r
- this.OnConfirmEx = new CallbackDelegate2OnConfirmEx (callback.OnConfirmEx);\r
- this.OnPrompt = new CallbackDelegate2OnPrompt (callback.OnPrompt);\r
+ this.OnAlertCheck = new CallbackDelegate2OnAlertCheck (callback.OnAlertCheck);\r
+ this.OnConfirm = new CallbackDelegate2OnConfirm (callback.OnConfirm);\r
+ this.OnConfirmCheck = new CallbackDelegate2OnConfirmCheck (callback.OnConfirmCheck);\r
+ this.OnConfirmEx = new CallbackDelegate2OnConfirmEx (callback.OnConfirmEx);\r
+ this.OnPrompt = new CallbackDelegate2OnPrompt (callback.OnPrompt);\r
this.OnPromptUsernameAndPassword = new CallbackDelegate2OnPromptUsernameAndPassword (callback.OnPromptUsernameAndPassword);\r
- this.OnPromptPassword = new CallbackDelegate2OnPromptPassword (callback.OnPromptPassword);\r
- this.OnSelect = new CallbackDelegate2OnSelect (callback.OnSelect);
+ this.OnPromptPassword = new CallbackDelegate2OnPromptPassword (callback.OnPromptPassword);\r
+ this.OnSelect = new CallbackDelegate2OnSelect (callback.OnSelect);
\r
\r
this.OnGeneric = new GenericCallbackDelegate (callback.OnGeneric);\r
this.document.setTitle (storage);\r
}\r
}\r
+\r
+ public string Url {\r
+ get\r
+ {\r
+ this.document.getURL (storage);\r
+ return Base.StringGet (storage);\r
+ }\r
+ }\r
+\r
public IDOMHTMLElement getElementById (string id)\r
{\r
nsIDOMElement nsElement;\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using System.Text;\r
+using Mono.WebBrowser;\r
+using Mono.WebBrowser.DOM;\r
+\r
+namespace Mono.Mozilla.DOM\r
+{\r
+ internal class Navigation: INavigation\r
+ {\r
+\r
+ private nsIWebNavigation webNav;\r
+ private IWebBrowser control;\r
+ public Navigation (IWebBrowser control, nsIWebNavigation webNav)\r
+ {\r
+ this.webNav = webNav;\r
+ this.control = control;\r
+ }\r
+\r
+ #region INavigation Members\r
+\r
+ public bool CanGoBack {\r
+ get {\r
+ bool canGoBack;\r
+ webNav.CanGoBack (out canGoBack);\r
+ return canGoBack;\r
+ }\r
+ }\r
+\r
+ public bool CanGoForward {\r
+ get {\r
+ bool canGoForward;\r
+ webNav.CanGoForward (out canGoForward);\r
+ return canGoForward;\r
+ }\r
+ }\r
+\r
+ public bool Back ()\r
+ {\r
+ return Base.Back (control);\r
+ }\r
+\r
+ public bool Forward ()\r
+ {\r
+ return Base.Forward (control);\r
+ }\r
+\r
+ public void Home ()\r
+ {\r
+ Base.Home (control);\r
+ }\r
+\r
+ public void Reload ()\r
+ {\r
+ Base.Reload (control, ReloadOption.None);\r
+ }\r
+\r
+ public void Reload (ReloadOption option)\r
+ {\r
+ Base.Reload (control, option);\r
+ }\r
+\r
+ public void Stop ()\r
+ {\r
+ Base.Stop (control);\r
+ }\r
+\r
+ #endregion\r
+ }\r
+}\r
{\r
internal interface ICallback\r
{\r
- void OnWidgetLoaded ();\r
+ void OnWidgetLoaded ();\r
\r
- void GetControlSize (ref SizeInfo sz);\r
- void OnJSStatus ();\r
+ void OnJSStatus ();\r
void OnLinkStatus ();\r
void OnDestroyBrowser ();\r
- void OnClientSizeTo (Int32 width, Int32 height);\r
+ void OnClientSizeTo (Int32 width, Int32 height);\r
void OnFocusNext ();\r
void OnFocusPrev ();\r
- void OnTitleChanged ();\r
+ void OnTitleChanged ();\r
void OnShowTooltipWindow (string tiptext, Int32 x, Int32 y);\r
void OnHideTooltipWindow ();\r
void OnStateNetStart ();\r
- void OnStateNetStop ();\r
- void OnStateSpecial (UInt32 stateFlags, Int32 status);\r
- void OnStateChange (string URI, Int32 status, UInt32 stateFlags);\r
- void OnProgress (Int32 currentTotalProgress, Int32 maxTotalProgress);\r
+ void OnStateNetStop ();\r
+ void OnStateSpecial (UInt32 stateFlags, Int32 status);\r
+ void OnStateChange (Int32 status, UInt32 state);\r
+ void OnProgress (Int32 currentTotalProgress, Int32 maxTotalProgress);\r
void OnProgressAll (string URI, Int32 currentTotalProgress, Int32 maxTotalProgress);\r
- void OnLocationChanged ();\r
- void OnStatusChange (string message, Int32 status);\r
+ void OnLocationChanged (string URI);\r
+ void OnStatusChange (string message, Int32 status);\r
void OnSecurityChange (UInt32 state);\r
void OnVisibility (bool val);\r
\r
//Don't have to worry about marshelling bool, bool seems very constant and uses 4 bit int underneath\r
- bool OnClientDomKeyDown (KeyInfo keyInfo, ModifierKeys modKey);\r
+ bool OnClientDomKeyDown (KeyInfo keyInfo, ModifierKeys modKey);\r
bool OnClientDomKeyUp (KeyInfo keyInfo, ModifierKeys modKey);\r
bool OnClientDomKeyPress (KeyInfo keyInfo, ModifierKeys modKey);\r
\r
bool OnClientMouseDown (MouseInfo mouseInfo, ModifierKeys modifiers);\r
bool OnClientMouseUp (MouseInfo mouseInfo, ModifierKeys modifiers);\r
- bool OnClientMouseClick (MouseInfo mouseInfo, ModifierKeys modifiers);\r
+ bool OnClientMouseClick (MouseInfo mouseInfo, ModifierKeys modifiers);\r
bool OnClientMouseDoubleClick (MouseInfo mouseInfo, ModifierKeys modifiers);\r
bool OnClientMouseOver (MouseInfo mouseInfo, ModifierKeys modifiers);\r
bool OnClientMouseOut (MouseInfo mouseInfo, ModifierKeys modifiers);\r
void OnAlert (IntPtr title, IntPtr text);\r
bool OnAlertCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);
bool OnConfirm (IntPtr title, IntPtr text);
- bool OnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);\r
+ bool OnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);\r
\r
bool OnConfirmEx (IntPtr title, IntPtr text, Mono.WebBrowser.DialogButtonFlags flags,
IntPtr title0, IntPtr title1, IntPtr title2,\r
public UInt32 charCode;\r
public UInt32 keyCode;\r
}
+
+ [Flags]
+ internal enum StateFlags
+ {
+ Start = 1,
+ Redirecting = 2,
+ Transferring = 4,
+ Negotiating = 8,
+ Stop = 16,
+ IsRequest = 65536,
+ IsDocument = 131072,
+ IsNetwork = 262144,
+ IsWindow = 524288,
+ Restoring = 16777216,
+ IsInsecure = 4,
+ IsBroken = 1,
+ IsSecure = 2,
+ SecureHigh = 262144,
+ SecureMed = 65536,
+ SecureLow = 131072
+ }
\r
}\r
{\r
private bool loaded;\r
private IDOMHTMLDocument document;\r
+ private INavigation navigation;\r
\r
public WebBrowser ()\r
{\r
}\r
}\r
\r
+ public INavigation Navigation\r
+ {\r
+ get\r
+ {\r
+ if (navigation == null) {\r
+ nsIWebNavigation webNav = Base.GetWebNavigation (this);\r
+ navigation = new DOM.Navigation (this, webNav);\r
+ }\r
+ return navigation;\r
+ }\r
+ }\r
\r
#region Layout\r
public void FocusIn (FocusOption focus)\r
Base.Resize (this, width, height);\r
}\r
\r
- #endregion\r
-\r
- #region Navigation\r
- public void Navigate (string uri)\r
+ public void Navigate (string url)\r
{\r
- Base.Navigate (this, uri);\r
+ this.document = null;\r
+ this.navigation = null;\r
+ Base.Navigate (this, url);\r
}\r
\r
- /// <summary>\r
- /// Navigate to the next page in history\r
- /// </summary>\r
- /// <returns>False if it can't navigate forward</returns>\r
- public bool Forward ()\r
- {\r
- return Base.Forward (this);\r
- }\r
-\r
- /// <summary>\r
- /// Navigate to the previous page in history\r
- /// </summary>\r
- /// <returns>False if it can't navigate back</returns>\r
- public bool Back ()\r
- {\r
- return Base.Back (this);\r
- }\r
-\r
- public void Home ()\r
- {\r
- Base.Home (this);\r
- }\r
-\r
- /// <summary>\r
- /// Stop all activity\r
- /// </summary>\r
- public void Stop ()\r
- {\r
- Base.Stop (this);\r
- }\r
-\r
- /// <summary>\r
- /// Reload the current page in the browser\r
- /// </summary>\r
- public void Reload ()\r
- {\r
- Base.Reload (this, ReloadOption.None);\r
- }\r
-\r
- public void Reload (ReloadOption option)\r
- {\r
- Base.Reload (this, option);\r
- }\r
#endregion\r
\r
-\r
-\r
#region Events\r
static object KeyDownEvent = new object ();\r
public event EventHandler KeyDown\r
remove { Events.RemoveHandler (AlertEvent, value); }\r
}\r
\r
+
+ static object NavigatedEvent = new object ();\r
+ public event EventHandler Navigated\r
+ {\r
+ add { Events.AddHandler (NavigatedEvent, value); }\r
+ remove { Events.RemoveHandler (NavigatedEvent, value); }\r
+ }\r
+
#endregion\r
\r
\r
// loaded = true;\r
}\r
\r
-\r
- public void GetControlSize (ref SizeInfo sz)\r
- {\r
- // TODO: Add WebBrowser.GetControlSize implementation\r
- }\r
-\r
public void OnJSStatus ()\r
{\r
// TODO: Add WebBrowser.OnJSStatus implementation\r
// TODO: Add WebBrowser.OnStateSpecial implementation\r
}\r
\r
- public void OnStateChange (string URI, Int32 status, UInt32 stateFlags)\r
+ public void OnStateChange (Int32 status, UInt32 state)\r
{\r
- // TODO: Add WebBrowser.OnStateChange implementation\r
+ //if ((state & (uint) StateFlags.Start) != 0 && (state & (uint) StateFlags.IsDocument) != 0)
+ //{\r
+ // EventHandler eh = (EventHandler) (Events[NavigatedEvent]);\r
+ // if (eh != null) {\r
+ // EventArgs e = new EventArgs ();\r
+ // eh (this, e);\r
+ // }
+ //}\r
}\r
\r
public void OnProgress (Int32 currentTotalProgress, Int32 maxTotalProgress)\r
// TODO: Add WebBrowser.OnProgressAll implementation\r
}\r
\r
- public void OnLocationChanged ()\r
+ public void OnLocationChanged (string uri)\r
{\r
- // TODO: Add WebBrowser.OnLocationChanged implementation\r
+ EventHandler eh = (EventHandler) (Events[NavigatedEvent]);\r
+ if (eh != null) {\r
+ EventArgs e = new EventArgs ();\r
+ eh (this, e);\r
+ }\r
}\r
\r
public void OnStatusChange (string message, Int32 status)\r
\r
public bool OnAlertCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState)\r
{\r
- Console.WriteLine ("alert check");\r
AlertEventHandler eh = (AlertEventHandler) (Events[AlertEvent]);\r
if (eh != null) {\r
AlertEventArgs e = new AlertEventArgs ();\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("a41661d4-1417-11d5-9882-00c04fa02f40")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsIHistoryEntry\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetURI ([MarshalAs (UnmanagedType.Interface)] out nsIURI aURI);\r
+\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetTitle (StringBuilder aTitle);\r
+\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetIsSubFrame (out bool aIsSubFrame);\r
+ }\r
+}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+/***\r
+ * From nsIInputStream.h:\r
+ * \r
+ * The signature of the writer function passed to ReadSegments. This\r
+ * is the "consumer" of data that gets read from the stream's buffer.\r
+ *\r
+ * @param aInStream stream being read\r
+ * @param aClosure opaque parameter passed to ReadSegments\r
+ * @param aFromSegment pointer to memory owned by the input stream\r
+ * @param aToOffset amount already read (since ReadSegments was called)\r
+ * @param aCount length of fromSegment\r
+ * @param aWriteCount number of bytes read\r
+ *\r
+ * Implementers should return the following:\r
+ *\r
+ * @return NS_OK and (*aWriteCount > 0) if consumed some data\r
+ * @return <any-error> if not interested in consuming any data\r
+ *\r
+ * Errors are never passed to the caller of ReadSegments.\r
+ *\r
+ * NOTE: returning NS_OK and (*aWriteCount = 0) has undefined behavior.\r
+ *\r
+ * @status FROZEN\r
+ * typedef NS_CALLBACK(nsWriteSegmentFun)(nsIInputStream *aInStream,\r
+ void *aClosure,\r
+ const char *aFromSegment,\r
+ PRUint32 aToOffset,\r
+ PRUint32 aCount,\r
+ PRUint32 *aWriteCount);\r
+*/\r
+\r
+\r
+using System;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("fa9c7f6c-61b3-11d4-9877-00c04fa0cf4a")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsIInputStream\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Close ();\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Available (out UInt32 _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Read (StringBuilder aBuf, UInt32 aCount, out UInt32 _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int ReadSegments (IntPtr aWriter, IntPtr aClosure, UInt32 aCount, out UInt32 _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int IsNonBlocking (out bool _retval);\r
+ }\r
+}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("7294fe9b-14d8-11d5-9882-00c04fa02f40")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsISHistory\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetCount (out Int32 aCount);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetIndex (out Int32 aIndex);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetMaxLength (out Int32 aMaxLength);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetMaxLength (Int32 aMaxLength);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetEntryAtIndex (Int32 index, bool modifyIndex,\r
+ [MarshalAs (UnmanagedType.Interface)] out nsIHistoryEntry _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int PurgeHistory (Int32 numEntries);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int AddSHistoryListener ([MarshalAs (UnmanagedType.Interface)] nsISHistoryListener aListener);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int RemoveSHistoryListener ([MarshalAs (UnmanagedType.Interface)] nsISHistoryListener aListener);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetSHistoryEnumerator ([MarshalAs (UnmanagedType.Interface)] out nsISimpleEnumerator aSHistoryEnumerator);\r
+ }\r
+}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("d1899240-f9d2-11d2-bdd6-000064657374")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsISHistoryListener\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int OnHistoryNewEntry ([MarshalAs (UnmanagedType.Interface)] nsIURI aNewURI);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int OnHistoryGoBack ([MarshalAs (UnmanagedType.Interface)] nsIURI aBackURI, out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int OnHistoryGoForward ([MarshalAs (UnmanagedType.Interface)] nsIURI aForwardURI, out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int OnHistoryReload ([MarshalAs (UnmanagedType.Interface)] nsIURI aReloadURI, UInt32 aReloadFlags, out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int OnHistoryGotoIndex (Int32 aIndex, [MarshalAs (UnmanagedType.Interface)] nsIURI aGotoURI, out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int OnHistoryPurge (Int32 aNumEntries, out bool _retval);\r
+ }\r
+}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("d1899240-f9d2-11d2-bdd6-000064657374")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsISimpleEnumerator\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int HasMoreElements (out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetNext (out IntPtr _retval); \r
+ }\r
+}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("07a22cc0-0ce5-11d3-9331-00104ba0fd40")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsIURI\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetSpec (HandleRef aSpec);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetSpec (HandleRef aSpec);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetPrePath (HandleRef aPrePath);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetScheme (HandleRef aScheme);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetScheme (HandleRef aScheme);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetUserPass (HandleRef aUserPass);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetUserPass (HandleRef aUserPass);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetUsername (HandleRef aUsername);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetUsername (HandleRef aUsername);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetPassword (HandleRef aPassword);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetPassword (HandleRef aPassword);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetHostPort (HandleRef aHostPort);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetHostPort (HandleRef aHostPort);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetHost (HandleRef aHost);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetHost (HandleRef aHost);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetPort (out Int32 aPort);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetPort (Int32 aPort);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetPath (HandleRef aPath);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetPath (HandleRef aPath);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Equals ([MarshalAs (UnmanagedType.Interface)] nsIURI other, out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SchemeIs (string scheme, out bool _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Clone ([MarshalAs (UnmanagedType.Interface)] out nsIURI _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Resolve (HandleRef relativePath, HandleRef _retval);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetAsciiSpec (HandleRef aAsciiSpec);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetAsciiHost (HandleRef aAsciiHost);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetOriginCharset (HandleRef aOriginCharset);\r
+ }\r
+}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.CompilerServices;\r
+\r
+namespace Mono.Mozilla\r
+{\r
+\r
+ [Guid ("f5d9e7b0-d930-11d3-b057-00a024ffc08c")]\r
+ [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]\r
+ [ComImport ()]\r
+ internal interface nsIWebNavigation\r
+ {\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int CanGoBack (out bool canGoBack);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int CanGoForward (out bool canGoForward);\r
+\r
+ /// <summary>\r
+ /// Do not use on non-windows platforms due to threading problems\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GoBack ();\r
+\r
+ /// <summary>\r
+ /// Do not use on non-windows platforms due to threading problems\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GoForward ();\r
+\r
+ /// <summary>\r
+ /// Do not use on non-windows platforms due to threading problems\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GotoIndex (Int32 index);\r
+\r
+ /// <summary>\r
+ /// Do not use on non-windows platforms due to threading problems\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int LoadURI (string uri, UInt32 loadFlags,\r
+ [MarshalAs (UnmanagedType.Interface)] nsIURI referrer,\r
+ [MarshalAs (UnmanagedType.Interface)] nsIInputStream postData,\r
+ [MarshalAs (UnmanagedType.Interface)] nsIInputStream headers);\r
+\r
+ /// <summary>\r
+ /// Do not use on non-windows platforms due to threading problems\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Reload (UInt32 reloadFlags);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int Stop (UInt32 stopFlags);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetDocument ([MarshalAs (UnmanagedType.Interface)] out nsIDOMDocument document);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetCurrentURI ([MarshalAs (UnmanagedType.Interface)] out nsIURI currentURI);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetReferringURI ([MarshalAs (UnmanagedType.Interface)] out nsIURI referringURI);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int GetSessionHistory ([MarshalAs (UnmanagedType.Interface)] out nsISHistory sessionHistory);\r
+\r
+ [PreserveSigAttribute]\r
+ [MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]\r
+ int SetSessionHistory ([MarshalAs (UnmanagedType.Interface)] nsISHistory sessionHistory);\r
+\r
+ }\r
+}\r
{\r
IDOMHTMLElement Body { get; }\r
string Title { get; set;}\r
+ string Url { get; }\r
IDOMHTMLElement getElementById (string id);\r
}\r
}\r
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+// Copyright (c) 2007 Novell, Inc.\r
+//\r
+// Authors:\r
+// Andreia Gaita (avidigal@novell.com)\r
+//\r
+\r
+using System;\r
+using Mono.WebBrowser;\r
+\r
+namespace Mono.WebBrowser.DOM\r
+{\r
+ public interface INavigation\r
+ {\r
+ bool CanGoBack { get; }\r
+ bool CanGoForward { get; }\r
+ bool Back ();\r
+ bool Forward ();\r
+ void Home ();\r
+ void Reload ();\r
+ void Reload (ReloadOption option);\r
+ void Stop ();\r
+ }\r
+}\r
void Activate ();\r
void Deactivate ();\r
void Resize (int width, int height);\r
- void Navigate (string uri);\r
- bool Forward ();\r
- bool Back ();\r
- void Home ();\r
- void Stop ();\r
- void Reload ();\r
- void Reload (ReloadOption option);\r
-\r
+ void Navigate (string url);\r
\r
IDOMHTMLDocument Document { get; }\r
-\r
+ INavigation Navigation { get; }\r
\r
event EventHandler KeyDown;\r
event EventHandler KeyPress;\r
event EventHandler Focus;\r
event CreateNewWindowEventHandler CreateNewWindow;\r
event AlertEventHandler Alert;\r
+ event EventHandler Navigated;\r
}
public enum ReloadOption\r