-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-//\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-//\r
-[assembly: AssemblyTitle("Mono.WebBrowser")]\r
-[assembly: AssemblyDescription("Managed Wrapper for xulrunner engine, to support WebBrowser")]\r
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("Mono.WebBrowser")]
+[assembly: AssemblyDescription("Managed Wrapper for xulrunner engine, to support WebBrowser")]
[assembly: AssemblyConfiguration("Development version")]
-[assembly: AssemblyCompany("MONO development team")]\r
-[assembly: AssemblyProduct("Mono.WebBrowser")]\r
-[assembly: AssemblyCopyright("(c) 2007, 2008 Andreia Gaita")]\r
-[assembly: AssemblyTrademark("")]\r
-\r
-//\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-// Major Version\r
-// Minor Version \r
-// Build Number\r
-// Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-\r
-[assembly: AssemblyVersion("0.5.0.0")]\r
-\r
-//\r
-// In order to sign your assembly you must specify a key to use. Refer to the \r
-// Microsoft .NET Framework documentation for more information on assembly signing.\r
-//\r
-// Use the attributes below to control which key is used for signing. \r
-//\r
-// Notes: \r
-// (*) If no key is specified, the assembly is not signed.\r
-// (*) KeyName refers to a key that has been installed in the Crypto Service\r
-// Provider (CSP) on your machine. KeyFile refers to a file which contains\r
-// a key.\r
-// (*) If the KeyFile and the KeyName values are both specified, the \r
-// following processing occurs:\r
-// (1) If the KeyName can be found in the CSP, that key is used.\r
-// (2) If the KeyName does not exist and the KeyFile does exist, the key \r
-// in the KeyFile is installed into the CSP and used.\r
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.\r
-// When specifying the KeyFile, the location of the KeyFile should be\r
-// relative to the project output directory which is\r
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is\r
-// located in the project directory, you would specify the AssemblyKeyFile \r
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]\r
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework\r
-// documentation for more information on this.\r
-//\r
+[assembly: AssemblyCompany("MONO development team")]
+[assembly: AssemblyProduct("Mono.WebBrowser")]
+[assembly: AssemblyCopyright("(c) 2007, 2008 Andreia Gaita")]
+[assembly: AssemblyTrademark("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("0.5.0.0")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../mono.snk")]
+2008-08-19 Andreia Gaita <avidigal@novell.com>
+
+ * Assembly/AssemblyInfo.cs, ChangeLog,
+ Mono.WebBrowser/DOM/IAttribute.cs,
+ Mono.WebBrowser/DOM/IElementCollection.cs,
+ Mono.WebBrowser/DOM/IWindow.cs, Mono.WebBrowser/DOM/IDocument.cs,
+ Mono.WebBrowser/DOM/IAttributeCollection.cs,
+ Mono.WebBrowser/DOM/INodeList.cs,
+ Mono.WebBrowser/DOM/IWindowCollection.cs,
+ Mono.WebBrowser/DOM/INode.cs, Mono.WebBrowser/DOM/IElement.cs,
+ Mono.WebBrowser/DOM/INavigation.cs,
+ Mono.WebBrowser/DOM/IHistory.cs, Mono.WebBrowser/Exception.cs,
+ Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/DOM/Document.cs,
+ Mono.Mozilla/DOM/HTMLElement.cs,
+ Mono.Mozilla/DOM/AttributeCollection.cs,
+ Mono.Mozilla/DOM/DocumentType.cs, Mono.Mozilla/DOM/NodeList.cs,
+ Mono.Mozilla/DOM/WindowCollection.cs, Mono.Mozilla/DOM/Node.cs,
+ Mono.Mozilla/DOM/NamedNodeMap.cs, Mono.Mozilla/DOM/Element.cs,
+ Mono.Mozilla/DOM/HTMLElementCollection.cs,
+ Mono.Mozilla/DOM/Navigation.cs, Mono.Mozilla/DOM/History.cs,
+ Mono.Mozilla/DOM/Attribute.cs, Mono.Mozilla/DOM/DOMObject.cs,
+ Mono.Mozilla/DOM/Window.cs, Mono.Mozilla/Callback.cs,
+ Mono.Mozilla/AsciiString.cs, Mono.Mozilla/WebBrowser.cs,
+ Mono.Mozilla/UniString.cs, Mono.Mozilla/Base.cs: Fix inconsistent
+ newlines. Add eol-style property.
+
+2008-08-19 Andreia Gaita <avidigal@novell.com>
+
+ * Assembly/AssemblyInfo.cs, ChangeLog,
+ Mono.WebBrowser/DOM/IAttribute.cs,
+ Mono.WebBrowser/DOM/IElementCollection.cs,
+ Mono.WebBrowser/DOM/IWindow.cs, Mono.WebBrowser/DOM/IDocument.cs,
+ Mono.WebBrowser/DOM/IAttributeCollection.cs,
+ Mono.WebBrowser/DOM/INodeList.cs,
+ Mono.WebBrowser/DOM/IWindowCollection.cs,
+ Mono.WebBrowser/DOM/INode.cs, Mono.WebBrowser/DOM/IElement.cs,
+ Mono.WebBrowser/DOM/INavigation.cs,
+ Mono.WebBrowser/DOM/IHistory.cs, Mono.WebBrowser/Exception.cs,
+ Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/DOM/Document.cs,
+ Mono.Mozilla/DOM/HTMLElement.cs,
+ Mono.Mozilla/DOM/AttributeCollection.cs,
+ Mono.Mozilla/DOM/DocumentType.cs, Mono.Mozilla/DOM/NodeList.cs,
+ Mono.Mozilla/DOM/WindowCollection.cs, Mono.Mozilla/DOM/Node.cs,
+ Mono.Mozilla/DOM/NamedNodeMap.cs, Mono.Mozilla/DOM/Element.cs,
+ Mono.Mozilla/DOM/HTMLElementCollection.cs,
+ Mono.Mozilla/DOM/Navigation.cs, Mono.Mozilla/DOM/History.cs,
+ Mono.Mozilla/DOM/Attribute.cs, Mono.Mozilla/DOM/DOMObject.cs,
+ Mono.Mozilla/DOM/Window.cs, Mono.Mozilla/Callback.cs,
+ Mono.Mozilla/AsciiString.cs, Mono.Mozilla/WebBrowser.cs,
+ Mono.Mozilla/UniString.cs, Mono.Mozilla/Base.cs: Fix inconsistent
+ newlines. Add eol-style property
+
2008-06-11 Andreia Gaita <avidigal@novell.com>
* Mono.Mozilla/DOM/Attribute.cs: Fix missing setter
gluezilla_init is only called once for every app run (no matter how
many browser windows end up being created).
-2008-04-04 Andreia Gaita <avidigal@novell.com> \r
-\r
- * Mono.Mozilla/DOM/Element.cs,\r
- * Mono.Mozilla/DOM/HTMLElement.cs,\r
+2008-04-04 Andreia Gaita <avidigal@novell.com>
+
+ * Mono.Mozilla/DOM/Element.cs,
+ * Mono.Mozilla/DOM/HTMLElement.cs,
* Mono.WebBrowser/DOM/IElement.cs: Implement ClientWidth, ClientHeight,
ScrollWidth, ScrollHeight, ScrollLeft, ScrollTop, OffsetHeight,
OffsetWidth, OffsetLeft, OffsetTop, OffsetParent, Disabled.
2008-04-04 Andreia Gaita <avidigal@novell.com>
-\r
- * Mono.Mozilla/DOM/Document.cs: Differentiate between html and non-html\r
+
+ * Mono.Mozilla/DOM/Document.cs: Differentiate between html and non-html
elements when creating the wrapper object for the active element, as
certain properties are only implemented in html elements.
* Mono.WebBrowser/DOM/IDocument.cs, Mono.Mozilla/DOM/Document.cs:
Implemented: Active, ActiveLinkColor, Anchors, Applets, Background, BackColor,
Charset, Cookie, Domain, ForeColor, Forms, Images, LinkColor, Links,
- VisitedLinkColor, GetElement, Equals, GetHashCode\r
+ VisitedLinkColor, GetElement, Equals, GetHashCode
* Mono.WebBrowser/DOM/IElement.cs, Mono.Mozilla/DOM/Element.cs:
Implemented: Children, TagName, AppendChild, Equals, GetElementsByTagName,
refreshing a page after an encoding change.
* Mono.WebBrowser/DOM/INode.cs, Mono.Mozilla/DOM/Node.cs:
- Implement: InsertBefore, LastChild, Next, Owner, Parent, Previous, GetHashCode\r
+ Implement: InsertBefore, LastChild, Next, Owner, Parent, Previous, GetHashCode
* Mono.WebBrowser/DOM/INodeList.cs, Mono.Mozilla/DOM/NodeList.cs:
Fix header. Implement GetHashCode. Add support for creating empty
* Mono.Mozilla/interfaces/nsIDOMNSHTMLElement.cs: Added. Interface to
access the InnerHtml property of an element.
-2008-01-09 Andreia Gaita <avidigal@novell.com>\r
-\r
+2008-01-09 Andreia Gaita <avidigal@novell.com>
+
* Mono.Mozilla/Base.cs,
Mono.Mozilla/WebBrowser.cs,
Mono.WebBrowser/IWebBrowser.cs,
gluezilla a gtk handle and not an X/HWND handle). This should make it
easy to also use gluezilla/Mono.Mozilla with gtk apps.
-2008-01-09 Andreia Gaita <avidigal@novell.com>\r
-\r
- * build-csproj2k5: take out weird characters creeping in, vstudio \r
+2008-01-09 Andreia Gaita <avidigal@novell.com>
+
+ * build-csproj2k5: take out weird characters creeping in, vstudio
doesn't appreciate them.
2008-01-07 Andreia Gaita <avidigal@novell.com>
2007-06-18 Andreia Gaita <avidigal@novell.com>
- * initial checkin.
\ No newline at end of file
+ * initial checkin.
String = value;
}
- ~AsciiString ()\r
+ ~AsciiString ()
{
- Dispose (false);\r
+ Dispose (false);
}
- #region IDisposable Members\r
+ #region IDisposable Members
protected virtual void Dispose (bool disposing)
{
disposed = true;
}
}
-\r
- public void Dispose ()\r
- {\r
+
+ public void Dispose ()
+ {
Dispose (true);
- GC.SuppressFinalize (this);\r
- }\r
-\r
- #endregion\r
+ GC.SuppressFinalize (this);
+ }
+
+ #endregion
public HandleRef Handle {
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
-using System.Text;\r
-using System.Collections;\r
-using System.Runtime.InteropServices;\r
-using System.Diagnostics;\r
-using Mono.WebBrowser;\r
-\r
-namespace Mono.Mozilla\r
-{\r
- internal class Base\r
- {\r
- private static Hashtable boundControls;\r
- internal static bool gluezillaInstalled;\r
- internal static bool initialized;\r
-\r
- private class BindingInfo\r
- {\r
- public CallbackBinder callback;\r
- public IntPtr gluezilla;\r
- }\r
-\r
- private static bool isInitialized ()\r
- {\r
- if (!gluezillaInstalled)\r
- return false;\r
- return true;\r
- }\r
-\r
- private static BindingInfo getBinding (IWebBrowser control)\r
- {\r
- if (!boundControls.ContainsKey (control))\r
- return null;\r
- BindingInfo info = boundControls[control] as BindingInfo;\r
- return info;\r
- }\r
-\r
- static Base ()\r
- {\r
- boundControls = new Hashtable ();\r
- }\r
-\r
- public Base () { }\r
-\r
- public static void Debug (int signal)\r
- {\r
- gluezilla_debug (signal);\r
- }\r
- \r
- public static bool Init (WebBrowser control, Platform platform)\r
- {\r
- if (!initialized) {\r
- \r
- string monoMozDir = System.IO.Path.Combine (\r
- System.IO.Path.Combine (\r
- Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData),\r
- ".mono"), "mozilla");\r
- \r
- if (!System.IO.Directory.Exists (monoMozDir))\r
- System.IO.Directory.CreateDirectory (monoMozDir);\r
- \r
- Platform mozPlatform;\r
- try {\r
- gluezilla_init (platform, out mozPlatform);\r
- }\r
- catch (DllNotFoundException) {\r
- Console.WriteLine ("libgluezilla not found. To have webbrowser support, you need libgluezilla installed");\r
- gluezillaInstalled = false;\r
- initialized = false;\r
- return false;\r
- }\r
- control.enginePlatform = mozPlatform;\r
- gluezillaInstalled = true;\r
- initialized = true;\r
- }\r
- return initialized;\r
- }\r
-\r
- public static void Bind (WebBrowser control, IntPtr handle, int width, int height)\r
- {\r
- if (!isInitialized ())\r
- return;\r
-\r
- BindingInfo info = new BindingInfo ();\r
- info.callback = new CallbackBinder (control.callbacks);\r
- IntPtr ptrCallback = Marshal.AllocHGlobal (Marshal.SizeOf (info.callback));\r
- Marshal.StructureToPtr (info.callback, ptrCallback, true);\r
- \r
- string monoMozDir = System.IO.Path.Combine (\r
- System.IO.Path.Combine (\r
- Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData),\r
- ".mono"), "mozilla");\r
- info.gluezilla = gluezilla_createBrowserWindow (ptrCallback, handle, width, height, Environment.CurrentDirectory, monoMozDir, control.platform);\r
- \r
- boundControls.Add (control as IWebBrowser, info);\r
- \r
- }\r
-\r
- public static void Shutdown (IWebBrowser control)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_shutdown (info.gluezilla);\r
- }\r
-\r
- // layout\r
- public static void Focus (IWebBrowser control, FocusOption focus)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_focus (info.gluezilla, focus);\r
- }\r
-\r
-\r
- public static void Blur (IWebBrowser control)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_blur (info.gluezilla);\r
- }\r
-\r
- public static void Activate (IWebBrowser control)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_activate (info.gluezilla);\r
- }\r
-\r
- public static void Deactivate (IWebBrowser control)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_deactivate (info.gluezilla);\r
- }\r
-\r
- public static void Resize (IWebBrowser control, int width, int height)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_resize (info.gluezilla, width, height);\r
- }\r
-\r
- // navigation\r
- public static void Home (IWebBrowser control)\r
- {\r
- if (!isInitialized ())\r
- return;\r
- BindingInfo info = getBinding (control);\r
-\r
- gluezilla_home (info.gluezilla);\r
- }\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
- {\r
- return gluezilla_stringInit ();\r
- }\r
-\r
- public static void StringFinish (HandleRef str)\r
- {\r
- gluezilla_stringFinish (str);\r
- }\r
-\r
- public static string StringGet (HandleRef str)\r
- {\r
- IntPtr p = gluezilla_stringGet (str);\r
- return Marshal.PtrToStringUni (p);\r
- }\r
-\r
- public static void StringSet (HandleRef str, string text)\r
- {\r
- gluezilla_stringSet (str, text);\r
- }\r
-\r
-\r
- public static object GetProxyForObject (IWebBrowser control, Guid iid, object obj)\r
- {\r
- if (!isInitialized ())\r
- return null;\r
- BindingInfo info = getBinding (control);\r
- \r
- IntPtr ret;\r
- gluezilla_getProxyForObject (info.gluezilla, iid, obj, out ret);\r
- \r
- object o = Marshal.GetObjectForIUnknown (ret);\r
- return o;\r
- }\r
-\r
- public static string EvalScript (IWebBrowser control, string script)\r
- {\r
- if (!isInitialized ())\r
- return null;\r
- BindingInfo info = getBinding (control);\r
- IntPtr p = gluezilla_evalScript (info.gluezilla, script);\r
- return Marshal.PtrToStringAuto (p);\r
- }\r
-
-
- #region pinvokes\r
- [DllImport("gluezilla")]\r
- private static extern void gluezilla_debug(int signal);\r
-\r
- [DllImport("gluezilla")]\r
- private static extern IntPtr gluezilla_init (Platform platform, out Platform mozPlatform);\r
-\r
- [DllImport ("gluezilla")]\r
- private static extern IntPtr gluezilla_shutdown (IntPtr instance);\r
-\r
- [DllImport ("gluezilla")]\r
- private static extern IntPtr gluezilla_createBrowserWindow (/*IntPtr instance, */IntPtr events, IntPtr hwnd, Int32 width, Int32 height, string startDir, string dataDir, Platform platform);\r
- \r
- // layout\r
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_focus (IntPtr instance, FocusOption focus);\r
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_blur (IntPtr instance);\r
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_activate (IntPtr instance);\r
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_deactivate (IntPtr instance);\r
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_resize (IntPtr instance, Int32 width, Int32 height);\r
-\r
- // navigation\r
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_home (IntPtr instance);\r
-\r
- // dom\r
- [DllImport ("gluezilla")]\r
- [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
- [DllImport ("gluezilla")]\r
- private static extern int gluezilla_stringFinish (HandleRef str);\r
- [DllImport ("gluezilla")]\r
- private static extern IntPtr gluezilla_stringGet (HandleRef str);\r
- [DllImport ("gluezilla")]\r
- private static extern void gluezilla_stringSet (HandleRef str, [MarshalAs (UnmanagedType.LPWStr)] string text);\r
-\r
- [DllImport ("gluezilla")]\r
- private static extern void gluezilla_getProxyForObject (\r
- IntPtr instance, \r
- [MarshalAs (UnmanagedType.LPStruct)] Guid iid, \r
- [MarshalAs (UnmanagedType.Interface)] object obj,\r
- out IntPtr ret);\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using Mono.WebBrowser;
+
+namespace Mono.Mozilla
+{
+ internal class Base
+ {
+ private static Hashtable boundControls;
+ internal static bool gluezillaInstalled;
+ internal static bool initialized;
+
+ private class BindingInfo
+ {
+ public CallbackBinder callback;
+ public IntPtr gluezilla;
+ }
+
+ private static bool isInitialized ()
+ {
+ if (!gluezillaInstalled)
+ return false;
+ return true;
+ }
+
+ private static BindingInfo getBinding (IWebBrowser control)
+ {
+ if (!boundControls.ContainsKey (control))
+ return null;
+ BindingInfo info = boundControls[control] as BindingInfo;
+ return info;
+ }
+
+ static Base ()
+ {
+ boundControls = new Hashtable ();
+ }
+
+ public Base () { }
+
+ public static void Debug (int signal)
+ {
+ gluezilla_debug (signal);
+ }
+
+ public static bool Init (WebBrowser control, Platform platform)
+ {
+ if (!initialized) {
+
+ string monoMozDir = System.IO.Path.Combine (
+ System.IO.Path.Combine (
+ Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData),
+ ".mono"), "mozilla");
+
+ if (!System.IO.Directory.Exists (monoMozDir))
+ System.IO.Directory.CreateDirectory (monoMozDir);
+
+ Platform mozPlatform;
+ try {
+ gluezilla_init (platform, out mozPlatform);
+ }
+ catch (DllNotFoundException) {
+ Console.WriteLine ("libgluezilla not found. To have webbrowser support, you need libgluezilla installed");
+ gluezillaInstalled = false;
+ initialized = false;
+ return false;
+ }
+ control.enginePlatform = mozPlatform;
+ gluezillaInstalled = true;
+ initialized = true;
+ }
+ return initialized;
+ }
+
+ public static void Bind (WebBrowser control, IntPtr handle, int width, int height)
+ {
+ if (!isInitialized ())
+ return;
+
+ BindingInfo info = new BindingInfo ();
+ info.callback = new CallbackBinder (control.callbacks);
+ IntPtr ptrCallback = Marshal.AllocHGlobal (Marshal.SizeOf (info.callback));
+ Marshal.StructureToPtr (info.callback, ptrCallback, true);
+
+ string monoMozDir = System.IO.Path.Combine (
+ System.IO.Path.Combine (
+ Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData),
+ ".mono"), "mozilla");
+ info.gluezilla = gluezilla_createBrowserWindow (ptrCallback, handle, width, height, Environment.CurrentDirectory, monoMozDir, control.platform);
+
+ boundControls.Add (control as IWebBrowser, info);
+
+ }
+
+ public static void Shutdown (IWebBrowser control)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_shutdown (info.gluezilla);
+ }
+
+ // layout
+ public static void Focus (IWebBrowser control, FocusOption focus)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_focus (info.gluezilla, focus);
+ }
+
+
+ public static void Blur (IWebBrowser control)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_blur (info.gluezilla);
+ }
+
+ public static void Activate (IWebBrowser control)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_activate (info.gluezilla);
+ }
+
+ public static void Deactivate (IWebBrowser control)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_deactivate (info.gluezilla);
+ }
+
+ public static void Resize (IWebBrowser control, int width, int height)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_resize (info.gluezilla, width, height);
+ }
+
+ // navigation
+ public static void Home (IWebBrowser control)
+ {
+ if (!isInitialized ())
+ return;
+ BindingInfo info = getBinding (control);
+
+ gluezilla_home (info.gluezilla);
+ }
+
+ public static nsIWebNavigation GetWebNavigation (IWebBrowser control)
+ {
+ if (!isInitialized ())
+ return null;
+ BindingInfo info = getBinding (control);
+
+ return gluezilla_getWebNavigation (info.gluezilla);
+ }
+
+ public static IntPtr StringInit ()
+ {
+ return gluezilla_stringInit ();
+ }
+
+ public static void StringFinish (HandleRef str)
+ {
+ gluezilla_stringFinish (str);
+ }
+
+ public static string StringGet (HandleRef str)
+ {
+ IntPtr p = gluezilla_stringGet (str);
+ return Marshal.PtrToStringUni (p);
+ }
+
+ public static void StringSet (HandleRef str, string text)
+ {
+ gluezilla_stringSet (str, text);
+ }
+
+
+ public static object GetProxyForObject (IWebBrowser control, Guid iid, object obj)
+ {
+ if (!isInitialized ())
+ return null;
+ BindingInfo info = getBinding (control);
+
+ IntPtr ret;
+ gluezilla_getProxyForObject (info.gluezilla, iid, obj, out ret);
+
+ object o = Marshal.GetObjectForIUnknown (ret);
+ return o;
+ }
+
+ public static string EvalScript (IWebBrowser control, string script)
+ {
+ if (!isInitialized ())
+ return null;
+ BindingInfo info = getBinding (control);
+ IntPtr p = gluezilla_evalScript (info.gluezilla, script);
+ return Marshal.PtrToStringAuto (p);
+ }
+
+
+ #region pinvokes
+ [DllImport("gluezilla")]
+ private static extern void gluezilla_debug(int signal);
+
+ [DllImport("gluezilla")]
+ private static extern IntPtr gluezilla_init (Platform platform, out Platform mozPlatform);
+
+ [DllImport ("gluezilla")]
+ private static extern IntPtr gluezilla_shutdown (IntPtr instance);
+
+ [DllImport ("gluezilla")]
+ private static extern IntPtr gluezilla_createBrowserWindow (/*IntPtr instance, */IntPtr events, IntPtr hwnd, Int32 width, Int32 height, string startDir, string dataDir, Platform platform);
+
+ // layout
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_focus (IntPtr instance, FocusOption focus);
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_blur (IntPtr instance);
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_activate (IntPtr instance);
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_deactivate (IntPtr instance);
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_resize (IntPtr instance, Int32 width, Int32 height);
+
+ // navigation
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_home (IntPtr instance);
+
+ // dom
+ [DllImport ("gluezilla")]
+ [return:MarshalAs(UnmanagedType.Interface)]
+ private static extern nsIWebNavigation gluezilla_getWebNavigation (IntPtr instance);
+
+ [DllImport ("gluezilla")]
+ private static extern IntPtr gluezilla_stringInit ();
+ [DllImport ("gluezilla")]
+ private static extern int gluezilla_stringFinish (HandleRef str);
+ [DllImport ("gluezilla")]
+ private static extern IntPtr gluezilla_stringGet (HandleRef str);
+ [DllImport ("gluezilla")]
+ private static extern void gluezilla_stringSet (HandleRef str, [MarshalAs (UnmanagedType.LPWStr)] string text);
+
+ [DllImport ("gluezilla")]
+ private static extern void gluezilla_getProxyForObject (
+ IntPtr instance,
+ [MarshalAs (UnmanagedType.LPStruct)] Guid iid,
+ [MarshalAs (UnmanagedType.Interface)] object obj,
+ out IntPtr ret);
[DllImport ("gluezilla")]
string aBuf,
uint aCount);
- [DllImport ("gluezilla")]\r
+ [DllImport ("gluezilla")]
[return: MarshalAs (UnmanagedType.Interface)]
- public static extern nsIServiceManager gluezilla_getServiceManager ();\r
-\r
- [DllImport ("gluezilla")]\r
+ public static extern nsIServiceManager gluezilla_getServiceManager ();
+
+ [DllImport ("gluezilla")]
private static extern IntPtr gluezilla_evalScript (IntPtr instance, string script);
-\r
- #endregion\r
- }\r
-}\r
+
+ #endregion
+ }
+}
-// 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
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
#undef debug
-\r
-using System;\r
+
+using System;
using System.Text;
-using System.Runtime.InteropServices;\r
+using System.Runtime.InteropServices;
using System.Diagnostics;
-namespace Mono.Mozilla {\r
+namespace Mono.Mozilla {
- using Mono.WebBrowser;\r
+ using Mono.WebBrowser;
using Mono.WebBrowser.DOM;
internal class Callback
{
- WebBrowser owner;\r
- string currentUri;\r
+ WebBrowser owner;
+ string currentUri;
public Callback (WebBrowser owner)
{
}
- #region Events\r
-\r
- public void OnWidgetLoaded ()\r
+ #region Events
+
+ public void OnWidgetLoaded ()
{
#if debug
- OnGeneric ("OnWidgetLoaded");\r
+ OnGeneric ("OnWidgetLoaded");
#endif
- }\r
-\r
-\r
- public void OnStateChange (nsIWebProgress progress, nsIRequest request, Int32 status, UInt32 state)\r
+ }
+
+
+ public void OnStateChange (nsIWebProgress progress, nsIRequest request, Int32 status, UInt32 state)
{
#if debug
//OnGeneric ("OnStateChange");
}
if ((state & (uint) StateFlags.IsDocument) != 0) {
s.Append ("Document\t");
- }\r
+ }
if ((state & (uint) StateFlags.IsNetwork) != 0) {
s.Append ("Network\t");
- }\r
+ }
if ((state & (uint) StateFlags.IsWindow) != 0) {
s.Append ("Window\t");
}
- Console.Error.WriteLine (s.ToString ());\r
-#endif\r
-\r
- \r
- if ((state & (uint) StateFlags.Start) != 0 && \r
+ Console.Error.WriteLine (s.ToString ());
+#endif
+
+
+ if ((state & (uint) StateFlags.Start) != 0 &&
(state & (uint) StateFlags.IsRequest) != 0 &&
- (state & (uint) StateFlags.IsDocument) != 0 &&\r
- (state & (uint) StateFlags.IsNetwork) != 0 && \r
- (state & (uint) StateFlags.IsWindow) != 0 \r
- )\r
- {\r
- owner.documents.Clear ();\r
- nsIChannel channel = (nsIChannel) request;\r
- nsIURI uri;\r
- channel.getURI (out uri);\r
- if (uri == null)\r
- currentUri = "about:blank";\r
- else {\r
- AsciiString spec = new AsciiString(String.Empty);\r
- uri.getSpec (spec.Handle);\r
- currentUri = spec.ToString ();\r
- }\r
- \r
- LoadStartedEventHandler eh = (LoadStartedEventHandler) (owner.Events[WebBrowser.LoadStartedEvent]);\r
- if (eh != null) {\r
- nsIDOMWindow win;\r
- progress.getDOMWindow (out win);\r
- AsciiString name = new AsciiString (String.Empty);\r
- win.getName (name.Handle);\r
- \r
- LoadStartedEventArgs e = new LoadStartedEventArgs (currentUri, name.ToString ());\r
- eh (this, e);\r
- if (e.Cancel)\r
- request.cancel (0);\r
- }\r
- }\r
- \r
+ (state & (uint) StateFlags.IsDocument) != 0 &&
+ (state & (uint) StateFlags.IsNetwork) != 0 &&
+ (state & (uint) StateFlags.IsWindow) != 0
+ )
+ {
+ owner.documents.Clear ();
+ nsIChannel channel = (nsIChannel) request;
+ nsIURI uri;
+ channel.getURI (out uri);
+ if (uri == null)
+ currentUri = "about:blank";
+ else {
+ AsciiString spec = new AsciiString(String.Empty);
+ uri.getSpec (spec.Handle);
+ currentUri = spec.ToString ();
+ }
+
+ LoadStartedEventHandler eh = (LoadStartedEventHandler) (owner.Events[WebBrowser.LoadStartedEvent]);
+ if (eh != null) {
+ nsIDOMWindow win;
+ progress.getDOMWindow (out win);
+ AsciiString name = new AsciiString (String.Empty);
+ win.getName (name.Handle);
+
+ LoadStartedEventArgs e = new LoadStartedEventArgs (currentUri, name.ToString ());
+ eh (this, e);
+ if (e.Cancel)
+ request.cancel (0);
+ }
+ }
+
if ((state & (uint) StateFlags.Stop) != 0 &&
(state & (uint) StateFlags.IsNetwork) != 0 &&
(state & (uint) StateFlags.IsWindow) != 0
- )\r
- {\r
- LoadFinishedEventHandler eh1 = (LoadFinishedEventHandler) (owner.Events[WebBrowser.LoadFinishedEvent]);\r
- if (eh1 != null) {\r
-\r
- nsIDOMWindow win;\r
- progress.getDOMWindow (out win);\r
- LoadFinishedEventArgs e = new LoadFinishedEventArgs (currentUri);\r
- eh1 (this, e);\r
-\r
- }\r
- }\r
+ )
+ {
+ LoadFinishedEventHandler eh1 = (LoadFinishedEventHandler) (owner.Events[WebBrowser.LoadFinishedEvent]);
+ if (eh1 != null) {
+
+ nsIDOMWindow win;
+ progress.getDOMWindow (out win);
+ LoadFinishedEventArgs e = new LoadFinishedEventArgs (currentUri);
+ eh1 (this, e);
+
+ }
+ }
else if ((state & (uint) StateFlags.Stop) != 0 &&
- (state & (uint) StateFlags.IsDocument) != 0)\r
- {\r
- nsIDOMWindow win;\r
- progress.getDOMWindow (out win);\r
- nsIDOMDocument doc;\r
- win.getDocument (out doc);\r
- if (doc != null) {\r
- int hash = doc.GetHashCode ();\r
- if (owner.documents.ContainsKey (hash)) {\r
- DOM.Document document = owner.documents[hash] as DOM.Document;\r
- \r
- EventHandler eh1 = (EventHandler)(document.Events[DOM.Document.LoadStoppedEvent]);\r
- if (eh1 != null)\r
- eh1 (this, null);\r
- }\r
- }\r
+ (state & (uint) StateFlags.IsDocument) != 0)
+ {
+ nsIDOMWindow win;
+ progress.getDOMWindow (out win);
+ nsIDOMDocument doc;
+ win.getDocument (out doc);
+ if (doc != null) {
+ int hash = doc.GetHashCode ();
+ if (owner.documents.ContainsKey (hash)) {
+ DOM.Document document = owner.documents[hash] as DOM.Document;
+
+ EventHandler eh1 = (EventHandler)(document.Events[DOM.Document.LoadStoppedEvent]);
+ if (eh1 != null)
+ eh1 (this, null);
+ }
+ }
}
#if debug
- Console.Error.WriteLine ("{0} completed", s.ToString ());\r
+ Console.Error.WriteLine ("{0} completed", s.ToString ());
#endif
- }\r
-\r
- public void OnProgress (nsIWebProgress progress, nsIRequest request, Int32 currentTotalProgress, Int32 maxTotalProgress)\r
- {\r
+ }
+
+ public void OnProgress (nsIWebProgress progress, nsIRequest request, Int32 currentTotalProgress, Int32 maxTotalProgress)
+ {
#if debug
OnGeneric ("OnProgress");
-#endif \r
- ProgressChangedEventHandler eh = (ProgressChangedEventHandler) (owner.Events [Mono.Mozilla.WebBrowser.ProgressChangedEvent]);\r
- if (eh != null) {\r
- Mono.WebBrowser.ProgressChangedEventArgs e = new Mono.WebBrowser.ProgressChangedEventArgs (currentTotalProgress, maxTotalProgress);\r
- eh (this, e);\r
- }\r
- }\r
-\r
- public void OnLocationChanged (nsIWebProgress progress, nsIRequest request, nsIURI uri)\r
- {\r
+#endif
+ ProgressChangedEventHandler eh = (ProgressChangedEventHandler) (owner.Events [Mono.Mozilla.WebBrowser.ProgressChangedEvent]);
+ if (eh != null) {
+ Mono.WebBrowser.ProgressChangedEventArgs e = new Mono.WebBrowser.ProgressChangedEventArgs (currentTotalProgress, maxTotalProgress);
+ eh (this, e);
+ }
+ }
+
+ public void OnLocationChanged (nsIWebProgress progress, nsIRequest request, nsIURI uri)
+ {
#if debug
OnGeneric ("OnLocationChanged");
#endif
- LoadCommitedEventHandler eh = (LoadCommitedEventHandler) (owner.Events[WebBrowser.LoadCommitedEvent]);\r
- if (eh != null) {\r
- LoadCommitedEventArgs e = new LoadCommitedEventArgs (currentUri);\r
- eh (this, e);\r
- }\r
- }\r
-\r
- public void OnStatusChange (nsIWebProgress progress, nsIRequest request, string message, Int32 status)\r
- {\r
- StatusChangedEventHandler eh = (StatusChangedEventHandler) (owner.Events[WebBrowser.StatusChangedEvent]);\r
- if (eh != null) {\r
- StatusChangedEventArgs e = new StatusChangedEventArgs (message, status);\r
- eh (this, e);\r
- }\r
- }\r
-\r
- public void OnSecurityChange (nsIWebProgress progress, nsIRequest request, uint status)\r
- {\r
- SecurityChangedEventHandler eh = (SecurityChangedEventHandler) (owner.Events[WebBrowser.SecurityChangedEvent]);\r
- if (eh != null) {\r
- SecurityLevel state = SecurityLevel.Insecure;\r
- switch (status) {\r
- case 4: \r
- state = SecurityLevel.Insecure;\r
- break;\r
- case 1:\r
- state = SecurityLevel.Mixed;\r
- break;\r
- case 2:\r
- state = SecurityLevel.Secure;\r
- break;\r
- }\r
-\r
- SecurityChangedEventArgs e = new SecurityChangedEventArgs (state);\r
- eh (this, e);\r
- }\r
- }\r
-\r
- public bool OnClientDomKeyDown (KeyInfo keyInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ LoadCommitedEventHandler eh = (LoadCommitedEventHandler) (owner.Events[WebBrowser.LoadCommitedEvent]);
+ if (eh != null) {
+ LoadCommitedEventArgs e = new LoadCommitedEventArgs (currentUri);
+ eh (this, e);
+ }
+ }
+
+ public void OnStatusChange (nsIWebProgress progress, nsIRequest request, string message, Int32 status)
+ {
+ StatusChangedEventHandler eh = (StatusChangedEventHandler) (owner.Events[WebBrowser.StatusChangedEvent]);
+ if (eh != null) {
+ StatusChangedEventArgs e = new StatusChangedEventArgs (message, status);
+ eh (this, e);
+ }
+ }
+
+ public void OnSecurityChange (nsIWebProgress progress, nsIRequest request, uint status)
+ {
+ SecurityChangedEventHandler eh = (SecurityChangedEventHandler) (owner.Events[WebBrowser.SecurityChangedEvent]);
+ if (eh != null) {
+ SecurityLevel state = SecurityLevel.Insecure;
+ switch (status) {
+ case 4:
+ state = SecurityLevel.Insecure;
+ break;
+ case 1:
+ state = SecurityLevel.Mixed;
+ break;
+ case 2:
+ state = SecurityLevel.Secure;
+ break;
+ }
+
+ SecurityChangedEventArgs e = new SecurityChangedEventArgs (state);
+ eh (this, e);
+ }
+ }
+
+ public bool OnClientDomKeyDown (KeyInfo keyInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientDomKeyDown");
- Console.Error.WriteLine ("OnClientDomKeyDown");\r
+ Console.Error.WriteLine ("OnClientDomKeyDown");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":keydown");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.KeyDownEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientDomKeyUp (KeyInfo keyInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.KeyDownEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientDomKeyUp (KeyInfo keyInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientDomKeyUp");
- Console.Error.WriteLine ("OnClientDomKeyUp");\r
+ Console.Error.WriteLine ("OnClientDomKeyUp");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":keyup");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.KeyUpEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientDomKeyPress (KeyInfo keyInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.KeyUpEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientDomKeyPress (KeyInfo keyInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientDomKeyPress");
- Console.Error.WriteLine ("OnClientDomKeyPress");\r
+ Console.Error.WriteLine ("OnClientDomKeyPress");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":keypress");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.KeyPressEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientMouseDown (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.KeyPressEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientMouseDown (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientMouseDown");
- Console.Error.WriteLine ("OnClientMouseDown");\r
+ Console.Error.WriteLine ("OnClientMouseDown");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":mousedown");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseDownEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientMouseUp (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseDownEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientMouseUp (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientMouseUp");
- Console.Error.WriteLine ("OnClientMouseUp");\r
+ Console.Error.WriteLine ("OnClientMouseUp");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":mouseup");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseUpEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientMouseClick (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseUpEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientMouseClick (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientMouseClick");
- Console.Error.WriteLine ("OnClientMouseClick");\r
+ Console.Error.WriteLine ("OnClientMouseClick");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":click");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseClickEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientMouseDoubleClick (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseClickEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientMouseDoubleClick (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientMouseDoubleClick");
- Console.Error.WriteLine ("OnClientMouseDoubleClick");\r
+ Console.Error.WriteLine ("OnClientMouseDoubleClick");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":dblclick");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseDoubleClickEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientMouseOver (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseDoubleClickEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientMouseOver (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
OnGeneric ("OnClientMouseOver");
- Console.Error.WriteLine ("OnClientMouseOver");\r
+ Console.Error.WriteLine ("OnClientMouseOver");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
string key = String.Intern (node.GetHashCode () + ":mouseover");
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseEnterEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientMouseOut (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseEnterEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientMouseOut (MouseInfo mouseInfo, ModifierKeys modifiers, nsIDOMNode target)
{
#if debug
- OnGeneric ("OnClientMouseOut");\r
+ OnGeneric ("OnClientMouseOut");
Console.Error.WriteLine ("OnClientMouseOut");
#endif
INode node = new Mono.Mozilla.DOM.Node (owner, target);
eh1 (node, e1);
}
- NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseLeaveEvent]);\r
- if (eh != null) {\r
- NodeEventArgs e = new NodeEventArgs (node);\r
- eh (this, e);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientActivate ()\r
+ NodeEventHandler eh = (NodeEventHandler) (owner.Events[WebBrowser.MouseLeaveEvent]);
+ if (eh != null) {
+ NodeEventArgs e = new NodeEventArgs (node);
+ eh (this, e);
+ return true;
+ }
+ return false;
+ }
+
+ public bool OnClientActivate ()
{
#if debug
- OnGeneric ("OnClientActivate");\r
- Console.Error.WriteLine ("OnClientActivate");\r
+ OnGeneric ("OnClientActivate");
+ Console.Error.WriteLine ("OnClientActivate");
#endif
- // TODO: Add WebBrowser.OnClientActivate implementation\r
- return false;\r
- }\r
-\r
- public bool OnClientFocus ()\r
+ // TODO: Add WebBrowser.OnClientActivate implementation
+ return false;
+ }
+
+ public bool OnClientFocus ()
{
#if debug
- OnGeneric ("OnClientFocus");\r
- Console.Error.WriteLine ("OnClientFocus");\r
+ OnGeneric ("OnClientFocus");
+ Console.Error.WriteLine ("OnClientFocus");
#endif
- EventHandler eh = (EventHandler) (owner.Events[WebBrowser.FocusEvent]);\r
- if (eh != null) {\r
- EventArgs e = new EventArgs ();\r
- eh (this, e);\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnClientBlur ()\r
+ EventHandler eh = (EventHandler) (owner.Events[WebBrowser.FocusEvent]);
+ if (eh != null) {
+ EventArgs e = new EventArgs ();
+ eh (this, e);
+ }
+ return false;
+ }
+
+ public bool OnClientBlur ()
{
#if debug
- OnGeneric ("OnClientBlur");\r
- Console.Error.WriteLine ("OnClientBlur");\r
+ OnGeneric ("OnClientBlur");
+ Console.Error.WriteLine ("OnClientBlur");
#endif
- EventHandler eh = (EventHandler) (owner.Events[WebBrowser.BlurEvent]);\r
- if (eh != null) {\r
- EventArgs e = new EventArgs ();\r
- eh (this, e);\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnCreateNewWindow ()\r
- {
- bool ret = false;\r
+ EventHandler eh = (EventHandler) (owner.Events[WebBrowser.BlurEvent]);
+ if (eh != null) {
+ EventArgs e = new EventArgs ();
+ eh (this, e);
+ }
+ return false;
+ }
+
+ public bool OnCreateNewWindow ()
+ {
+ bool ret = false;
#if debug
- OnGeneric ("OnCreateNewWindow");\r
- Console.Error.WriteLine ("OnCreateNewWindow");\r
+ OnGeneric ("OnCreateNewWindow");
+ Console.Error.WriteLine ("OnCreateNewWindow");
#endif
- CreateNewWindowEventHandler eh = (CreateNewWindowEventHandler) (owner.Events[WebBrowser.CreateNewWindowEvent]);\r
- if (eh != null) {\r
- CreateNewWindowEventArgs e = new CreateNewWindowEventArgs (false);\r
- ret = eh (this, e);\r
- }\r
- return ret;\r
- }\r
-\r
- public void OnAlert (IntPtr title, IntPtr text)\r
+ CreateNewWindowEventHandler eh = (CreateNewWindowEventHandler) (owner.Events[WebBrowser.CreateNewWindowEvent]);
+ if (eh != null) {
+ CreateNewWindowEventArgs e = new CreateNewWindowEventArgs (false);
+ ret = eh (this, e);
+ }
+ return ret;
+ }
+
+ public void OnAlert (IntPtr title, IntPtr text)
{
#if debug
- OnGeneric ("OnAlert");\r
- Console.Error.WriteLine ("OnAlert");\r
+ OnGeneric ("OnAlert");
+ Console.Error.WriteLine ("OnAlert");
#endif
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.Alert;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- eh (this, e);\r
- }\r
- }\r
-\r
- public bool OnAlertCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState)\r
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.Alert;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ eh (this, e);
+ }
+ }
+
+ public bool OnAlertCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState)
{
#if debug
- OnGeneric ("OnAlertCheck");\r
- Console.Error.WriteLine ("OnAlertCheck");\r
+ OnGeneric ("OnAlertCheck");
+ Console.Error.WriteLine ("OnAlertCheck");
#endif
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.AlertCheck;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- if (chkMsg != IntPtr.Zero)\r
- e.CheckMessage = Marshal.PtrToStringUni (chkMsg);\r
- e.CheckState = chkState;\r
- eh (this, e);\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnConfirm (IntPtr title, IntPtr text)\r
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.AlertCheck;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ if (chkMsg != IntPtr.Zero)
+ e.CheckMessage = Marshal.PtrToStringUni (chkMsg);
+ e.CheckState = chkState;
+ eh (this, e);
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnConfirm (IntPtr title, IntPtr text)
{
#if debug
- OnGeneric ("OnConfirm");\r
- Console.Error.WriteLine ("OnConfirm");\r
+ OnGeneric ("OnConfirm");
+ Console.Error.WriteLine ("OnConfirm");
#endif
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.Confirm;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- eh (this, e);\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState)\r
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.Confirm;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ eh (this, e);
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState)
{
#if debug
- OnGeneric ("OnConfirmCheck");\r
- Console.Error.WriteLine ("OnConfirmCheck");\r
+ OnGeneric ("OnConfirmCheck");
+ Console.Error.WriteLine ("OnConfirmCheck");
#endif
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.ConfirmCheck;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- if (chkMsg != IntPtr.Zero)\r
- e.CheckMessage = Marshal.PtrToStringUni (chkMsg);\r
- e.CheckState = chkState;\r
- eh (this, e);\r
- chkState = e.CheckState;\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnConfirmEx (IntPtr title, IntPtr text, DialogButtonFlags flags,\r
- IntPtr title0, IntPtr title1, IntPtr title2,\r
- IntPtr chkMsg, ref bool chkState, out Int32 retVal)\r
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.ConfirmCheck;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ if (chkMsg != IntPtr.Zero)
+ e.CheckMessage = Marshal.PtrToStringUni (chkMsg);
+ e.CheckState = chkState;
+ eh (this, e);
+ chkState = e.CheckState;
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnConfirmEx (IntPtr title, IntPtr text, DialogButtonFlags flags,
+ IntPtr title0, IntPtr title1, IntPtr title2,
+ IntPtr chkMsg, ref bool chkState, out Int32 retVal)
{
#if debug
- OnGeneric ("OnConfirmEx");\r
- Console.Error.WriteLine ("OnConfirmEx");\r
+ OnGeneric ("OnConfirmEx");
+ Console.Error.WriteLine ("OnConfirmEx");
#endif
- retVal = -1;\r
-\r
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.ConfirmEx;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- if (chkMsg != IntPtr.Zero)\r
- e.CheckMessage = Marshal.PtrToStringUni (chkMsg);\r
- e.CheckState = chkState;\r
- eh (this, e);\r
- chkState = e.CheckState;\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnPrompt (IntPtr title, IntPtr text, ref IntPtr retVal)\r
+ retVal = -1;
+
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.ConfirmEx;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ if (chkMsg != IntPtr.Zero)
+ e.CheckMessage = Marshal.PtrToStringUni (chkMsg);
+ e.CheckState = chkState;
+ eh (this, e);
+ chkState = e.CheckState;
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnPrompt (IntPtr title, IntPtr text, ref IntPtr retVal)
{
#if debug
- OnGeneric ("OnPrompt");\r
- Console.Error.WriteLine ("OnPrompt");\r
+ OnGeneric ("OnPrompt");
+ Console.Error.WriteLine ("OnPrompt");
#endif
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.Prompt;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- if (retVal != IntPtr.Zero)\r
- e.Text2 = Marshal.PtrToStringUni (retVal);\r
- eh (this, e);\r
- retVal = Marshal.StringToHGlobalUni (e.StringReturn);\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnPromptUsernameAndPassword (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState, out IntPtr username, out IntPtr password)\r
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.Prompt;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ if (retVal != IntPtr.Zero)
+ e.Text2 = Marshal.PtrToStringUni (retVal);
+ eh (this, e);
+ retVal = Marshal.StringToHGlobalUni (e.StringReturn);
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnPromptUsernameAndPassword (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState, out IntPtr username, out IntPtr password)
{
#if debug
- OnGeneric ("OnPromptUsernameAndPassword");\r
- Console.Error.WriteLine ("OnPromptUsernameAndPassword");\r
+ OnGeneric ("OnPromptUsernameAndPassword");
+ Console.Error.WriteLine ("OnPromptUsernameAndPassword");
#endif
- username = IntPtr.Zero;\r
- password = IntPtr.Zero;\r
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.PromptUsernamePassword;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- if (chkMsg != IntPtr.Zero)\r
- e.CheckMessage = Marshal.PtrToStringUni (chkMsg);\r
- e.CheckState = chkState;\r
- eh (this, e);\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnPromptPassword (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState, out IntPtr password)\r
+ username = IntPtr.Zero;
+ password = IntPtr.Zero;
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.PromptUsernamePassword;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ if (chkMsg != IntPtr.Zero)
+ e.CheckMessage = Marshal.PtrToStringUni (chkMsg);
+ e.CheckState = chkState;
+ eh (this, e);
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnPromptPassword (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState, out IntPtr password)
{
#if debug
- OnGeneric ("OnPromptPassword");\r
- Console.Error.WriteLine ("OnPromptPassword");\r
+ OnGeneric ("OnPromptPassword");
+ Console.Error.WriteLine ("OnPromptPassword");
#endif
- password = IntPtr.Zero;\r
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.PromptPassword;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- if (chkMsg != IntPtr.Zero)\r
- e.CheckMessage = Marshal.PtrToStringUni (chkMsg);\r
- e.CheckState = chkState;\r
- eh (this, e);\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
- public bool OnSelect (IntPtr title, IntPtr text, uint count, IntPtr list, out int retVal)\r
+ password = IntPtr.Zero;
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.PromptPassword;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ if (chkMsg != IntPtr.Zero)
+ e.CheckMessage = Marshal.PtrToStringUni (chkMsg);
+ e.CheckState = chkState;
+ eh (this, e);
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
+ public bool OnSelect (IntPtr title, IntPtr text, uint count, IntPtr list, out int retVal)
{
#if debug
- OnGeneric ("OnSelect");\r
- Console.Error.WriteLine ("OnSelect");\r
+ OnGeneric ("OnSelect");
+ Console.Error.WriteLine ("OnSelect");
#endif
- retVal = 0;\r
- AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);\r
- if (eh != null) {\r
- AlertEventArgs e = new AlertEventArgs ();\r
- e.Type = DialogType.Select;\r
- if (title != IntPtr.Zero)\r
- e.Title = Marshal.PtrToStringUni (title);\r
- if (text != IntPtr.Zero)\r
- e.Text = Marshal.PtrToStringUni (text);\r
- eh (this, e);\r
- return e.BoolReturn;\r
- }\r
- return false;\r
- }\r
-\r
+ retVal = 0;
+ AlertEventHandler eh = (AlertEventHandler) (owner.Events[WebBrowser.AlertEvent]);
+ if (eh != null) {
+ AlertEventArgs e = new AlertEventArgs ();
+ e.Type = DialogType.Select;
+ if (title != IntPtr.Zero)
+ e.Title = Marshal.PtrToStringUni (title);
+ if (text != IntPtr.Zero)
+ e.Text = Marshal.PtrToStringUni (text);
+ eh (this, e);
+ return e.BoolReturn;
+ }
+ return false;
+ }
+
public void OnLoad ()
{
#if debug
OnGeneric ("OnLoad");
- Console.Error.WriteLine ("OnLoad");\r
+ Console.Error.WriteLine ("OnLoad");
#endif
((DOM.Window)owner.Window).OnLoad ();
- }\r
+ }
public void OnUnload ()
{
#if debug
OnGeneric ("OnUnload");
- Console.Error.WriteLine ("OnUnload");\r
+ Console.Error.WriteLine ("OnUnload");
#endif
((DOM.Window)owner.Window).OnUnload ();
- }\r
- \r
- public void OnShowContextMenu (UInt32 contextFlags, \r
- [MarshalAs (UnmanagedType.Interface)] nsIDOMEvent eve, \r
- [MarshalAs (UnmanagedType.Interface)] nsIDOMNode node)\r
- {\r
+ }
+
+ public void OnShowContextMenu (UInt32 contextFlags,
+ [MarshalAs (UnmanagedType.Interface)] nsIDOMEvent eve,
+ [MarshalAs (UnmanagedType.Interface)] nsIDOMNode node)
+ {
#if debug
OnGeneric ("OnShowContextMenu");
- Console.Error.WriteLine ("OnShowContextMenu");\r
-#endif\r
- ContextMenuEventHandler eh = (ContextMenuEventHandler) (owner.Events[WebBrowser.ContextMenuEvent]);\r
-\r
- if (eh != null) {\r
- nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) eve;\r
- int x, y;\r
- mouseEvent.getClientX (out x);\r
- mouseEvent.getClientY (out y);\r
- ContextMenuEventArgs args = new ContextMenuEventArgs(x, y);\r
- eh (owner, args);\r
- }\r
- \r
- }\r
- \r
- public void OnGeneric (string type)\r
- {\r
+ Console.Error.WriteLine ("OnShowContextMenu");
+#endif
+ ContextMenuEventHandler eh = (ContextMenuEventHandler) (owner.Events[WebBrowser.ContextMenuEvent]);
+
+ if (eh != null) {
+ nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) eve;
+ int x, y;
+ mouseEvent.getClientX (out x);
+ mouseEvent.getClientY (out y);
+ ContextMenuEventArgs args = new ContextMenuEventArgs(x, y);
+ eh (owner, args);
+ }
+
+ }
+
+ public void OnGeneric (string type)
+ {
#if debug
-// string t = Marshal.PtrToStringUni (type);\r
- Console.Error.WriteLine ("Callback Generic:{0}", type);\r
+// string t = Marshal.PtrToStringUni (type);
+ Console.Error.WriteLine ("Callback Generic:{0}", type);
#endif
- EventHandler eh = (EventHandler) (owner.Events[WebBrowser.GenericEvent]);\r
- if (eh != null) {\r
- EventArgs e = new EventArgs ();\r
- eh (type, e);\r
- return;\r
- }\r
- return;\r
-\r
- }\r
- #endregion\r
+ EventHandler eh = (EventHandler) (owner.Events[WebBrowser.GenericEvent]);
+ if (eh != null) {
+ EventArgs e = new EventArgs ();
+ eh (type, e);
+ return;
+ }
+ return;
+
+ }
+ #endregion
}
#region Delegates
- internal delegate void CallbackVoid ();\r
-\r
+ internal delegate void CallbackVoid ();
+
internal delegate void CallbackString (string arg1);
internal delegate void CallbackWString ([MarshalAs(UnmanagedType.LPWStr)] string arg1);
- \r
- internal delegate void CallbackStringString (string arg1, string arg2);\r
- internal delegate void CallbackStringInt (string arg1, Int32 arg2);\r
- internal delegate void CallbackWStringInt ([MarshalAs (UnmanagedType.LPWStr)] string arg1, Int32 arg2);\r
- internal delegate void CallbackStringIntInt (string arg1, Int32 arg2, Int32 arg3);\r
- internal delegate void CallbackStringIntUint (string arg1, Int32 arg2, UInt32 arg3);\r
-\r
-\r
+
+ internal delegate void CallbackStringString (string arg1, string arg2);
+ internal delegate void CallbackStringInt (string arg1, Int32 arg2);
+ internal delegate void CallbackWStringInt ([MarshalAs (UnmanagedType.LPWStr)] string arg1, Int32 arg2);
+ internal delegate void CallbackStringIntInt (string arg1, Int32 arg2, Int32 arg3);
+ internal delegate void CallbackStringIntUint (string arg1, Int32 arg2, UInt32 arg3);
+
+
internal delegate void CallbackIntInt (Int32 arg1, Int32 arg2);
- internal delegate void CallbackIntUint (Int32 arg2, UInt32 arg3);\r
-\r
- internal delegate void CallbackUint (UInt32 arg1);\r
- internal delegate void CallbackUintInt (UInt32 arg1, Int32 arg2);\r
-\r
- internal delegate void CallbackPtrPtr (IntPtr arg1, IntPtr arg2);\r
-\r
- //Don't have to worry about marshalling bool, PRBool seems very constant and uses 4 bit int underneath\r
+ internal delegate void CallbackIntUint (Int32 arg2, UInt32 arg3);
+
+ internal delegate void CallbackUint (UInt32 arg1);
+ internal delegate void CallbackUintInt (UInt32 arg1, Int32 arg2);
+
+ internal delegate void CallbackPtrPtr (IntPtr arg1, IntPtr arg2);
+
+ //Don't have to worry about marshalling bool, PRBool seems very constant and uses 4 bit int underneath
internal delegate void CallbackBool (bool val);
internal delegate bool KeyCallback (KeyInfo keyInfo, ModifierKeys modifiers, [MarshalAs (UnmanagedType.Interface)] nsIDOMNode target);
- internal delegate bool MouseCallback (MouseInfo mouseInfo, ModifierKeys modifiers, [MarshalAs (UnmanagedType.Interface)] nsIDOMNode target);\r
-\r
+ internal delegate bool MouseCallback (MouseInfo mouseInfo, ModifierKeys modifiers, [MarshalAs (UnmanagedType.Interface)] nsIDOMNode target);
+
internal delegate void GenericCallback (IntPtr type);
- \r
-\r
- internal delegate bool Callback2 ();\r
- internal delegate bool Callback2String (string arg1);\r
+
+
+ internal delegate bool Callback2 ();
+ internal delegate bool Callback2String (string arg1);
internal delegate bool CallbackOnAlertCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);
internal delegate bool CallbackOnConfirm (IntPtr title, IntPtr text);
- internal delegate bool CallbackOnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);\r
+ internal delegate bool CallbackOnConfirmCheck (IntPtr title, IntPtr text, IntPtr chkMsg, ref bool chkState);
internal delegate bool CallbackOnConfirmEx (IntPtr title, IntPtr text, Mono.WebBrowser.DialogButtonFlags flags,
- IntPtr title0, IntPtr title1, IntPtr title2,\r
- IntPtr chkMsg, ref bool chkState, out Int32 retVal);\r
- internal delegate bool CallbackOnPrompt (IntPtr title, IntPtr text,\r
- ref IntPtr retVal);\r
- internal delegate bool CallbackOnPromptUsernameAndPassword \r
- (IntPtr title, IntPtr text,\r
- IntPtr chkMsg, ref bool chkState, \r
- out IntPtr username, out IntPtr password);\r
- internal delegate bool CallbackOnPromptPassword\r
- (IntPtr title, IntPtr text,\r
+ IntPtr title0, IntPtr title1, IntPtr title2,
+ IntPtr chkMsg, ref bool chkState, out Int32 retVal);
+ internal delegate bool CallbackOnPrompt (IntPtr title, IntPtr text,
+ ref IntPtr retVal);
+ internal delegate bool CallbackOnPromptUsernameAndPassword
+ (IntPtr title, IntPtr text,
+ IntPtr chkMsg, ref bool chkState,
+ out IntPtr username, out IntPtr password);
+ internal delegate bool CallbackOnPromptPassword
+ (IntPtr title, IntPtr text,
IntPtr chkMsg, ref bool chkState,
- out IntPtr password);\r
+ out IntPtr password);
internal delegate bool CallbackOnSelect (IntPtr title, IntPtr text,
UInt32 count, IntPtr list,
- out Int32 retVal);\r
- \r
- internal delegate void CallbackOnLocationChanged ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,\r
- [MarshalAs (UnmanagedType.Interface)] nsIRequest request,\r
- [MarshalAs (UnmanagedType.Interface)] nsIURI uri);\r
-\r
- internal delegate void CallbackOnStatusChange ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,\r
- [MarshalAs (UnmanagedType.Interface)] nsIRequest request,\r
- [MarshalAs (UnmanagedType.LPWStr)] string message, Int32 status);\r
- \r
- internal delegate void CallbackOnSecurityChange ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,\r
- [MarshalAs (UnmanagedType.Interface)] nsIRequest request,\r
- uint status);\r
-\r
- internal delegate void CallbackOnStateChange ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,\r
- [MarshalAs (UnmanagedType.Interface)] nsIRequest request,\r
- Int32 arg2, UInt32 arg3);\r
- internal delegate void CallbackOnProgress ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,\r
- [MarshalAs (UnmanagedType.Interface)] nsIRequest request,\r
- Int32 arg2, Int32 arg3);\r
- \r
- internal delegate void CallbackOnShowContextMenu (UInt32 contextFlags, \r
- [MarshalAs (UnmanagedType.Interface)] nsIDOMEvent eve, \r
- [MarshalAs (UnmanagedType.Interface)] nsIDOMNode node);\r
+ out Int32 retVal);
+
+ internal delegate void CallbackOnLocationChanged ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,
+ [MarshalAs (UnmanagedType.Interface)] nsIRequest request,
+ [MarshalAs (UnmanagedType.Interface)] nsIURI uri);
+
+ internal delegate void CallbackOnStatusChange ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,
+ [MarshalAs (UnmanagedType.Interface)] nsIRequest request,
+ [MarshalAs (UnmanagedType.LPWStr)] string message, Int32 status);
+
+ internal delegate void CallbackOnSecurityChange ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,
+ [MarshalAs (UnmanagedType.Interface)] nsIRequest request,
+ uint status);
+
+ internal delegate void CallbackOnStateChange ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,
+ [MarshalAs (UnmanagedType.Interface)] nsIRequest request,
+ Int32 arg2, UInt32 arg3);
+ internal delegate void CallbackOnProgress ([MarshalAs (UnmanagedType.Interface)] nsIWebProgress progress,
+ [MarshalAs (UnmanagedType.Interface)] nsIRequest request,
+ Int32 arg2, Int32 arg3);
+
+ internal delegate void CallbackOnShowContextMenu (UInt32 contextFlags,
+ [MarshalAs (UnmanagedType.Interface)] nsIDOMEvent eve,
+ [MarshalAs (UnmanagedType.Interface)] nsIDOMNode node);
public CallbackVoid OnWidgetLoaded;
- public CallbackOnStateChange OnStateChange;\r
- public CallbackOnProgress OnProgress;\r
- public CallbackOnLocationChanged OnLocationChanged;\r
+ public CallbackOnStateChange OnStateChange;
+ public CallbackOnProgress OnProgress;
+ public CallbackOnLocationChanged OnLocationChanged;
- public CallbackOnStatusChange OnStatusChange;\r
- public CallbackOnSecurityChange OnSecurityChange;\r
+ public CallbackOnStatusChange OnStatusChange;
+ public CallbackOnSecurityChange OnSecurityChange;
public KeyCallback OnKeyDown;
public KeyCallback OnKeyUp;
public MouseCallback OnMouseClick;
public MouseCallback OnMouseDoubleClick;
public MouseCallback OnMouseOver;
- public MouseCallback OnMouseOut;\r
+ public MouseCallback OnMouseOut;
- public Callback2 OnActivate;\r
- public Callback2 OnFocus;\r
- public Callback2 OnBlur;\r
+ public Callback2 OnActivate;
+ public Callback2 OnFocus;
+ public Callback2 OnBlur;
public CallbackPtrPtr OnAlert;
- public CallbackOnAlertCheck OnAlertCheck;\r
- public CallbackOnConfirm OnConfirm;\r
- public CallbackOnConfirmCheck OnConfirmCheck;\r
- public CallbackOnConfirmEx OnConfirmEx;\r
- public CallbackOnPrompt OnPrompt;\r
- public CallbackOnPromptUsernameAndPassword OnPromptUsernameAndPassword;\r
- public CallbackOnPromptPassword OnPromptPassword;\r
+ public CallbackOnAlertCheck OnAlertCheck;
+ public CallbackOnConfirm OnConfirm;
+ public CallbackOnConfirmCheck OnConfirmCheck;
+ public CallbackOnConfirmEx OnConfirmEx;
+ public CallbackOnPrompt OnPrompt;
+ public CallbackOnPromptUsernameAndPassword OnPromptUsernameAndPassword;
+ public CallbackOnPromptPassword OnPromptPassword;
public CallbackOnSelect OnSelect;
public CallbackVoid OnLoad;
- public CallbackVoid OnUnload;\r
- \r
+ public CallbackVoid OnUnload;
+
public CallbackOnShowContextMenu OnShowContextMenu;
-\r
+
public CallbackWString OnGeneric;
internal CallbackBinder (Callback callback) {
this.OnWidgetLoaded = new CallbackVoid (callback.OnWidgetLoaded);
- this.OnStateChange = new CallbackOnStateChange (callback.OnStateChange);\r
+ this.OnStateChange = new CallbackOnStateChange (callback.OnStateChange);
- this.OnProgress = new CallbackOnProgress (callback.OnProgress);\r
+ this.OnProgress = new CallbackOnProgress (callback.OnProgress);
this.OnLocationChanged = new CallbackOnLocationChanged (callback.OnLocationChanged);
- this.OnStatusChange = new CallbackOnStatusChange (callback.OnStatusChange);\r
- this.OnSecurityChange = new CallbackOnSecurityChange (callback.OnSecurityChange);\r
+ this.OnStatusChange = new CallbackOnStatusChange (callback.OnStatusChange);
+ this.OnSecurityChange = new CallbackOnSecurityChange (callback.OnSecurityChange);
this.OnKeyDown = new KeyCallback (callback.OnClientDomKeyDown);
this.OnKeyUp = new KeyCallback (callback.OnClientDomKeyUp);
this.OnMouseClick = new MouseCallback (callback.OnClientMouseClick);
this.OnMouseDoubleClick = new MouseCallback (callback.OnClientMouseDoubleClick);
this.OnMouseOver = new MouseCallback (callback.OnClientMouseOver);
- this.OnMouseOut = new MouseCallback (callback.OnClientMouseOut);\r
-
- this.OnActivate = new Callback2 (callback.OnClientActivate);\r
- this.OnFocus = new Callback2 (callback.OnClientFocus);\r
- this.OnBlur = new Callback2 (callback.OnClientBlur);\r
-
- this.OnAlert = new CallbackPtrPtr (callback.OnAlert);\r
- this.OnAlertCheck = new CallbackOnAlertCheck (callback.OnAlertCheck);\r
- this.OnConfirm = new CallbackOnConfirm (callback.OnConfirm);\r
- this.OnConfirmCheck = new CallbackOnConfirmCheck (callback.OnConfirmCheck);\r
- this.OnConfirmEx = new CallbackOnConfirmEx (callback.OnConfirmEx);\r
- this.OnPrompt = new CallbackOnPrompt (callback.OnPrompt);\r
- this.OnPromptUsernameAndPassword = new CallbackOnPromptUsernameAndPassword (callback.OnPromptUsernameAndPassword);\r
- this.OnPromptPassword = new CallbackOnPromptPassword (callback.OnPromptPassword);\r
+ this.OnMouseOut = new MouseCallback (callback.OnClientMouseOut);
+
+ this.OnActivate = new Callback2 (callback.OnClientActivate);
+ this.OnFocus = new Callback2 (callback.OnClientFocus);
+ this.OnBlur = new Callback2 (callback.OnClientBlur);
+
+ this.OnAlert = new CallbackPtrPtr (callback.OnAlert);
+ this.OnAlertCheck = new CallbackOnAlertCheck (callback.OnAlertCheck);
+ this.OnConfirm = new CallbackOnConfirm (callback.OnConfirm);
+ this.OnConfirmCheck = new CallbackOnConfirmCheck (callback.OnConfirmCheck);
+ this.OnConfirmEx = new CallbackOnConfirmEx (callback.OnConfirmEx);
+ this.OnPrompt = new CallbackOnPrompt (callback.OnPrompt);
+ this.OnPromptUsernameAndPassword = new CallbackOnPromptUsernameAndPassword (callback.OnPromptUsernameAndPassword);
+ this.OnPromptPassword = new CallbackOnPromptPassword (callback.OnPromptPassword);
this.OnSelect = new CallbackOnSelect (callback.OnSelect);
this.OnLoad = new CallbackVoid (callback.OnLoad);
- this.OnUnload = new CallbackVoid (callback.OnUnload);\r
- \r
- this.OnShowContextMenu = new CallbackOnShowContextMenu (callback.OnShowContextMenu);\r
- \r
- this.OnGeneric = new CallbackWString (callback.OnGeneric);\r
+ this.OnUnload = new CallbackVoid (callback.OnUnload);
+
+ this.OnShowContextMenu = new CallbackOnShowContextMenu (callback.OnShowContextMenu);
+
+ this.OnGeneric = new CallbackWString (callback.OnGeneric);
}
}
- [StructLayout (LayoutKind.Sequential)]\r
- internal struct SizeInfo\r
- {\r
- public UInt32 width;\r
- public UInt32 height;\r
- }\r
-\r
- [StructLayout (LayoutKind.Sequential)]\r
- internal struct ModifierKeys\r
- {\r
- public Int32 altKey;\r
- public Int32 ctrlKey;\r
- public Int32 metaKey;\r
- public Int32 shiftKey;\r
- }\r
-\r
- [StructLayout (LayoutKind.Sequential)]\r
- internal struct MouseInfo\r
- {\r
- public UInt16 button;\r
- public Int32 clientX;\r
- public Int32 clientY;\r
- public Int32 screenX;\r
- public Int32 screenY;\r
- }\r
-\r
- [StructLayout (LayoutKind.Sequential)]\r
- internal struct KeyInfo\r
- {\r
- public UInt32 charCode;\r
- public UInt32 keyCode;\r
+ [StructLayout (LayoutKind.Sequential)]
+ internal struct SizeInfo
+ {
+ public UInt32 width;
+ public UInt32 height;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ internal struct ModifierKeys
+ {
+ public Int32 altKey;
+ public Int32 ctrlKey;
+ public Int32 metaKey;
+ public Int32 shiftKey;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ internal struct MouseInfo
+ {
+ public UInt16 button;
+ public Int32 clientX;
+ public Int32 clientY;
+ public Int32 screenX;
+ public Int32 screenY;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ internal struct KeyInfo
+ {
+ public UInt32 charCode;
+ public UInt32 keyCode;
}
[Flags]
-// 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, 2008 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 Attribute : Node, IAttribute\r
- {\r
- private nsIDOMAttr attribute;\r
-\r
- public Attribute (WebBrowser control, nsIDOMAttr domAttribute)\r
- : base (control, domAttribute as nsIDOMNode)\r
- {\r
- if (control.platform != control.enginePlatform)\r
- this.attribute = nsDOMAttr.GetProxy (control, domAttribute);\r
- else\r
- this.attribute = domAttribute;\r
- }\r
-\r
- #region IDisposable Members\r
- protected override void Dispose (bool disposing)\r
- {\r
- if (!disposed) {\r
- if (disposing) {\r
- this.attribute = null;\r
- }\r
- }\r
- base.Dispose (disposing);\r
- }\r
- #endregion\r
-\r
- #region IAttribute Members\r
- public string Name {\r
- get {\r
- this.attribute.getName (storage);\r
- return Base.StringGet (storage);\r
- }\r
- }\r
-\r
- public new string Value {\r
- get {\r
- this.attribute.getValue (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set {\r
- Base.StringSet (storage, value);\r
- this.attribute.setValue (storage);\r
- }\r
- }\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.Mozilla.DOM
+{
+ internal class Attribute : Node, IAttribute
+ {
+ private nsIDOMAttr attribute;
+
+ public Attribute (WebBrowser control, nsIDOMAttr domAttribute)
+ : base (control, domAttribute as nsIDOMNode)
+ {
+ if (control.platform != control.enginePlatform)
+ this.attribute = nsDOMAttr.GetProxy (control, domAttribute);
+ else
+ this.attribute = domAttribute;
+ }
+
+ #region IDisposable Members
+ protected override void Dispose (bool disposing)
+ {
+ if (!disposed) {
+ if (disposing) {
+ this.attribute = null;
+ }
+ }
+ base.Dispose (disposing);
+ }
+ #endregion
+
+ #region IAttribute Members
+ public string Name {
+ get {
+ this.attribute.getName (storage);
+ return Base.StringGet (storage);
+ }
+ }
+
+ public new string Value {
+ get {
+ this.attribute.getValue (storage);
+ return Base.StringGet (storage);
+ }
+ set {
+ Base.StringSet (storage, value);
+ this.attribute.setValue (storage);
+ }
+ }
#endregion
public override int GetHashCode () {
return this.hashcode;
- }\r
- }\r
-}\r
+ }
+ }
+}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-\r
-using System;\r
-using System.Collections;\r
-using Mono.WebBrowser;\r
-using Mono.WebBrowser.DOM;\r
-\r
-\r
-namespace Mono.Mozilla.DOM\r
-{\r
- internal class AttributeCollection : NodeList, IAttributeCollection\r
- {\r
- protected new nsIDOMNamedNodeMap unmanagedNodes;\r
-\r
- public AttributeCollection (WebBrowser control, nsIDOMNamedNodeMap nodeMap)\r
- : base (control, true)\r
- {\r
- if (control.platform != control.enginePlatform)\r
- unmanagedNodes = nsDOMNamedNodeMap.GetProxy (control, nodeMap);\r
- else\r
- unmanagedNodes = nodeMap;\r
- }\r
- \r
- public AttributeCollection (WebBrowser control) : base (control) \r
- {\r
- }\r
- \r
- internal override void Load ()\r
- {\r
- if (unmanagedNodes == null) return;\r
- Clear ();\r
- uint count;\r
- unmanagedNodes.getLength (out count);\r
- nodeCount = (int) count;\r
- nodes = new Node[count];\r
- for (int i = 0; i < count; i++) {\r
- nsIDOMNode node;\r
- unmanagedNodes.item ((uint) i, out node);\r
- nodes[i] = new Attribute (control, node as nsIDOMAttr);\r
- }\r
- }\r
-\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+
+using System;
+using System.Collections;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+
+namespace Mono.Mozilla.DOM
+{
+ internal class AttributeCollection : NodeList, IAttributeCollection
+ {
+ protected new nsIDOMNamedNodeMap unmanagedNodes;
+
+ public AttributeCollection (WebBrowser control, nsIDOMNamedNodeMap nodeMap)
+ : base (control, true)
+ {
+ if (control.platform != control.enginePlatform)
+ unmanagedNodes = nsDOMNamedNodeMap.GetProxy (control, nodeMap);
+ else
+ unmanagedNodes = nodeMap;
+ }
+
+ public AttributeCollection (WebBrowser control) : base (control)
+ {
+ }
+
+ internal override void Load ()
+ {
+ if (unmanagedNodes == null) return;
+ Clear ();
+ uint count;
+ unmanagedNodes.getLength (out count);
+ nodeCount = (int) count;
+ nodes = new Node[count];
+ for (int i = 0; i < count; i++) {
+ nsIDOMNode node;
+ unmanagedNodes.item ((uint) i, out node);
+ nodes[i] = new Attribute (control, node as nsIDOMAttr);
+ }
+ }
+
public override int Count {
- get {\r
- if (unmanagedNodes != null && nodes == null)\r
- Load ();\r
+ get {
+ if (unmanagedNodes != null && nodes == null)
+ Load ();
return nodeCount;
}
- }\r
-\r
- #region IList members\r
- public new IAttribute this[int index]\r
- {\r
- get\r
- {\r
- if (index < 0 || index >= Count)\r
- throw new ArgumentOutOfRangeException ("index");\r
- return nodes[index] as IAttribute;\r
- }\r
- set { }\r
- }\r
-\r
- public IAttribute this[string name]\r
- {\r
- get\r
- {\r
- for (int i = 0; i < nodes.Length; i++) {\r
- if (((IAttribute) nodes[i]).Name.Equals (name))\r
- return nodes[i] as IAttribute;\r
- }\r
- return null;\r
- }\r
- }\r
-\r
- public bool Exists (string name)\r
- {\r
- if (unmanagedNodes == null) return false;\r
- Base.StringSet (storage, name);\r
- nsIDOMNode ret;\r
- unmanagedNodes.getNamedItem (storage, out ret);\r
- return ret != null;\r
- }\r
+ }
+
+ #region IList members
+ public new IAttribute this[int index]
+ {
+ get
+ {
+ if (index < 0 || index >= Count)
+ throw new ArgumentOutOfRangeException ("index");
+ return nodes[index] as IAttribute;
+ }
+ set { }
+ }
+
+ public IAttribute this[string name]
+ {
+ get
+ {
+ for (int i = 0; i < nodes.Length; i++) {
+ if (((IAttribute) nodes[i]).Name.Equals (name))
+ return nodes[i] as IAttribute;
+ }
+ return null;
+ }
+ }
+
+ public bool Exists (string name)
+ {
+ if (unmanagedNodes == null) return false;
+ Base.StringSet (storage, name);
+ nsIDOMNode ret;
+ unmanagedNodes.getNamedItem (storage, out ret);
+ return ret != null;
+ }
#endregion
- public override int GetHashCode () {\r
+ public override int GetHashCode () {
if (unmanagedNodes == null) return base.GetHashCode ();
return this.unmanagedNodes.GetHashCode ();
- }\r
- }\r
-}\r
+ }
+ }
+}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
using System.Text;
using System.ComponentModel;
-using System.Runtime.InteropServices;\r
+using System.Runtime.InteropServices;
using System.Collections;
-using Mono.WebBrowser;\r
-\r
-namespace Mono.Mozilla.DOM\r
-{\r
- internal class DOMObject : IDisposable\r
+using Mono.WebBrowser;
+
+namespace Mono.Mozilla.DOM
+{
+ internal class DOMObject : IDisposable
{
private EventHandlerList event_handlers;
- protected WebBrowser control;\r
+ protected WebBrowser control;
internal HandleRef storage;
- protected bool disposed = false;\r
- protected Hashtable resources;\r
-\r
- internal DOMObject (WebBrowser control)\r
+ protected bool disposed = false;
+ protected Hashtable resources;
+
+ internal DOMObject (WebBrowser control)
{
- this.control = control;\r
- IntPtr p = Base.StringInit ();\r
- storage = new HandleRef (this, p);\r
- resources = new Hashtable ();\r
+ this.control = control;
+ IntPtr p = Base.StringInit ();
+ storage = new HandleRef (this, p);
+ resources = new Hashtable ();
event_handlers = null;
- }\r
-\r
- ~DOMObject ()\r
+ }
+
+ ~DOMObject ()
{
- Dispose (false);\r
- }\r
-\r
- #region IDisposable Members\r
+ Dispose (false);
+ }
+
+ #region IDisposable Members
protected virtual void Dispose (bool disposing)
{
disposed = true;
}
}
-\r
- public void Dispose ()\r
- {\r
+
+ public void Dispose ()
+ {
Dispose (true);
- GC.SuppressFinalize (this);\r
- }\r
-\r
- #endregion\r
+ GC.SuppressFinalize (this);
+ }
+
+ #endregion
protected EventHandlerList Events {
get {
}
}
- }\r
-}\r
+ }
+}
-// 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, 2008 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 System.Collections;\r
-using Mono.WebBrowser;\r
-using Mono.WebBrowser.DOM;\r
-\r
-namespace Mono.Mozilla.DOM\r
-{\r
- internal class Document : Node, IDocument\r
- {\r
- internal nsIDOMDocument document;\r
-\r
- public Document (WebBrowser control, nsIDOMHTMLDocument document)\r
- : base (control, document)\r
- {\r
- if (control.platform != control.enginePlatform)\r
- this.document = nsDOMHTMLDocument.GetProxy (control, document);\r
- else\r
- this.document = document;\r
- }\r
-\r
- public Document (WebBrowser control, nsIDOMDocument document)\r
- : base (control, document)\r
- {\r
- if (control.platform != control.enginePlatform)\r
- this.document = nsDOMDocument.GetProxy (control, document);\r
- else\r
- this.document = document;\r
- }\r
- \r
- #region IDisposable Members\r
- protected override void Dispose (bool disposing)\r
- {\r
- if (!disposed) {\r
- if (disposing) {\r
- this.resources.Clear ();\r
- this.document = null;\r
- }\r
- }\r
- base.Dispose (disposing);\r
- }\r
- #endregion\r
-\r
- #region Internal\r
- internal nsIDOMDocument ComObject\r
- {\r
- get { return document; }\r
- }\r
- #endregion\r
-\r
- #region IDocument Properties\r
-\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Collections;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.Mozilla.DOM
+{
+ internal class Document : Node, IDocument
+ {
+ internal nsIDOMDocument document;
+
+ public Document (WebBrowser control, nsIDOMHTMLDocument document)
+ : base (control, document)
+ {
+ if (control.platform != control.enginePlatform)
+ this.document = nsDOMHTMLDocument.GetProxy (control, document);
+ else
+ this.document = document;
+ }
+
+ public Document (WebBrowser control, nsIDOMDocument document)
+ : base (control, document)
+ {
+ if (control.platform != control.enginePlatform)
+ this.document = nsDOMDocument.GetProxy (control, document);
+ else
+ this.document = document;
+ }
+
+ #region IDisposable Members
+ protected override void Dispose (bool disposing)
+ {
+ if (!disposed) {
+ if (disposing) {
+ this.resources.Clear ();
+ this.document = null;
+ }
+ }
+ base.Dispose (disposing);
+ }
+ #endregion
+
+ #region Internal
+ internal nsIDOMDocument ComObject
+ {
+ get { return document; }
+ }
+ #endregion
+
+ #region IDocument Properties
+
public IElement Active {
get {
nsIDOMElement element;
return null;
webBrowserFocus.getFocusedElement (out element);
if ((element as nsIDOMHTMLElement) != null)
- return new HTMLElement (control, element as nsIDOMHTMLElement) as IElement;\r
+ return new HTMLElement (control, element as nsIDOMHTMLElement) as IElement;
return new Element (control, element) as IElement;
}
}
public string ActiveLinkColor {
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
+ get {
+ if (!(document is nsIDOMHTMLDocument))
return String.Empty;
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).getALink(storage);
return Base.StringGet (storage);
}
- set {\r
- if (!(document is nsIDOMHTMLDocument))\r
+ set {
+ if (!(document is nsIDOMHTMLDocument))
return;
Base.StringSet (storage, value);
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).setALink(storage);
}
}
- public IElementCollection Anchors {\r
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
+ public IElementCollection Anchors {
+ get {
+ if (!(document is nsIDOMHTMLDocument))
return null;
- nsIDOMHTMLCollection ret;\r
+ nsIDOMHTMLCollection ret;
((nsIDOMHTMLDocument)document).getAnchors (out ret);
- return new HTMLElementCollection(control, (nsIDOMNodeList)ret);\r
- }\r
+ return new HTMLElementCollection(control, (nsIDOMNodeList)ret);
+ }
}
- public IElementCollection Applets {\r
+ public IElementCollection Applets {
get {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return null;
- nsIDOMHTMLCollection ret;\r
+ nsIDOMHTMLCollection ret;
((nsIDOMHTMLDocument)document).getApplets (out ret);
- return new HTMLElementCollection(control, (nsIDOMNodeList)ret);\r
- }\r
+ return new HTMLElementCollection(control, (nsIDOMNodeList)ret);
+ }
}
public string Background {
get {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return String.Empty;
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).getBackground(storage);
return Base.StringGet (storage);
}
- set {\r
- if (!(document is nsIDOMHTMLDocument))\r
+ set {
+ if (!(document is nsIDOMHTMLDocument))
return;
Base.StringSet (storage, value);
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).setBackground(storage);
}
public string BackColor {
get {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return String.Empty;
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).getBgColor(storage);
return Base.StringGet (storage);
}
set {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return;
Base.StringSet (storage, value);
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).setBgColor(storage);
}
}
- public IElement Body {\r
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
- return null;\r
+ public IElement Body {
+ get {
+ if (!(document is nsIDOMHTMLDocument))
+ return null;
- if (!resources.Contains ("Body")) {\r
- nsIDOMHTMLElement element;\r
- ((nsIDOMHTMLDocument)document).getBody (out element);\r
- nsIDOMHTMLBodyElement b = element as nsIDOMHTMLBodyElement;\r
- resources.Add ("Body", new HTMLElement (control, b));\r
- }\r
- return resources["Body"] as IElement;\r
- }\r
+ if (!resources.Contains ("Body")) {
+ nsIDOMHTMLElement element;
+ ((nsIDOMHTMLDocument)document).getBody (out element);
+ nsIDOMHTMLBodyElement b = element as nsIDOMHTMLBodyElement;
+ resources.Add ("Body", new HTMLElement (control, b));
+ }
+ return resources["Body"] as IElement;
+ }
}
// This is the most ugly code *ever*. TODO: find out why a simple thing as getting the
get {
nsIDOMDocumentView docView = (nsIDOMDocumentView) this.document;
nsIDOMAbstractView abstractView;
- docView.getDefaultView (out abstractView);\r
-\r
- nsIInterfaceRequestor requestor = (nsIInterfaceRequestor) abstractView;\r
+ docView.getDefaultView (out abstractView);
+
+ nsIInterfaceRequestor requestor = (nsIInterfaceRequestor) abstractView;
IntPtr ret;
requestor.getInterface (typeof(nsIDocCharset).GUID, out ret);
nsIDocCharset charset = (nsIDocCharset) Marshal.GetObjectForIUnknown (ret);
- StringBuilder s = new StringBuilder (30);\r
+ StringBuilder s = new StringBuilder (30);
IntPtr r = Marshal.StringToHGlobalUni (s.ToString ());
- charset.getCharset (ref r);\r
-\r
+ charset.getCharset (ref r);
+
return Marshal.PtrToStringAnsi (r);
}
- set {\r
- nsIDOMDocumentView docView = (nsIDOMDocumentView) this.document;\r
- nsIDOMAbstractView abstractView;\r
- docView.getDefaultView (out abstractView);\r
-\r
- nsIInterfaceRequestor requestor = (nsIInterfaceRequestor) abstractView;\r
-
- IntPtr ret;\r
- requestor.getInterface (typeof (nsIDocCharset).GUID, out ret);\r
- nsIDocCharset charset = (nsIDocCharset) Marshal.GetTypedObjectForIUnknown (ret, typeof (nsIDocCharset));\r
-\r
- charset.setCharset (value);\r
+ set {
+ nsIDOMDocumentView docView = (nsIDOMDocumentView) this.document;
+ nsIDOMAbstractView abstractView;
+ docView.getDefaultView (out abstractView);
+
+ nsIInterfaceRequestor requestor = (nsIInterfaceRequestor) abstractView;
+
+ IntPtr ret;
+ requestor.getInterface (typeof (nsIDocCharset).GUID, out ret);
+ nsIDocCharset charset = (nsIDocCharset) Marshal.GetTypedObjectForIUnknown (ret, typeof (nsIDocCharset));
+
+ charset.setCharset (value);
control.navigation.Go (this.Url, LoadFlags.CharsetChange);
}
- }\r
+ }
- public string Cookie {\r
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
+ public string Cookie {
+ get {
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
((nsIDOMHTMLDocument)document).getCookie (storage);
- return Base.StringGet (storage);\r
- }\r
+ return Base.StringGet (storage);
+ }
set {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return;
- Base.StringSet (storage, value);\r
- ((nsIDOMHTMLDocument)document).setCookie (storage);\r
- }\r
- }\r
- public string Domain {\r
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
+ Base.StringSet (storage, value);
+ ((nsIDOMHTMLDocument)document).setCookie (storage);
+ }
+ }
+ public string Domain {
+ get {
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
((nsIDOMHTMLDocument)document).getDomain (storage);
- return Base.StringGet (storage);\r
- }\r
- }\r
- public IElement DocumentElement {\r
- get {\r
- if (!resources.Contains ("DocumentElement")) {\r
- nsIDOMElement element;\r
- this.document.getDocumentElement (out element);\r
- resources.Add ("DocumentElement", new Element (control, element));\r
- }\r
- return resources["DocumentElement"] as IElement;\r
- }\r
- }\r
- \r
- public IDocumentType DocType {\r
- get {\r
- nsIDOMDocumentType doctype;\r
- this.document.getDoctype (out doctype);\r
- return new DocumentType (this.control, doctype);\r
- }\r
- }\r
- \r
+ return Base.StringGet (storage);
+ }
+ }
+ public IElement DocumentElement {
+ get {
+ if (!resources.Contains ("DocumentElement")) {
+ nsIDOMElement element;
+ this.document.getDocumentElement (out element);
+ resources.Add ("DocumentElement", new Element (control, element));
+ }
+ return resources["DocumentElement"] as IElement;
+ }
+ }
+
+ public IDocumentType DocType {
+ get {
+ nsIDOMDocumentType doctype;
+ this.document.getDoctype (out doctype);
+ return new DocumentType (this.control, doctype);
+ }
+ }
+
public string ForeColor {
get {
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
- nsIDOMHTMLElement element;\r
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).getText(storage);
return Base.StringGet (storage);
}
set {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return;
Base.StringSet (storage, value);
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).setText(storage);
}
}
- public IElementCollection Forms {\r
+ public IElementCollection Forms {
get {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return null;
- nsIDOMHTMLCollection ret;\r
+ nsIDOMHTMLCollection ret;
((nsIDOMHTMLDocument)document).getForms (out ret);
- return new HTMLElementCollection(control, (nsIDOMNodeList)ret);\r
- }\r
+ return new HTMLElementCollection(control, (nsIDOMNodeList)ret);
+ }
}
- public IElementCollection Images {\r
+ public IElementCollection Images {
get {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return null;
- nsIDOMHTMLCollection ret;\r
+ nsIDOMHTMLCollection ret;
((nsIDOMHTMLDocument)document).getImages (out ret);
- return new HTMLElementCollection(control, (nsIDOMNodeList)ret);\r
- }\r
+ return new HTMLElementCollection(control, (nsIDOMNodeList)ret);
+ }
- }\r
- \r
- public IDOMImplementation Implementation {\r
- get {\r
- nsIDOMDOMImplementation implementation;\r
- document.getImplementation (out implementation);\r
- return new DOMImplementation (this.control, implementation);\r
- }\r
+ }
+
+ public IDOMImplementation Implementation {
+ get {
+ nsIDOMDOMImplementation implementation;
+ document.getImplementation (out implementation);
+ return new DOMImplementation (this.control, implementation);
+ }
}
public string LinkColor {
get {
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
- nsIDOMHTMLElement element;\r
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).getLink(storage);
return Base.StringGet (storage);
}
set {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return;
Base.StringSet (storage, value);
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).setLink(storage);
}
}
- public IElementCollection Links {\r
+ public IElementCollection Links {
get {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return null;
- nsIDOMHTMLCollection ret;\r
+ nsIDOMHTMLCollection ret;
((nsIDOMHTMLDocument)document).getLinks (out ret);
- return new HTMLElementCollection(control, (nsIDOMNodeList)ret);\r
- }\r
+ return new HTMLElementCollection(control, (nsIDOMNodeList)ret);
+ }
- }\r
+ }
- public IStylesheetList Stylesheets\r
- {\r
- get {\r
- nsIDOMStyleSheetList styleList;\r
- nsIDOMDocumentStyle docStyle = ((nsIDOMDocumentStyle)this.document);\r
- docStyle.getStyleSheets (out styleList);\r
- return new StylesheetList (this.control, styleList);\r
- }\r
- }\r
- \r
- public string Title {\r
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
- ((nsIDOMHTMLDocument)document).getTitle (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set {\r
- Base.StringSet (storage, value);\r
- ((nsIDOMHTMLDocument)document).setTitle (storage);\r
- }\r
- }\r
-\r
- public string Url {\r
- get {\r
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
- ((nsIDOMHTMLDocument)document).getURL (storage);\r
- return Base.StringGet (storage);\r
- }\r
- }\r
+ public IStylesheetList Stylesheets
+ {
+ get {
+ nsIDOMStyleSheetList styleList;
+ nsIDOMDocumentStyle docStyle = ((nsIDOMDocumentStyle)this.document);
+ docStyle.getStyleSheets (out styleList);
+ return new StylesheetList (this.control, styleList);
+ }
+ }
+
+ public string Title {
+ get {
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
+ ((nsIDOMHTMLDocument)document).getTitle (storage);
+ return Base.StringGet (storage);
+ }
+ set {
+ Base.StringSet (storage, value);
+ ((nsIDOMHTMLDocument)document).setTitle (storage);
+ }
+ }
+
+ public string Url {
+ get {
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
+ ((nsIDOMHTMLDocument)document).getURL (storage);
+ return Base.StringGet (storage);
+ }
+ }
public string VisitedLinkColor {
get {
- if (!(document is nsIDOMHTMLDocument))\r
- return String.Empty;\r
- nsIDOMHTMLElement element;\r
+ if (!(document is nsIDOMHTMLDocument))
+ return String.Empty;
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).getVLink(storage);
return Base.StringGet (storage);
}
set {
- if (!(document is nsIDOMHTMLDocument))\r
+ if (!(document is nsIDOMHTMLDocument))
return;
Base.StringSet (storage, value);
- nsIDOMHTMLElement element;\r
+ nsIDOMHTMLElement element;
((nsIDOMHTMLDocument)document).getBody (out element);
((nsIDOMHTMLBodyElement)element).setVLink(storage);
}
- }\r
- \r
- public IWindow Window {\r
- get {\r
+ }
+
+ public IWindow Window {
+ get {
nsIDOMDocumentView docView = (nsIDOMDocumentView) this.document;
nsIDOMAbstractView abstractView;
- docView.getDefaultView (out abstractView);\r
- nsIInterfaceRequestor requestor = (nsIInterfaceRequestor) abstractView;\r
- if (requestor == null)\r
+ docView.getDefaultView (out abstractView);
+ nsIInterfaceRequestor requestor = (nsIInterfaceRequestor) abstractView;
+ if (requestor == null)
return null;
IntPtr ret;
requestor.getInterface (typeof(nsIDOMWindow).GUID, out ret);
nsIDOMWindow window = (nsIDOMWindow) Marshal.GetObjectForIUnknown (ret);
- return new Window (this.control, window);\r
- }\r
+ return new Window (this.control, window);
+ }
}
#endregion
-\r
+
#region Public IDocument Methods
public IAttribute CreateAttribute (string name)
{
nsIDOMAttr nsAttribute;
Base.StringSet (storage, name);
- this.document.createAttribute (storage, out nsAttribute);\r
+ this.document.createAttribute (storage, out nsAttribute);
return new Attribute (control, nsAttribute);
}
-\r
+
public IElement CreateElement (string tagName)
{
nsIDOMElement nsElement;
Base.StringSet (storage, tagName);
- this.document.createElement (storage, out nsElement);\r
- if (document is nsIDOMHTMLDocument)\r
- return new HTMLElement (control, (nsIDOMHTMLElement)nsElement);\r
+ this.document.createElement (storage, out nsElement);
+ if (document is nsIDOMHTMLDocument)
+ return new HTMLElement (control, (nsIDOMHTMLElement)nsElement);
return new Element (control, nsElement);
}
-\r
- public IElement GetElementById (string id)\r
- {\r
- if (!resources.Contains ("GetElementById" + id)) {\r
- nsIDOMElement nsElement;\r
- Base.StringSet (storage, id);\r
- this.document.getElementById (storage, out nsElement);\r
- if (nsElement == null)\r
- return null;\r
- resources.Add ("GetElementById" + id, new HTMLElement (control, nsElement as nsIDOMHTMLElement));\r
- }\r
- return resources["GetElementById" + id] as IElement;\r
- }\r
-\r
- public IElementCollection GetElementsByTagName (string name)\r
- {\r
- if (!resources.Contains ("GetElementsByTagName" + name)) {\r
- nsIDOMNodeList nodes;\r
+
+ public IElement GetElementById (string id)
+ {
+ if (!resources.Contains ("GetElementById" + id)) {
+ nsIDOMElement nsElement;
+ Base.StringSet (storage, id);
+ this.document.getElementById (storage, out nsElement);
+ if (nsElement == null)
+ return null;
+ resources.Add ("GetElementById" + id, new HTMLElement (control, nsElement as nsIDOMHTMLElement));
+ }
+ return resources["GetElementById" + id] as IElement;
+ }
+
+ public IElementCollection GetElementsByTagName (string name)
+ {
+ if (!resources.Contains ("GetElementsByTagName" + name)) {
+ nsIDOMNodeList nodes;
this.document.getElementsByTagName (storage, out nodes);
- if (nodes == null)\r
- return null;\r
- resources.Add ("GetElementsByTagName" + name, new HTMLElementCollection(control, nodes));\r
- }\r
- return resources["GetElementsByTagName" + name] as IElementCollection;\r
- }\r
+ if (nodes == null)
+ return null;
+ resources.Add ("GetElementsByTagName" + name, new HTMLElementCollection(control, nodes));
+ }
+ return resources["GetElementsByTagName" + name] as IElementCollection;
+ }
public IElement GetElement (int x, int y)
{
}
}
return ret;
- }\r
+ }
public bool Equals (IDocument obj) {
Document doc = (Document) obj;
}
public void Write (string text) {
- if (!(document is nsIDOMHTMLDocument))\r
- return;\r
+ if (!(document is nsIDOMHTMLDocument))
+ return;
Base.StringSet (storage, text);
((nsIDOMHTMLDocument)document).write (storage);
- }\r
-\r
- public string InvokeScript (string script)\r
- {\r
- return Base.EvalScript (this.control, script);\r
- }\r
+ }
+
+ public string InvokeScript (string script)
+ {
+ return Base.EvalScript (this.control, script);
+ }
#endregion
- \r
- #region Events\r
- private System.ComponentModel.EventHandlerList events;\r
+
+ #region Events
+ private System.ComponentModel.EventHandlerList events;
internal System.ComponentModel.EventHandlerList Events {
get {
if (events == null)
return events;
}
- }\r
- internal static object LoadStoppedEvent = new object ();\r
- public event EventHandler LoadStopped\r
- {\r
- add { Events.AddHandler (LoadStoppedEvent, value); }\r
- remove { Events.RemoveHandler (LoadStoppedEvent, value); }\r
- }\r
- #endregion\r
- \r
+ }
+ internal static object LoadStoppedEvent = new object ();
+ public event EventHandler LoadStopped
+ {
+ add { Events.AddHandler (LoadStoppedEvent, value); }
+ remove { Events.RemoveHandler (LoadStoppedEvent, value); }
+ }
+ #endregion
+
public override int GetHashCode () {
return this.document.GetHashCode ();
- } \r
- }\r
-}\r
+ }
+ }
+}
{
internal class DocumentType : Node, IDocumentType
{
- internal nsIDOMDocumentType doctype;\r
-\r
- public DocumentType (WebBrowser control, nsIDOMDocumentType doctype)\r
- : base (control, doctype as nsIDOMNode)\r
- {\r
- if (control.platform != control.enginePlatform)\r
- this.doctype = nsDOMDocumentType.GetProxy (control, doctype);\r
- else\r
- this.doctype = doctype;\r
+ internal nsIDOMDocumentType doctype;
+
+ public DocumentType (WebBrowser control, nsIDOMDocumentType doctype)
+ : base (control, doctype as nsIDOMNode)
+ {
+ if (control.platform != control.enginePlatform)
+ this.doctype = nsDOMDocumentType.GetProxy (control, doctype);
+ else
+ this.doctype = doctype;
}
-\r
- #region IDisposable Members\r
- protected override void Dispose (bool disposing)\r
- {\r
- if (!disposed) {\r
- if (disposing) {\r
- this.resources.Clear ();\r
- this.doctype = null;\r
- }\r
- }\r
- base.Dispose (disposing);\r
- }\r
+
+ #region IDisposable Members
+ protected override void Dispose (bool disposing)
+ {
+ if (!disposed) {
+ if (disposing) {
+ this.resources.Clear ();
+ this.doctype = null;
+ }
+ }
+ base.Dispose (disposing);
+ }
#endregion
- internal nsIDOMDocumentType ComObject\r
- {\r
- get { return doctype; }\r
+ internal nsIDOMDocumentType ComObject
+ {
+ get { return doctype; }
}
#region IDocumentType
public override int GetHashCode () {
return this.hashcode;
- } \r
-\r
+ }
+
}
}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
{
internal class Element : Node, IElement
{
- internal nsIDOMElement element {\r
- get { return node as nsIDOMElement;}\r
- set { base.node = value as nsIDOMNode; }\r
+ internal nsIDOMElement element {
+ get { return node as nsIDOMElement;}
+ set { base.node = value as nsIDOMNode; }
}
public Element(WebBrowser control, nsIDOMElement domElement) : base (control, domElement as nsIDOMNode)
}
base.Dispose(disposing);
}
- #endregion\r
-\r
- #region Properties\r
+ #endregion
+
+ #region Properties
public virtual IElement AppendChild (IElement child) {
nsIDOMNode newChild;
Element elem = (Element) child;
return new Element (control, newChild as nsIDOMElement);
}
- public virtual string InnerText\r
- {\r
- get\r
- {\r
- nsIDOMDocumentRange docRange = ((Document) control.Document).ComObject as nsIDOMDocumentRange;\r
- nsIDOMRange range;\r
- docRange.createRange (out range);\r
- range.selectNodeContents (this.element);\r
- range.toString (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set\r
- {\r
- Base.StringSet (storage, value);\r
- this.element.setNodeValue (storage);\r
- }\r
- }\r
- \r
- public virtual string OuterText\r
- {\r
- get\r
- {\r
- nsIDOMDocumentRange docRange = ((Document) control.Document).ComObject as nsIDOMDocumentRange;\r
- nsIDOMRange range;\r
- docRange.createRange (out range);\r
- nsIDOMNode parent;\r
- element.getParentNode (out parent);\r
- range.selectNodeContents (parent);\r
- range.toString (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set\r
- {\r
- Base.StringSet (storage, value);\r
- nsIDOMNode parent;\r
- element.getParentNode (out parent);\r
- parent.setNodeValue (storage);\r
- }\r
- } \r
-\r
- public virtual string InnerHTML {\r
- get { return String.Empty; }\r
- set { }\r
- }\r
- \r
- public virtual string OuterHTML {\r
- get { return String.Empty; }\r
- set {}\r
- } \r
-\r
- public IElementCollection All {\r
- get\r
- {\r
+ public virtual string InnerText
+ {
+ get
+ {
+ nsIDOMDocumentRange docRange = ((Document) control.Document).ComObject as nsIDOMDocumentRange;
+ nsIDOMRange range;
+ docRange.createRange (out range);
+ range.selectNodeContents (this.element);
+ range.toString (storage);
+ return Base.StringGet (storage);
+ }
+ set
+ {
+ Base.StringSet (storage, value);
+ this.element.setNodeValue (storage);
+ }
+ }
+
+ public virtual string OuterText
+ {
+ get
+ {
+ nsIDOMDocumentRange docRange = ((Document) control.Document).ComObject as nsIDOMDocumentRange;
+ nsIDOMRange range;
+ docRange.createRange (out range);
+ nsIDOMNode parent;
+ element.getParentNode (out parent);
+ range.selectNodeContents (parent);
+ range.toString (storage);
+ return Base.StringGet (storage);
+ }
+ set
+ {
+ Base.StringSet (storage, value);
+ nsIDOMNode parent;
+ element.getParentNode (out parent);
+ parent.setNodeValue (storage);
+ }
+ }
+
+ public virtual string InnerHTML {
+ get { return String.Empty; }
+ set { }
+ }
+
+ public virtual string OuterHTML {
+ get { return String.Empty; }
+ set {}
+ }
+
+ public IElementCollection All {
+ get
+ {
if (!resources.Contains ("All")) {
HTMLElementCollection col = new HTMLElementCollection (control);
- Recurse (col, this.element); \r
- resources.Add ("All", col);\r
- }\r
- return resources["All"] as IElementCollection;\r
- }\r
+ Recurse (col, this.element);
+ resources.Add ("All", col);
+ }
+ return resources["All"] as IElementCollection;
+ }
}
private void Recurse (HTMLElementCollection col, nsIDOMNode parent) {
- nsIDOMNodeList children;\r
+ nsIDOMNodeList children;
parent.getChildNodes (out children);
uint count;
children.getLength (out count);
for (int i = 0; i < count;i++) {
nsIDOMNode node;
children.item ((uint)i, out node);
- ushort type;\r
+ ushort type;
node.getNodeType (out type);
if (type == (ushort)NodeType.Element) {
col.Add (new HTMLElement (control, (nsIDOMHTMLElement)node));
}
- public IElementCollection Children {\r
- get\r
- {\r
+ public IElementCollection Children {
+ get
+ {
if (!resources.Contains ("Children")) {
- nsIDOMNodeList children;\r
- this.element.getChildNodes (out children);\r
- resources.Add ("Children", new HTMLElementCollection (control, children));\r
- }\r
- return resources["Children"] as IElementCollection;\r
- }\r
+ nsIDOMNodeList children;
+ this.element.getChildNodes (out children);
+ resources.Add ("Children", new HTMLElementCollection (control, children));
+ }
+ return resources["Children"] as IElementCollection;
+ }
}
-\r
- public virtual int TabIndex {\r
- get { return -1; }\r
- set { }\r
- }\r
+
+ public virtual int TabIndex {
+ get { return -1; }
+ set { }
+ }
public virtual string TagName {
get {
element.getTagName (storage);
return Base.StringGet (storage);
}
- }\r
-\r
- public virtual bool Disabled {\r
- get { return false; }\r
- set { }\r
- \r
- }\r
-\r
- public virtual int ClientWidth { \r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getClientWidth (out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int ClientHeight {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getClientHeight (out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int ScrollHeight {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getScrollHeight(out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int ScrollWidth {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getScrollWidth (out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int ScrollLeft {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getScrollLeft (out ret);\r
- return ret;\r
- }\r
- set {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- e.setScrollLeft (value);\r
- }\r
- }\r
- public virtual int ScrollTop {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getScrollTop (out ret);\r
- return ret;\r
- }\r
- set {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- e.setScrollTop (value);\r
- }\r
- }\r
- public virtual int OffsetHeight {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getOffsetHeight (out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int OffsetWidth {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getOffsetWidth (out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int OffsetLeft {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getOffsetLeft (out ret);\r
- return ret;\r
- }\r
- }\r
- public virtual int OffsetTop {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- int ret = 0;\r
- e.getOffsetTop (out ret);\r
- return ret;\r
- }\r
}
- public virtual IElement OffsetParent {\r
- get {\r
- nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;\r
- nsIDOMElement ret;\r
- e.getOffsetParent (out ret);\r
- if ((ret as nsIDOMHTMLElement) != null)\r
- return new HTMLElement (this.control, ret as nsIDOMHTMLElement);\r
+ public virtual bool Disabled {
+ get { return false; }
+ set { }
+
+ }
+
+ public virtual int ClientWidth {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getClientWidth (out ret);
+ return ret;
+ }
+ }
+ public virtual int ClientHeight {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getClientHeight (out ret);
+ return ret;
+ }
+ }
+ public virtual int ScrollHeight {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getScrollHeight(out ret);
+ return ret;
+ }
+ }
+ public virtual int ScrollWidth {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getScrollWidth (out ret);
+ return ret;
+ }
+ }
+ public virtual int ScrollLeft {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getScrollLeft (out ret);
+ return ret;
+ }
+ set {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ e.setScrollLeft (value);
+ }
+ }
+ public virtual int ScrollTop {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getScrollTop (out ret);
+ return ret;
+ }
+ set {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ e.setScrollTop (value);
+ }
+ }
+ public virtual int OffsetHeight {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getOffsetHeight (out ret);
+ return ret;
+ }
+ }
+ public virtual int OffsetWidth {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getOffsetWidth (out ret);
+ return ret;
+ }
+ }
+ public virtual int OffsetLeft {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getOffsetLeft (out ret);
+ return ret;
+ }
+ }
+ public virtual int OffsetTop {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ int ret = 0;
+ e.getOffsetTop (out ret);
+ return ret;
+ }
+ }
+
+ public virtual IElement OffsetParent {
+ get {
+ nsIDOMNSHTMLElement e = this.element as nsIDOMNSHTMLElement;
+ nsIDOMElement ret;
+ e.getOffsetParent (out ret);
+ if ((ret as nsIDOMHTMLElement) != null)
+ return new HTMLElement (this.control, ret as nsIDOMHTMLElement);
return new Element (this.control, ret);
}
#endregion
#region Methods
-\r
- public void Blur () {\r
- nsIDOMNSHTMLElement elm = element as nsIDOMNSHTMLElement;\r
- if (elm != null) {\r
- elm.blur ();\r
- }\r
- }
-\r
+
+ public void Blur () {
+ nsIDOMNSHTMLElement elm = element as nsIDOMNSHTMLElement;
+ if (elm != null) {
+ elm.blur ();
+ }
+ }
+
public bool Equals (IElement obj) {
Element doc = (Element) obj;
return doc.element == this.element;
}
-\r
- public void Focus () {\r
- nsIDOMNSHTMLElement elm = element as nsIDOMNSHTMLElement;\r
- if (elm != null) {\r
- elm.focus ();\r
- }\r
+
+ public void Focus () {
+ nsIDOMNSHTMLElement elm = element as nsIDOMNSHTMLElement;
+ if (elm != null) {
+ elm.focus ();
+ }
}
- public IElementCollection GetElementsByTagName (string name)\r
- {\r
- if (!resources.Contains ("GetElementsByTagName" + name)) {\r
- nsIDOMNodeList nodes;\r
+ public IElementCollection GetElementsByTagName (string name)
+ {
+ if (!resources.Contains ("GetElementsByTagName" + name)) {
+ nsIDOMNodeList nodes;
this.element.getElementsByTagName (storage, out nodes);
- resources.Add ("GetElementsByTagName" + name, new HTMLElementCollection(control, nodes));\r
- }\r
- return resources["GetElementsByTagName" + name] as IElementCollection;\r
+ resources.Add ("GetElementsByTagName" + name, new HTMLElementCollection(control, nodes));
+ }
+ return resources["GetElementsByTagName" + name] as IElementCollection;
}
- \r
+
public override int GetHashCode () {
return this.hashcode;
}
-\r
- public virtual bool HasAttribute (string name)\r
- {\r
- bool ret;\r
- Base.StringSet (storage, name);\r
- element.hasAttribute (storage, out ret);\r
- return ret;\r
- }\r
-\r
- public virtual string GetAttribute (string name) {\r
- UniString ret = new UniString (String.Empty);\r
- Base.StringSet (storage, name);\r
- element.getAttribute (storage, ret.Handle);\r
- return ret.ToString ();\r
- }\r
-\r
- public void ScrollIntoView (bool alignWithTop) \r
- {\r
- nsIDOMNSHTMLElement elm = element as nsIDOMNSHTMLElement;\r
- if (elm != null) {\r
- elm.scrollIntoView (alignWithTop);\r
- }\r
- }\r
+
+ public virtual bool HasAttribute (string name)
+ {
+ bool ret;
+ Base.StringSet (storage, name);
+ element.hasAttribute (storage, out ret);
+ return ret;
+ }
+
+ public virtual string GetAttribute (string name) {
+ UniString ret = new UniString (String.Empty);
+ Base.StringSet (storage, name);
+ element.getAttribute (storage, ret.Handle);
+ return ret.ToString ();
+ }
+
+ public void ScrollIntoView (bool alignWithTop)
+ {
+ nsIDOMNSHTMLElement elm = element as nsIDOMNSHTMLElement;
+ if (elm != null) {
+ elm.scrollIntoView (alignWithTop);
+ }
+ }
- public virtual void SetAttribute (string name, string value) {\r
- UniString strVal = new UniString (value);\r
- Base.StringSet (storage, name);\r
- element.setAttribute (storage, strVal.Handle);\r
+ public virtual void SetAttribute (string name, string value) {
+ UniString strVal = new UniString (value);
+ Base.StringSet (storage, name);
+ element.setAttribute (storage, strVal.Handle);
}
#endregion
((nsIDOMNSHTMLElement)this.element).getOffsetTop (out ret);
return ret;
}
- }\r
+ }
internal int Left {
get {
((nsIDOMNSHTMLElement)this.element).getOffsetLeft (out ret);
return ret;
}
- }\r
+ }
internal int Width {
get {
((nsIDOMNSHTMLElement)this.element).getOffsetWidth (out ret);
return ret;
}
- }\r
+ }
internal int Height {
get {
-// 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, 2008 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 HTMLElement : Element, IElement\r
- {\r
- private nsIDOMHTMLElement element {\r
- get { return base.element as nsIDOMHTMLElement; }\r
- set { base.element = value as nsIDOMElement; }\r
- }\r
-\r
- public HTMLElement (WebBrowser control, nsIDOMHTMLElement domHtmlElement) : base (control, domHtmlElement as nsIDOMElement)\r
- {\r
- this.element = domHtmlElement;\r
- }\r
-\r
- #region IDisposable Members\r
- protected override void Dispose (bool disposing)\r
- {\r
- if (!disposed) {\r
- if (disposing) {\r
- this.element = null;\r
- }\r
- }\r
- base.Dispose(disposing);\r
- } \r
- #endregion\r
-\r
- #region IElement Members\r
- public new string InnerHTML\r
- {\r
- get {\r
- nsIDOMNSHTMLElement nsElem = this.element as nsIDOMNSHTMLElement;\r
- nsElem.getInnerHTML (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set {\r
- nsIDOMNSHTMLElement nsElem = this.element as nsIDOMNSHTMLElement;\r
- Base.StringSet (storage, value);\r
- nsElem.setInnerHTML (storage);\r
- }\r
- }\r
-\r
- public override string OuterHTML\r
- {\r
- // bad emulation of outerHTML since gecko doesn't support it :P\r
- get {\r
- string tag = this.TagName;\r
- string str = "<" + tag;\r
- foreach (IAttribute att in this.Attributes) {\r
- str += " " + att.Name + "=\"" + att.Value + "\"";\r
- }\r
- nsIDOMNSHTMLElement nsElem = this.element as nsIDOMNSHTMLElement;\r
- nsElem.getInnerHTML (storage);\r
- str += ">" + Base.StringGet (storage) + "</" + tag + ">";\r
- return str;\r
- }\r
- set {\r
- nsIDOMDocumentRange docRange = ((Document) control.Document).ComObject as nsIDOMDocumentRange;\r
- nsIDOMRange range;\r
- docRange.createRange (out range);\r
- range.setStartBefore (this.element);\r
- nsIDOMNSRange nsRange = range as nsIDOMNSRange;\r
- Base.StringSet (storage, value);\r
- nsIDOMDocumentFragment fragment;\r
- nsRange.createContextualFragment (storage, out fragment);\r
- nsIDOMNode parent;\r
- this.element.getParentNode (out parent);\r
- parent = nsDOMNode.GetProxy (this.control, parent);\r
- nsIDOMNode newNode;\r
- parent.replaceChild (fragment as nsIDOMNode, this.element as nsIDOMNode, out newNode);\r
- this.element = newNode as Mono.Mozilla.nsIDOMHTMLElement;\r
- }\r
- }\r
- \r
- public override bool Disabled\r
- { \r
- get {\r
- if (this.HasAttribute ("disabled")) {\r
- string dis = this.GetAttribute ("disabled");\r
- return bool.Parse (dis);\r
- }\r
- return false;\r
- }\r
- set {\r
- if (this.HasAttribute ("disabled")) {\r
- this.SetAttribute ("disabled", value.ToString ());\r
- }\r
- }\r
- }\r
-\r
- public override int TabIndex {\r
- get { \r
- int tabIndex;\r
- ((nsIDOMNSHTMLElement)this.element).getTabIndex (out tabIndex);\r
- return tabIndex;\r
- }\r
- set { \r
- ((nsIDOMNSHTMLElement)this.element).setTabIndex (value);\r
- }\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.Mozilla.DOM
+{
+ internal class HTMLElement : Element, IElement
+ {
+ private nsIDOMHTMLElement element {
+ get { return base.element as nsIDOMHTMLElement; }
+ set { base.element = value as nsIDOMElement; }
+ }
+
+ public HTMLElement (WebBrowser control, nsIDOMHTMLElement domHtmlElement) : base (control, domHtmlElement as nsIDOMElement)
+ {
+ this.element = domHtmlElement;
+ }
+
+ #region IDisposable Members
+ protected override void Dispose (bool disposing)
+ {
+ if (!disposed) {
+ if (disposing) {
+ this.element = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+ #endregion
+
+ #region IElement Members
+ public new string InnerHTML
+ {
+ get {
+ nsIDOMNSHTMLElement nsElem = this.element as nsIDOMNSHTMLElement;
+ nsElem.getInnerHTML (storage);
+ return Base.StringGet (storage);
+ }
+ set {
+ nsIDOMNSHTMLElement nsElem = this.element as nsIDOMNSHTMLElement;
+ Base.StringSet (storage, value);
+ nsElem.setInnerHTML (storage);
+ }
+ }
+
+ public override string OuterHTML
+ {
+ // bad emulation of outerHTML since gecko doesn't support it :P
+ get {
+ string tag = this.TagName;
+ string str = "<" + tag;
+ foreach (IAttribute att in this.Attributes) {
+ str += " " + att.Name + "=\"" + att.Value + "\"";
+ }
+ nsIDOMNSHTMLElement nsElem = this.element as nsIDOMNSHTMLElement;
+ nsElem.getInnerHTML (storage);
+ str += ">" + Base.StringGet (storage) + "</" + tag + ">";
+ return str;
+ }
+ set {
+ nsIDOMDocumentRange docRange = ((Document) control.Document).ComObject as nsIDOMDocumentRange;
+ nsIDOMRange range;
+ docRange.createRange (out range);
+ range.setStartBefore (this.element);
+ nsIDOMNSRange nsRange = range as nsIDOMNSRange;
+ Base.StringSet (storage, value);
+ nsIDOMDocumentFragment fragment;
+ nsRange.createContextualFragment (storage, out fragment);
+ nsIDOMNode parent;
+ this.element.getParentNode (out parent);
+ parent = nsDOMNode.GetProxy (this.control, parent);
+ nsIDOMNode newNode;
+ parent.replaceChild (fragment as nsIDOMNode, this.element as nsIDOMNode, out newNode);
+ this.element = newNode as Mono.Mozilla.nsIDOMHTMLElement;
+ }
+ }
+
+ public override bool Disabled
+ {
+ get {
+ if (this.HasAttribute ("disabled")) {
+ string dis = this.GetAttribute ("disabled");
+ return bool.Parse (dis);
+ }
+ return false;
+ }
+ set {
+ if (this.HasAttribute ("disabled")) {
+ this.SetAttribute ("disabled", value.ToString ());
+ }
+ }
+ }
+
+ public override int TabIndex {
+ get {
+ int tabIndex;
+ ((nsIDOMNSHTMLElement)this.element).getTabIndex (out tabIndex);
+ return tabIndex;
+ }
+ set {
+ ((nsIDOMNSHTMLElement)this.element).setTabIndex (value);
+ }
}
public override int GetHashCode () {
return this.hashcode;
- }\r
- #endregion\r
- }\r
-}\r
+ }
+ #endregion
+ }
+}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
for (int i = 0; i < count;i++) {
nsIDOMNode node;
unmanagedNodes.item ((uint)i, out node);
- ushort type;\r
+ ushort type;
node.getNodeType (out type);
if (type == (ushort)NodeType.Element)
tmpnodes[nodeCount++] = new HTMLElement (control, (nsIDOMHTMLElement)node);
// Andreia Gaita (avidigal@novell.com)
//
-using System;\r
-using System.Runtime.InteropServices;\r
-using System.Text;\r
-using System.Collections;\r
-using Mono.WebBrowser;\r
-using Mono.WebBrowser.DOM;\r
-\r
-namespace Mono.Mozilla.DOM\r
-{\r
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Collections;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.Mozilla.DOM
+{
internal class History : DOMObject, IHistory
{
private Navigation navigation;
- public History (WebBrowser control, Navigation navigation)\r
- : base (control)\r
- {\r
- this.navigation = navigation;\r
+ public History (WebBrowser control, Navigation navigation)
+ : base (control)
+ {
+ this.navigation = navigation;
}
- \r
+
public int Count {
get { return navigation.HistoryCount; }
}
nsIURI uri;
history.getEntryAtIndex(i, false, out entry);
entry.getURI (out uri);
- AsciiString spec = new AsciiString(String.Empty);\r
- uri.getSpec (spec.Handle);\r
+ AsciiString spec = new AsciiString(String.Empty);
+ uri.getSpec (spec.Handle);
if (string.Compare (spec.ToString (), url, true) == 0) {
index = i;
break;
// Andreia Gaita (avidigal@novell.com)
//
-using System;\r
+using System;
using System.Collections;
#if NET_2_0
using System.Collections.Generic;
-#endif\r
-using Mono.WebBrowser;\r
-using Mono.WebBrowser.DOM;\r
+#endif
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
namespace Mono.Mozilla.DOM
{
internal class NamedNodeMap : NodeList, INamedNodeMap
{
- protected new nsIDOMNamedNodeMap unmanagedNodes;\r
-\r
- public NamedNodeMap (WebBrowser control, nsIDOMNamedNodeMap nodeMap)\r
- : base (control, true)\r
- {\r
- if (control.platform != control.enginePlatform)\r
- unmanagedNodes = nsDOMNamedNodeMap.GetProxy (control, nodeMap);\r
- else\r
- unmanagedNodes = nodeMap;\r
+ protected new nsIDOMNamedNodeMap unmanagedNodes;
+
+ public NamedNodeMap (WebBrowser control, nsIDOMNamedNodeMap nodeMap)
+ : base (control, true)
+ {
+ if (control.platform != control.enginePlatform)
+ unmanagedNodes = nsDOMNamedNodeMap.GetProxy (control, nodeMap);
+ else
+ unmanagedNodes = nodeMap;
}
- internal override void Load ()\r
- {\r
- Clear ();\r
- uint count;\r
- unmanagedNodes.getLength (out count);\r
- nodeCount = (int) count;\r
- nodes = new Node[count];\r
- for (int i = 0; i < count; i++) {\r
- nsIDOMNode node;\r
- unmanagedNodes.item ((uint) i, out node);\r
- nodes[i] = new Attribute (control, node as nsIDOMAttr);\r
- }\r
- }\r
+ internal override void Load ()
+ {
+ Clear ();
+ uint count;
+ unmanagedNodes.getLength (out count);
+ nodeCount = (int) count;
+ nodes = new Node[count];
+ for (int i = 0; i < count; i++) {
+ nsIDOMNode node;
+ unmanagedNodes.item ((uint) i, out node);
+ nodes[i] = new Attribute (control, node as nsIDOMAttr);
+ }
+ }
public override int Count {
- get {\r
- if (unmanagedNodes != null && nodes == null)\r
- Load ();\r
+ get {
+ if (unmanagedNodes != null && nodes == null)
+ Load ();
return nodeCount;
}
- }\r
+ }
- #region IList members\r
- public new INode this[int index]\r
- {\r
- get\r
- {\r
- if (index < 0 || index >= Count)\r
- throw new ArgumentOutOfRangeException ("index");\r
- return nodes[index] as INode;\r
- }\r
- set { }\r
- }\r
+ #region IList members
+ public new INode this[int index]
+ {
+ get
+ {
+ if (index < 0 || index >= Count)
+ throw new ArgumentOutOfRangeException ("index");
+ return nodes[index] as INode;
+ }
+ set { }
+ }
- public INode this [string name]\r
+ public INode this [string name]
{
- get {\r
- Base.StringSet (storage, name);\r
- nsIDOMNode ret;\r
- unmanagedNodes.getNamedItem (storage, out ret);\r
+ get {
+ Base.StringSet (storage, name);
+ nsIDOMNode ret;
+ unmanagedNodes.getNamedItem (storage, out ret);
for (int i = 0; i < Count; i++) {
if (nodes[i].GetHashCode ().Equals (ret.GetHashCode ()))
return nodes[i];
- }\r
+ }
return null;
}
set {
- }\r
+ }
}
public INode RemoveNamedItem (string name) {
this.Remove (nodes[i]);
return node;
}
- }\r
+ }
return null;
}
public INode this[string namespaceURI, string localName] {
get {
Base.StringSet (storage, namespaceURI);
- UniString str = new Mono.Mozilla.UniString(localName);\r
- nsIDOMNode ret;\r
+ UniString str = new Mono.Mozilla.UniString(localName);
+ nsIDOMNode ret;
unmanagedNodes.getNamedItemNS (storage, str.Handle, out ret);
for (int i = 0; i < Count; i++) {
if (nodes[i].GetHashCode ().Equals (ret.GetHashCode ()))
return nodes[i];
- }\r
+ }
return null;
}
set {
this.Remove (nodes[i]);
return node;
}
- }\r
+ }
return null;
}
- \r
+
#endregion
public override int GetHashCode () {
-// 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, 2008 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: DOMObject, INavigation\r
- {\r
-\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.Mozilla.DOM
+{
+ internal class Navigation: DOMObject, INavigation
+ {
+
internal nsIWebNavigation navigation;
- \r
- public Navigation (WebBrowser control, nsIWebNavigation webNav) : base (control)\r
- {\r
- this.navigation = webNav;\r
- }\r
+
+ public Navigation (WebBrowser control, nsIWebNavigation webNav) : base (control)
+ {
+ this.navigation = webNav;
+ }
- #region IDisposable Members\r
+ #region IDisposable Members
protected override void Dispose (bool disposing)
{
if (!disposed) {
}
}
base.Dispose(disposing);
- } \r
+ }
#endregion
-\r
- #region INavigation Members\r
-\r
- public bool CanGoBack {\r
+
+ #region INavigation Members
+
+ public bool CanGoBack {
get {
if (navigation == null)
return false;
- \r
- bool canGoBack;\r
- navigation.getCanGoBack (out canGoBack);\r
- return canGoBack;\r
- }\r
- }\r
-\r
- public bool CanGoForward {\r
- get {\r
+
+ bool canGoBack;
+ navigation.getCanGoBack (out canGoBack);
+ return canGoBack;
+ }
+ }
+
+ public bool CanGoForward {
+ get {
if (navigation == null)
return false;
- bool canGoForward;\r
- navigation.getCanGoForward (out canGoForward);\r
- return canGoForward;\r
- }\r
- }\r
-\r
- public bool Back ()\r
- {\r
+ bool canGoForward;
+ navigation.getCanGoForward (out canGoForward);
+ return canGoForward;
+ }
+ }
+
+ public bool Back ()
+ {
if (navigation == null)
return false;
control.Reset ();
- return navigation.goBack () == 0;\r
- }\r
-\r
- public bool Forward ()\r
- {\r
+ return navigation.goBack () == 0;
+ }
+
+ public bool Forward ()
+ {
if (navigation == null)
return false;
control.Reset ();
- return navigation.goForward () == 0;\r
- }\r
-\r
- public void Home ()\r
- {\r
+ return navigation.goForward () == 0;
+ }
+
+ public void Home ()
+ {
control.Reset ();
- Base.Home (control);\r
- }\r
-\r
- public void Reload ()\r
- {\r
- Reload (ReloadOption.None);\r
- }\r
-\r
- public void Reload (ReloadOption option)\r
- {\r
+ Base.Home (control);
+ }
+
+ public void Reload ()
+ {
+ Reload (ReloadOption.None);
+ }
+
+ public void Reload (ReloadOption option)
+ {
if (navigation == null)
return;
control.Reset ();
if (option == ReloadOption.None)
- navigation.reload ((uint)LoadFlags.None);\r
- else if (option == ReloadOption.Proxy)\r
- navigation.reload ((uint) LoadFlags.BypassLocalCache);\r
- else if (option == ReloadOption.Full)\r
- navigation.reload ((uint) LoadFlags.BypassProxy);\r
- }\r
-\r
- public void Stop ()\r
- {\r
+ navigation.reload ((uint)LoadFlags.None);
+ else if (option == ReloadOption.Proxy)
+ navigation.reload ((uint) LoadFlags.BypassLocalCache);
+ else if (option == ReloadOption.Full)
+ navigation.reload ((uint) LoadFlags.BypassProxy);
+ }
+
+ public void Stop ()
+ {
if (navigation == null)
return;
- navigation.stop ((uint)StopOption.All);\r
+ navigation.stop ((uint)StopOption.All);
}
control.Reset ();
navigation.loadURI (url, (uint)LoadFlags.None, null, null, null);
- }\r
+ }
public void Go (string url, LoadFlags flags)
{
control.Reset ();
navigation.loadURI (url, (uint)flags, null, null, null);
- }\r
-\r
- public int HistoryCount {\r
- get {\r
- nsISHistory history;\r
- int count;\r
- navigation.getSessionHistory (out history);\r
- history.getCount (out count);\r
- return count;\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- internal Document Document\r
- {\r
- get {\r
- nsIDOMDocument doc;\r
- this.navigation.getDocument (out doc);\r
- int hashcode = doc.GetHashCode ();\r
- if (!resources.ContainsKey (hashcode)) {\r
- resources.Add (hashcode, new Document (control, doc as nsIDOMHTMLDocument));\r
- }\r
- return resources [hashcode] as Document;\r
- }\r
+ }
+
+ public int HistoryCount {
+ get {
+ nsISHistory history;
+ int count;
+ navigation.getSessionHistory (out history);
+ history.getCount (out count);
+ return count;
+ }
+ }
+
+ #endregion
+
+ internal Document Document
+ {
+ get {
+ nsIDOMDocument doc;
+ this.navigation.getDocument (out doc);
+ int hashcode = doc.GetHashCode ();
+ if (!resources.ContainsKey (hashcode)) {
+ resources.Add (hashcode, new Document (control, doc as nsIDOMHTMLDocument));
+ }
+ return resources [hashcode] as Document;
+ }
}
public override int GetHashCode () {
return this.navigation.GetHashCode ();
- } \r
- }\r
-}\r
+ }
+ }
+}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
-using System.Text;\r
-using System.ComponentModel;\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Text;
+using System.ComponentModel;
using System.Runtime.InteropServices;
-using System.Collections;\r
-using Mono.WebBrowser;\r
+using System.Collections;
+using Mono.WebBrowser;
using Mono.WebBrowser.DOM;
-\r
-namespace Mono.Mozilla.DOM\r
-{\r
- internal class Node: DOMObject, INode\r
- {\r
- private nsIDOMNode _node;\r
- internal nsIDOMNode node {\r
- get { return _node; }\r
- set {\r
- if (!(value is nsIDOMHTMLDocument) && control.platform != control.enginePlatform)\r
+
+namespace Mono.Mozilla.DOM
+{
+ internal class Node: DOMObject, INode
+ {
+ private nsIDOMNode _node;
+ internal nsIDOMNode node {
+ get { return _node; }
+ set {
+ if (!(value is nsIDOMHTMLDocument) && control.platform != control.enginePlatform)
_node = nsDOMNode.GetProxy (control, value);
else
- _node = value;\r
- }\r
- }\r
+ _node = value;
+ }
+ }
protected int hashcode;
private EventListener eventListener;
- private WebBrowser control;\r
- \r
- public Node (WebBrowser control, nsIDOMNode domNode) : base (control)\r
+ private WebBrowser control;
+
+ public Node (WebBrowser control, nsIDOMNode domNode) : base (control)
{
- hashcode = domNode.GetHashCode ();\r
- this.control = control;\r
+ hashcode = domNode.GetHashCode ();
+ this.control = control;
this.node = domNode;
- }\r
+ }
- #region IDisposable Members\r
+ #region IDisposable Members
protected override void Dispose (bool disposing)
{
if (!disposed) {
}
}
base.Dispose(disposing);
- } \r
+ }
#endregion
- #region INode Members\r
- public virtual IAttributeCollection Attributes\r
- {\r
- get\r
- {\r
- if (!resources.Contains ("Attributes")) {\r
- nsIDOMNamedNodeMap attributes;\r
- this.node.getAttributes (out attributes);\r
- if (attributes == null)\r
- return new AttributeCollection (control);\r
- resources.Add ("Attributes", new AttributeCollection (control, attributes));\r
- }\r
- return resources["Attributes"] as IAttributeCollection;\r
- }\r
+ #region INode Members
+ public virtual IAttributeCollection Attributes
+ {
+ get
+ {
+ if (!resources.Contains ("Attributes")) {
+ nsIDOMNamedNodeMap attributes;
+ this.node.getAttributes (out attributes);
+ if (attributes == null)
+ return new AttributeCollection (control);
+ resources.Add ("Attributes", new AttributeCollection (control, attributes));
+ }
+ return resources["Attributes"] as IAttributeCollection;
+ }
}
public virtual INodeList ChildNodes {
public virtual string LocalName {
get {
- this.node.getLocalName (storage);\r
+ this.node.getLocalName (storage);
return Base.StringGet (storage);
}
}
public IDocument Owner {
get {
nsIDOMDocument doc;
- this.node.getOwnerDocument (out doc);\r
- if (!control.documents.ContainsKey (doc.GetHashCode ()))\r
+ this.node.getOwnerDocument (out doc);
+ if (!control.documents.ContainsKey (doc.GetHashCode ()))
control.documents.Add (doc.GetHashCode (), new Document (control, doc as Mono.Mozilla.nsIDOMHTMLDocument));
return control.documents[doc.GetHashCode ()] as IDocument;
}
}
-\r
- public string Style {\r
- get { \r
+
+ public string Style {
+ get {
nsIDOMDocument doc;
- this.node.getOwnerDocument (out doc);\r
+ this.node.getOwnerDocument (out doc);
nsIDOMDocumentView docView = (nsIDOMDocumentView) doc;
nsIDOMAbstractView abstractView;
- docView.getDefaultView (out abstractView);\r
- nsIDOMViewCSS viewCss = (nsIDOMViewCSS)abstractView;\r
- Base.StringSet (storage, String.Empty);\r
- nsIDOMCSSStyleDeclaration styleDecl;\r
- AsciiString s = new Mono.Mozilla.AsciiString(String.Empty);\r
- viewCss.getComputedStyle (this.node as Mono.Mozilla.nsIDOMElement, s.Handle, out styleDecl);\r
- styleDecl.getCssText (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set {\r
+ docView.getDefaultView (out abstractView);
+ nsIDOMViewCSS viewCss = (nsIDOMViewCSS)abstractView;
+ Base.StringSet (storage, String.Empty);
+ nsIDOMCSSStyleDeclaration styleDecl;
+ AsciiString s = new Mono.Mozilla.AsciiString(String.Empty);
+ viewCss.getComputedStyle (this.node as Mono.Mozilla.nsIDOMElement, s.Handle, out styleDecl);
+ styleDecl.getCssText (storage);
+ return Base.StringGet (storage);
+ }
+ set {
nsIDOMDocument doc;
- this.node.getOwnerDocument (out doc);\r
+ this.node.getOwnerDocument (out doc);
nsIDOMDocumentView docView = (nsIDOMDocumentView) doc;
nsIDOMAbstractView abstractView;
- docView.getDefaultView (out abstractView);\r
- nsIDOMViewCSS viewCss = (nsIDOMViewCSS)abstractView;\r
- Base.StringSet (storage, String.Empty);\r
- nsIDOMCSSStyleDeclaration styleDecl;\r
- viewCss.getComputedStyle (this.node as Mono.Mozilla.nsIDOMElement, storage, out styleDecl);\r
- Base.StringSet (storage, value);\r
- styleDecl.setCssText (storage); \r
- }\r
- }\r
+ docView.getDefaultView (out abstractView);
+ nsIDOMViewCSS viewCss = (nsIDOMViewCSS)abstractView;
+ Base.StringSet (storage, String.Empty);
+ nsIDOMCSSStyleDeclaration styleDecl;
+ viewCss.getComputedStyle (this.node as Mono.Mozilla.nsIDOMElement, storage, out styleDecl);
+ Base.StringSet (storage, value);
+ styleDecl.setCssText (storage);
+ }
+ }
public virtual Mono.WebBrowser.DOM.NodeType Type {
get {
return (Mono.WebBrowser.DOM.NodeType) Enum.ToObject (typeof (Mono.WebBrowser.DOM.NodeType), type);
}
}
-\r
- public virtual string Value {\r
- get\r
- {\r
- this.node.getNodeValue (storage);\r
- return Base.StringGet (storage);\r
- }\r
- set {\r
- Base.StringSet (storage, value);\r
- node.setNodeValue (storage);\r
- }\r
+
+ public virtual string Value {
+ get
+ {
+ this.node.getNodeValue (storage);
+ return Base.StringGet (storage);
+ }
+ set {
+ Base.StringSet (storage, value);
+ node.setNodeValue (storage);
+ }
}
#endregion
- #region Methods\r
- public virtual void FireEvent (string eventName)\r
- {\r
- nsIDOMDocument doc;\r
- this.node.getOwnerDocument (out doc);\r
-\r
- nsIDOMDocumentEvent docEvent = (nsIDOMDocumentEvent) doc;\r
- nsIDOMDocumentView docView = (nsIDOMDocumentView) doc;\r
- nsIDOMAbstractView abstractView;\r
- docView.getDefaultView (out abstractView);\r
- nsIDOMEventTarget target = (nsIDOMEventTarget) this.node;\r
- bool ret = false;\r
-\r
- string eventType;\r
- switch (eventName) {\r
- case "mousedown":\r
- case "mouseup":\r
- case "click":\r
- case "dblclick":\r
- case "mouseover":\r
- case "mouseout":\r
- case "mousemove":\r
- case "contextmenu":\r
- eventType = "mouseevents";\r
- nsIDOMEvent evtMouse;\r
- Base.StringSet (storage, eventType);\r
- docEvent.createEvent (storage, out evtMouse);\r
- nsIDOMMouseEvent domEventMouse = evtMouse as nsIDOMMouseEvent;\r
- Base.StringSet (storage, eventName);\r
- domEventMouse.initMouseEvent (storage, true, true, abstractView, 1, 0, 0, 0, 0, false, false, false, false, 0, target);\r
- target.dispatchEvent (domEventMouse, out ret);\r
- break;\r
- case "keydown":\r
- case "keyup":\r
- case "keypress":\r
- eventType = "keyevents";\r
- nsIDOMEvent evtKey;\r
- Base.StringSet (storage, eventType);\r
- docEvent.createEvent (storage, out evtKey);\r
- Base.StringSet (storage, eventName);\r
- nsIDOMKeyEvent domEventKey = evtKey as nsIDOMKeyEvent;\r
- domEventKey.initKeyEvent (storage, true, true, abstractView, false, false, false, false, 0, 0);\r
- target.dispatchEvent (domEventKey, out ret);\r
- break;\r
- case "DOMActivate":\r
- case "DOMFocusIn":\r
- case "DOMFocusOut":\r
- case "input":\r
- eventType = "uievents";\r
- nsIDOMEvent evtUI;\r
- Base.StringSet (storage, eventType);\r
- docEvent.createEvent (storage, out evtUI);\r
- Base.StringSet (storage, eventName);\r
- nsIDOMUIEvent domEventUI = evtUI as nsIDOMUIEvent;\r
- domEventUI.initUIEvent (storage, true, true, abstractView, 1);\r
- target.dispatchEvent (domEventUI, out ret);\r
- break;\r
- case "focus":\r
- case "blur":\r
- case "submit":\r
- case "reset":\r
- case "change":\r
- case "select":\r
- case "load":\r
- case "beforeunload":\r
- case "unload":\r
- case "abort":\r
- case "error":\r
- default:\r
- eventType = "events";\r
- nsIDOMEvent domEvent;\r
- Base.StringSet (storage, eventType);\r
- docEvent.createEvent (storage, out domEvent);\r
- Base.StringSet (storage, eventName);\r
- domEvent.initEvent (storage, true, true);\r
- target.dispatchEvent (domEvent, out ret);\r
- break;\r
- }\r
-\r
- }\r
+ #region Methods
+ public virtual void FireEvent (string eventName)
+ {
+ nsIDOMDocument doc;
+ this.node.getOwnerDocument (out doc);
+
+ nsIDOMDocumentEvent docEvent = (nsIDOMDocumentEvent) doc;
+ nsIDOMDocumentView docView = (nsIDOMDocumentView) doc;
+ nsIDOMAbstractView abstractView;
+ docView.getDefaultView (out abstractView);
+ nsIDOMEventTarget target = (nsIDOMEventTarget) this.node;
+ bool ret = false;
+
+ string eventType;
+ switch (eventName) {
+ case "mousedown":
+ case "mouseup":
+ case "click":
+ case "dblclick":
+ case "mouseover":
+ case "mouseout":
+ case "mousemove":
+ case "contextmenu":
+ eventType = "mouseevents";
+ nsIDOMEvent evtMouse;
+ Base.StringSet (storage, eventType);
+ docEvent.createEvent (storage, out evtMouse);
+ nsIDOMMouseEvent domEventMouse = evtMouse as nsIDOMMouseEvent;
+ Base.StringSet (storage, eventName);
+ domEventMouse.initMouseEvent (storage, true, true, abstractView, 1, 0, 0, 0, 0, false, false, false, false, 0, target);
+ target.dispatchEvent (domEventMouse, out ret);
+ break;
+ case "keydown":
+ case "keyup":
+ case "keypress":
+ eventType = "keyevents";
+ nsIDOMEvent evtKey;
+ Base.StringSet (storage, eventType);
+ docEvent.createEvent (storage, out evtKey);
+ Base.StringSet (storage, eventName);
+ nsIDOMKeyEvent domEventKey = evtKey as nsIDOMKeyEvent;
+ domEventKey.initKeyEvent (storage, true, true, abstractView, false, false, false, false, 0, 0);
+ target.dispatchEvent (domEventKey, out ret);
+ break;
+ case "DOMActivate":
+ case "DOMFocusIn":
+ case "DOMFocusOut":
+ case "input":
+ eventType = "uievents";
+ nsIDOMEvent evtUI;
+ Base.StringSet (storage, eventType);
+ docEvent.createEvent (storage, out evtUI);
+ Base.StringSet (storage, eventName);
+ nsIDOMUIEvent domEventUI = evtUI as nsIDOMUIEvent;
+ domEventUI.initUIEvent (storage, true, true, abstractView, 1);
+ target.dispatchEvent (domEventUI, out ret);
+ break;
+ case "focus":
+ case "blur":
+ case "submit":
+ case "reset":
+ case "change":
+ case "select":
+ case "load":
+ case "beforeunload":
+ case "unload":
+ case "abort":
+ case "error":
+ default:
+ eventType = "events";
+ nsIDOMEvent domEvent;
+ Base.StringSet (storage, eventType);
+ docEvent.createEvent (storage, out domEvent);
+ Base.StringSet (storage, eventName);
+ domEvent.initEvent (storage, true, true);
+ target.dispatchEvent (domEvent, out ret);
+ break;
+ }
+
+ }
public virtual INode InsertBefore (INode child, INode refChild) {
nsIDOMNode newChild;
- node.insertBefore (((Node) child).node, ((Node) refChild).node, out newChild);\r
- return child;\r
- }\r
-\r
- public virtual INode ReplaceChild (INode child, INode oldChild) {\r
- nsIDOMNode replaced;\r
- node.replaceChild (((Node)child).node, ((Node)oldChild).node, out replaced);\r
- return oldChild;\r
- }\r
+ node.insertBefore (((Node) child).node, ((Node) refChild).node, out newChild);
+ return child;
+ }
+
+ public virtual INode ReplaceChild (INode child, INode oldChild) {
+ nsIDOMNode replaced;
+ node.replaceChild (((Node)child).node, ((Node)oldChild).node, out replaced);
+ return oldChild;
+ }
- public virtual INode RemoveChild (INode child) {\r
- nsIDOMNode removedChild;\r
- node.removeChild (((Node)child).node, out removedChild);\r
- return child;\r
- }\r
+ public virtual INode RemoveChild (INode child) {
+ nsIDOMNode removedChild;
+ node.removeChild (((Node)child).node, out removedChild);
+ return child;
+ }
- public virtual INode AppendChild (INode child) {\r
- nsIDOMNode newChild;\r
- int ret = node.appendChild (((Node)child).node, out newChild);\r
- Console.Error.WriteLine (ret);\r
- return child;\r
+ public virtual INode AppendChild (INode child) {
+ nsIDOMNode newChild;
+ int ret = node.appendChild (((Node)child).node, out newChild);
+ Console.Error.WriteLine (ret);
+ return child;
}
- #endregion\r
-\r
- \r
+ #endregion
+
+
- public override int GetHashCode () \r
+ public override int GetHashCode ()
{
return this.hashcode;
}
}
}
- public void AttachEventHandler (string eventName, EventHandler handler) \r
+ public void AttachEventHandler (string eventName, EventHandler handler)
{
EventListener.AddHandler (handler, eventName);
}
- public void DetachEventHandler (string eventName, EventHandler handler) \r
+ public void DetachEventHandler (string eventName, EventHandler handler)
{
EventListener.RemoveHandler (handler, eventName);
}
- \r
+
private EventHandlerList events;
public EventHandlerList Events {
get {
events = new EventHandlerList ();
return events;
}
- } \r
+ }
- public void AttachEventHandler (string eventName, System.Delegate handler) \r
- {\r
+ public void AttachEventHandler (string eventName, System.Delegate handler)
+ {
string key = String.Intern (node.GetHashCode() + ":" + eventName);
Events.AddHandler (key, handler);
}
- public void DetachEventHandler (string eventName, System.Delegate handler) \r
+ public void DetachEventHandler (string eventName, System.Delegate handler)
{
string key = String.Intern (node.GetHashCode() + ":" + eventName);
Events.RemoveHandler (key, handler);
- }\r
- \r
- public event NodeEventHandler Click\r
- {\r
- add { EventListener.AddHandler (value, "click"); }\r
- remove { EventListener.RemoveHandler (value, "click"); }\r
+ }
+
+ public event NodeEventHandler Click
+ {
+ add { EventListener.AddHandler (value, "click"); }
+ remove { EventListener.RemoveHandler (value, "click"); }
}
- public event NodeEventHandler DoubleClick\r
- {\r
- add { EventListener.AddHandler (value, "dblclick"); }\r
- remove { EventListener.RemoveHandler (value, "dblclick"); }\r
+ public event NodeEventHandler DoubleClick
+ {
+ add { EventListener.AddHandler (value, "dblclick"); }
+ remove { EventListener.RemoveHandler (value, "dblclick"); }
}
- public event NodeEventHandler KeyDown\r
- {\r
- add { EventListener.AddHandler (value, "keydown"); }\r
- remove { EventListener.RemoveHandler (value, "keydown"); }\r
+ public event NodeEventHandler KeyDown
+ {
+ add { EventListener.AddHandler (value, "keydown"); }
+ remove { EventListener.RemoveHandler (value, "keydown"); }
}
- public event NodeEventHandler KeyPress\r
- {\r
- add { EventListener.AddHandler (value, "keypress"); }\r
- remove { EventListener.RemoveHandler (value, "keypress"); }\r
+ public event NodeEventHandler KeyPress
+ {
+ add { EventListener.AddHandler (value, "keypress"); }
+ remove { EventListener.RemoveHandler (value, "keypress"); }
}
- public event NodeEventHandler KeyUp\r
- {\r
- add { EventListener.AddHandler (value, "keyup"); }\r
- remove { EventListener.RemoveHandler (value, "keyup"); }\r
+ public event NodeEventHandler KeyUp
+ {
+ add { EventListener.AddHandler (value, "keyup"); }
+ remove { EventListener.RemoveHandler (value, "keyup"); }
}
- public event NodeEventHandler MouseDown\r
- {\r
- add { EventListener.AddHandler (value, "mousedown"); }\r
- remove { EventListener.RemoveHandler (value, "mousedown"); }\r
+ public event NodeEventHandler MouseDown
+ {
+ add { EventListener.AddHandler (value, "mousedown"); }
+ remove { EventListener.RemoveHandler (value, "mousedown"); }
}
- public event NodeEventHandler MouseEnter\r
- {\r
- add { EventListener.AddHandler (value, "mouseenter"); }\r
- remove { EventListener.RemoveHandler (value, "mouseenter"); }\r
+ public event NodeEventHandler MouseEnter
+ {
+ add { EventListener.AddHandler (value, "mouseenter"); }
+ remove { EventListener.RemoveHandler (value, "mouseenter"); }
}
- public event NodeEventHandler MouseLeave\r
- {\r
- add { EventListener.AddHandler (value, "mouseout"); }\r
- remove { EventListener.RemoveHandler (value, "mouseout"); }\r
+ public event NodeEventHandler MouseLeave
+ {
+ add { EventListener.AddHandler (value, "mouseout"); }
+ remove { EventListener.RemoveHandler (value, "mouseout"); }
}
- public event NodeEventHandler MouseMove\r
- {\r
- add { EventListener.AddHandler (value, "mousemove"); }\r
- remove { EventListener.RemoveHandler (value, "mousemove"); }\r
+ public event NodeEventHandler MouseMove
+ {
+ add { EventListener.AddHandler (value, "mousemove"); }
+ remove { EventListener.RemoveHandler (value, "mousemove"); }
}
- public event NodeEventHandler MouseOver\r
- {\r
- add { EventListener.AddHandler (value, "mouseover"); }\r
- remove { EventListener.RemoveHandler (value, "mouseover"); }\r
+ public event NodeEventHandler MouseOver
+ {
+ add { EventListener.AddHandler (value, "mouseover"); }
+ remove { EventListener.RemoveHandler (value, "mouseover"); }
}
- public event NodeEventHandler MouseUp\r
- {\r
- add { EventListener.AddHandler (value, "mouseup"); }\r
- remove { EventListener.RemoveHandler (value, "mouseup"); }\r
+ public event NodeEventHandler MouseUp
+ {
+ add { EventListener.AddHandler (value, "mouseup"); }
+ remove { EventListener.RemoveHandler (value, "mouseup"); }
}
- public event NodeEventHandler OnFocus\r
- {\r
- add { EventListener.AddHandler (value, "focus"); }\r
- remove { EventListener.RemoveHandler (value, "focus"); }\r
+ public event NodeEventHandler OnFocus
+ {
+ add { EventListener.AddHandler (value, "focus"); }
+ remove { EventListener.RemoveHandler (value, "focus"); }
}
- public event NodeEventHandler OnBlur\r
- {\r
- add { EventListener.AddHandler (value, "blur"); }\r
- remove { EventListener.RemoveHandler (value, "blur"); }\r
+ public event NodeEventHandler OnBlur
+ {
+ add { EventListener.AddHandler (value, "blur"); }
+ remove { EventListener.RemoveHandler (value, "blur"); }
}
- #endregion\r
- }\r
-}\r
+ #endregion
+ }
+}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
unmanagedNodes = nsDOMNodeList.GetProxy (control, nodeList);
else
unmanagedNodes = nodeList;
- }\r
-\r
- public NodeList (WebBrowser control) : base (control)\r
- {\r
- nodes = new Node[0];\r
- }\r
- \r
- public NodeList (WebBrowser control, bool loaded) : base (control)\r
- {\r
- }\r
+ }
+
+ public NodeList (WebBrowser control) : base (control)
+ {
+ nodes = new Node[0];
+ }
+
+ public NodeList (WebBrowser control, bool loaded) : base (control)
+ {
+ }
#region IDisposable Members
protected override void Dispose (bool disposing)
nodes[i] = null;
}
nodeCount = 0;
- unmanagedNodes = null;\r
+ unmanagedNodes = null;
nodes = null;
}
}
internal virtual void Load ()
- {\r
+ {
if (unmanagedNodes == null) return;
Clear ();
uint count;
nodes = new Node[nodeCount];
for (int i = 0; i < nodeCount; i++) {
nsIDOMNode node;
- unmanagedNodes.item ((uint)i, out node);\r
- ushort type;\r
- node.getNodeType (out type);\r
- switch (type) {\r
- case (ushort)NodeType.Element:\r
- nodes[i] = new HTMLElement (control, node as nsIDOMHTMLElement);\r
- break;\r
- default:\r
- nodes[i] = new Node (control, node);\r
- break;\r
+ unmanagedNodes.item ((uint)i, out node);
+ ushort type;
+ node.getNodeType (out type);
+ switch (type) {
+ case (ushort)NodeType.Element:
+ nodes[i] = new HTMLElement (control, node as nsIDOMHTMLElement);
+ break;
+ default:
+ nodes[i] = new Node (control, node);
+ break;
}
}
}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
-using System;\r
-using System.Text;\r
+using System;
+using System.Text;
using System.Runtime.InteropServices;
-using System.Collections;\r
-using Mono.WebBrowser;\r
+using System.Collections;
+using Mono.WebBrowser;
using Mono.WebBrowser.DOM;
-namespace Mono.Mozilla.DOM\r
+namespace Mono.Mozilla.DOM
{
internal class Window : DOMObject, IWindow
{
private nsIDOMWindow window;
- private EventListener eventListener;\r
+ private EventListener eventListener;
public Window(WebBrowser control, nsIDOMWindow domWindow) : base (control)
{
this.window = domWindow;
}
-#region IDisposable Members\r
+#region IDisposable Members
protected override void Dispose (bool disposing)
{
if (!disposed) {
}
}
base.Dispose(disposing);
- } \r
+ }
#endregion
-\r
- internal static bool FindDocument (ref nsIDOMWindow window, int docHashcode) {\r
- nsIDOMDocument doc;\r
- window.getDocument (out doc);\r
- \r
- if (doc.GetHashCode () == docHashcode) {\r
- return true;\r
- } else {\r
- uint len = 1;\r
- nsIDOMWindowCollection col;\r
- \r
- window.getFrames (out col);\r
- col.getLength (out len);\r
-\r
- for (uint i = 0; i < len; ++i) {\r
- col.item (i, out window);\r
- if (Window.FindDocument (ref window, docHashcode))\r
- return true;\r
- }\r
- }\r
- return false; \r
- }\r
+
+ internal static bool FindDocument (ref nsIDOMWindow window, int docHashcode) {
+ nsIDOMDocument doc;
+ window.getDocument (out doc);
+
+ if (doc.GetHashCode () == docHashcode) {
+ return true;
+ } else {
+ uint len = 1;
+ nsIDOMWindowCollection col;
+
+ window.getFrames (out col);
+ col.getLength (out len);
+
+ for (uint i = 0; i < len; ++i) {
+ col.item (i, out window);
+ if (Window.FindDocument (ref window, docHashcode))
+ return true;
+ }
+ }
+ return false;
+ }
#region Properties
public IDocument Document {
get {
nsIDOMDocument doc;
- this.window.getDocument (out doc);\r
- if (!control.documents.ContainsKey (doc.GetHashCode ()))\r
+ this.window.getDocument (out doc);
+ if (!control.documents.ContainsKey (doc.GetHashCode ()))
control.documents.Add (doc.GetHashCode (), new Document (control, (nsIDOMHTMLDocument) doc));
return control.documents[doc.GetHashCode ()] as IDocument;
}
public string StatusText {
get {
- return control.StatusText;\r
+ return control.StatusText;
}
- }\r
- \r
- public IHistory History {\r
- get {\r
- Navigation nav = new Navigation (this.control, window as nsIWebNavigation);\r
- return new History (this.control, nav);\r
- }\r
+ }
+
+ public IHistory History {
+ get {
+ Navigation nav = new Navigation (this.control, window as nsIWebNavigation);
+ return new History (this.control, nav);
+ }
}
#endregion
}
}
- public void AttachEventHandler (string eventName, EventHandler handler) \r
+ public void AttachEventHandler (string eventName, EventHandler handler)
{
EventListener.AddHandler (handler, eventName);
}
- public void DetachEventHandler (string eventName, EventHandler handler) \r
+ public void DetachEventHandler (string eventName, EventHandler handler)
{
EventListener.RemoveHandler (handler, eventName);
- }\r
+ }
public bool Equals (IWindow obj) {
Window doc = (Window) obj;
return doc.window == this.window;
}
-\r
- public void Focus () {\r
- nsIWebBrowserFocus focus = (nsIWebBrowserFocus) this.window;\r
- focus.setFocusedWindow (this.window);\r
- }\r
+
+ public void Focus () {
+ nsIWebBrowserFocus focus = (nsIWebBrowserFocus) this.window;
+ focus.setFocusedWindow (this.window);
+ }
public override int GetHashCode () {
return this.window.GetHashCode ();
#endregion
#region Events
- static object LoadEvent = new object ();\r
- public event EventHandler Load {\r
- add { \r
- Events.AddHandler (LoadEvent, value); \r
- AttachEventHandler ("load", value);\r
- }\r
- remove { \r
- Events.RemoveHandler (LoadEvent, value); \r
- DetachEventHandler ("load", value);\r
- }\r
- }\r
+ static object LoadEvent = new object ();
+ public event EventHandler Load {
+ add {
+ Events.AddHandler (LoadEvent, value);
+ AttachEventHandler ("load", value);
+ }
+ remove {
+ Events.RemoveHandler (LoadEvent, value);
+ DetachEventHandler ("load", value);
+ }
+ }
+
+ static object UnloadEvent = new object ();
+ public event EventHandler Unload {
+ add {
+ Events.AddHandler (UnloadEvent, value);
+ AttachEventHandler ("unload", value);
+ }
+ remove {
+ Events.RemoveHandler (UnloadEvent, value);
+ DetachEventHandler ("unload", value);
+ }
+ }
+
+ public event EventHandler OnFocus {
+ add { AttachEventHandler ("focus", value); }
+ remove { DetachEventHandler ("focus", value); }
+ }
- static object UnloadEvent = new object ();\r
- public event EventHandler Unload {\r
- add { \r
- Events.AddHandler (UnloadEvent, value); \r
- AttachEventHandler ("unload", value);\r
- }\r
- remove { \r
- Events.RemoveHandler (UnloadEvent, value); \r
- DetachEventHandler ("unload", value);\r
- }\r
- }
-\r
- public event EventHandler OnFocus {\r
- add { AttachEventHandler ("focus", value); }\r
- remove { DetachEventHandler ("focus", value); }\r
- }
-\r
- public event EventHandler OnBlur {\r
- add { AttachEventHandler ("blur", value); }\r
- remove { DetachEventHandler ("blur", value); }\r
- }
- \r
- public event EventHandler Error {\r
- add { AttachEventHandler ("error", value); }\r
- remove { DetachEventHandler ("error", value); }\r
- }\r
-
- public event EventHandler Scroll {\r
- add { AttachEventHandler ("scroll", value); }\r
- remove { DetachEventHandler ("scroll", value); }\r
+ public event EventHandler OnBlur {
+ add { AttachEventHandler ("blur", value); }
+ remove { DetachEventHandler ("blur", value); }
+ }
+
+ public event EventHandler Error {
+ add { AttachEventHandler ("error", value); }
+ remove { DetachEventHandler ("error", value); }
+ }
+
+ public event EventHandler Scroll {
+ add { AttachEventHandler ("scroll", value); }
+ remove { DetachEventHandler ("scroll", value); }
}
public void OnLoad ()
{
- EventHandler eh = (EventHandler) (Events[LoadEvent]);\r
- if (eh != null) {\r
- EventArgs e = new EventArgs ();\r
- eh (this, e);\r
+ EventHandler eh = (EventHandler) (Events[LoadEvent]);
+ if (eh != null) {
+ EventArgs e = new EventArgs ();
+ eh (this, e);
}
- }\r
+ }
public void OnUnload ()
{
- EventHandler eh = (EventHandler) (Events[UnloadEvent]);\r
- if (eh != null) {\r
- EventArgs e = new EventArgs ();\r
- eh (this, e);\r
- }\r
- }\r
- \r
+ EventHandler eh = (EventHandler) (Events[UnloadEvent]);
+ if (eh != null) {
+ EventArgs e = new EventArgs ();
+ eh (this, e);
+ }
+ }
+
#endregion
}
}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
unmanagedWindows = nsDOMWindowCollection.GetProxy (control, windowCol);
else
unmanagedWindows = windowCol;
- }\r
-\r
- public WindowCollection (WebBrowser control) : base (control)\r
+ }
+
+ public WindowCollection (WebBrowser control) : base (control)
{
- windows = new Window[0];\r
+ windows = new Window[0];
}
#region IDisposable Members
index = -1;
}
}
- \r
+
}
}
String = value;
}
- ~UniString ()\r
+ ~UniString ()
{
- Dispose (false);\r
+ Dispose (false);
}
- #region IDisposable Members\r
+ #region IDisposable Members
protected virtual void Dispose (bool disposing)
{
disposed = true;
}
}
-\r
- public void Dispose ()\r
- {\r
+
+ public void Dispose ()
+ {
Dispose (true);
- GC.SuppressFinalize (this);\r
- }\r
-\r
- #endregion\r
+ GC.SuppressFinalize (this);
+ }
+
+ #endregion
public HandleRef Handle {
}
}
- public int Length {\r
+ public int Length {
get { return String.Length; }
}
public override string ToString ()
- {\r
+ {
return String;
}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
#undef debug
-\r
+
using System;
-using System.Collections;\r
-using System.Reflection;\r
-using System.Runtime.InteropServices;\r
-using System.Text;\r
-using System.Diagnostics;\r
-using Mono.WebBrowser;\r
-using Mono.WebBrowser.DOM;\r
-\r
-namespace Mono.Mozilla\r
-{\r
- internal class WebBrowser : IWebBrowser\r
- {\r
- private bool loaded;\r
+using System.Collections;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Diagnostics;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.Mozilla
+{
+ internal class WebBrowser : IWebBrowser
+ {
+ private bool loaded;
private DOM.Document document;
- \r
- internal DOM.Navigation navigation;\r
- internal Platform platform;\r
+
+ internal DOM.Navigation navigation;
+ internal Platform platform;
internal Platform enginePlatform;
internal Callback callbacks;
private System.ComponentModel.EventHandlerList events;
private System.ComponentModel.EventHandlerList domEvents;
- private string statusText;\r
-\r
- private bool streamingMode;\r
- \r
+ private string statusText;
+
+ private bool streamingMode;
+
internal Hashtable documents;
- \r
- public WebBrowser (Platform platform)\r
+
+ public WebBrowser (Platform platform)
{
this.platform = platform;
- callbacks = new Callback(this);\r
- loaded = Base.Init (this, platform);\r
- documents = new Hashtable ();\r
- }\r
-\r
- public bool Load (IntPtr handle, int width, int height)\r
- {\r
- Base.Bind (this, handle, width, height);\r
- return loaded;\r
- }\r
-\r
- public void Shutdown ()\r
- {\r
- Base.Shutdown (this);\r
+ callbacks = new Callback(this);
+ loaded = Base.Init (this, platform);
+ documents = new Hashtable ();
+ }
+
+ public bool Load (IntPtr handle, int width, int height)
+ {
+ Base.Bind (this, handle, width, height);
+ return loaded;
+ }
+
+ public void Shutdown ()
+ {
+ Base.Shutdown (this);
}
internal void Reset ()
this.document = null;
this.DomEvents.Dispose ();
this.domEvents = null;
- }\r
-\r
- public bool Initialized {\r
- get { return this.loaded; }\r
- }\r
- \r
- public IWindow Window {\r
+ }
+
+ public bool Initialized {
+ get { return this.loaded; }
+ }
+
+ public IWindow Window {
get {
if (Navigation != null) {
- nsIWebBrowserFocus webBrowserFocus = (nsIWebBrowserFocus) (navigation.navigation);\r
+ nsIWebBrowserFocus webBrowserFocus = (nsIWebBrowserFocus) (navigation.navigation);
nsIDOMWindow window;
webBrowserFocus.getFocusedWindow (out window);
- return new DOM.Window (this, window) as IWindow;\r
+ return new DOM.Window (this, window) as IWindow;
}
- return null;\r
- }\r
- }\r
+ return null;
+ }
+ }
- public IDocument Document {\r
+ public IDocument Document {
get {
- if (Navigation != null && document == null) {\r
- document = navigation.Document;\r
- }\r
- return document as IDocument;\r
- }\r
- }\r
-\r
- public INavigation Navigation {\r
+ if (Navigation != null && document == null) {
+ document = navigation.Document;
+ }
+ return document as IDocument;
+ }
+ }
+
+ public INavigation Navigation {
get {
- if (navigation == null) {\r
- \r
- nsIWebNavigation webNav = Base.GetWebNavigation (this);\r
- navigation = new DOM.Navigation (this, webNav);\r
- }\r
- return navigation as INavigation;\r
- }\r
+ if (navigation == null) {
+
+ nsIWebNavigation webNav = Base.GetWebNavigation (this);
+ navigation = new DOM.Navigation (this, webNav);
+ }
+ return navigation as INavigation;
+ }
}
public string StatusText {
get { return statusText; }
- }\r
- \r
- public bool Offline {\r
- get {\r
- bool ret;\r
- IOService.getOffline (out ret);\r
- return ret;\r
- }\r
- set {\r
- IOService.setOffline (value);\r
- }\r
- }\r
- \r
+ }
+
+ public bool Offline {
+ get {
+ bool ret;
+ IOService.getOffline (out ret);
+ return ret;
+ }
+ set {
+ IOService.setOffline (value);
+ }
+ }
+
internal System.ComponentModel.EventHandlerList DomEvents {
get {
if (domEvents == null)
return domEvents;
}
}
-\r
+
internal System.ComponentModel.EventHandlerList Events {
get {
if (events == null)
return events;
}
- }\r
- \r
- \r
- nsIServiceManager servMan;\r
- internal nsIServiceManager ServiceManager {\r
- get {\r
- if (servMan == null)\r
- servMan = Base.gluezilla_getServiceManager ();\r
- return servMan;\r
- }\r
- }
- \r
- nsIIOService ioService;\r
- internal nsIIOService IOService {\r
- get {\r
- if (ioService == null) {\r
- IntPtr ioServicePtr = IntPtr.Zero;\r
-\r
- \r
-\r
+ }
+
+
+ nsIServiceManager servMan;
+ internal nsIServiceManager ServiceManager {
+ get {
+ if (servMan == null)
+ servMan = Base.gluezilla_getServiceManager ();
+ return servMan;
+ }
+ }
+
+ nsIIOService ioService;
+ internal nsIIOService IOService {
+ get {
+ if (ioService == null) {
+ IntPtr ioServicePtr = IntPtr.Zero;
+
+
+
+ if (ioServicePtr == IntPtr.Zero)
+ ServiceManager.getServiceByContractID ("@mozilla.org/network/io-service;1", typeof (nsIIOService).GUID, out ioServicePtr);
if (ioServicePtr == IntPtr.Zero)
- ServiceManager.getServiceByContractID ("@mozilla.org/network/io-service;1", typeof (nsIIOService).GUID, out ioServicePtr);\r
- if (ioServicePtr == IntPtr.Zero)\r
throw new Mono.WebBrowser.Exception (Mono.WebBrowser.Exception.ErrorCodes.IOService);
-\r
- try {\r
- ioService = (nsIIOService)Marshal.GetObjectForIUnknown (ioServicePtr);\r
- } catch (System.Exception ex) {\r
- throw new Mono.WebBrowser.Exception (Mono.WebBrowser.Exception.ErrorCodes.IOService, ex);\r
- }\r
- }\r
- return ioService;\r
- }\r
- } \r
+
+ try {
+ ioService = (nsIIOService)Marshal.GetObjectForIUnknown (ioServicePtr);
+ } catch (System.Exception ex) {
+ throw new Mono.WebBrowser.Exception (Mono.WebBrowser.Exception.ErrorCodes.IOService, ex);
+ }
+ }
+ return ioService;
+ }
+ }
+
+ #region Layout
+ public void FocusIn (FocusOption focus)
+ {
+ Base.Focus (this, focus);
+ }
+ public void FocusOut ()
+ {
+ Base.Blur (this);
+ }
- #region Layout\r
- public void FocusIn (FocusOption focus)\r
- {\r
- Base.Focus (this, focus);\r
- }\r
- public void FocusOut ()\r
- {\r
- Base.Blur (this);\r
- }\r
- \r
- public void Activate ()\r
- {\r
- Base.Activate (this);\r
- }\r
- public void Deactivate ()\r
- {\r
- Base.Deactivate (this);\r
- }\r
-\r
- public void Resize (int width, int height)\r
- {\r
- Base.Resize (this, width, height); \r
+ public void Activate ()
+ {
+ Base.Activate (this);
+ }
+ public void Deactivate ()
+ {
+ Base.Deactivate (this);
+ }
+
+ public void Resize (int width, int height)
+ {
+ Base.Resize (this, width, height);
}
-\r
+
public void Render (byte[] data)
- {\r
- if (data == null)\r
+ {
+ if (data == null)
throw new ArgumentNullException ("data");
- string html = System.Text.ASCIIEncoding.UTF8.GetString (data);\r
+ string html = System.Text.ASCIIEncoding.UTF8.GetString (data);
Render (html);
}
-\r
- public void Render (string html)\r
- {\r
- Render (html, "file:///", "text/html");\r
- }\r
-\r
- \r
- public void Render (string html, string uri, string contentType)\r
- {\r
- \r
- nsIWebBrowserStream stream;\r
- if (Navigation != null) {\r
- stream = (nsIWebBrowserStream) navigation.navigation;\r
- } else\r
+
+ public void Render (string html)
+ {
+ Render (html, "file:///", "text/html");
+ }
+
+
+ public void Render (string html, string uri, string contentType)
+ {
+
+ nsIWebBrowserStream stream;
+ if (Navigation != null) {
+ stream = (nsIWebBrowserStream) navigation.navigation;
+ } else
throw new Mono.WebBrowser.Exception (Mono.WebBrowser.Exception.ErrorCodes.Navigation);
AsciiString asciiUri = new AsciiString (uri);
nsIURI ret;
- IOService.newURI (asciiUri.Handle, null, null, out ret);\r
-\r
- AsciiString ctype = new AsciiString(contentType);\r
-\r
- HandleRef han = ctype.Handle;\r
-\r
- stream.openStream (ret, han);\r
-\r
- IntPtr native_html = Marshal.StringToHGlobalAnsi (html);\r
- stream.appendToStream (native_html, (uint)html.Length);\r
- Marshal.FreeHGlobal (native_html);\r
-\r
- stream.closeStream ();\r
-\r
- }\r
- \r
+ IOService.newURI (asciiUri.Handle, null, null, out ret);
+
+ AsciiString ctype = new AsciiString(contentType);
+
+ HandleRef han = ctype.Handle;
+
+ stream.openStream (ret, han);
+
+ IntPtr native_html = Marshal.StringToHGlobalAnsi (html);
+ stream.appendToStream (native_html, (uint)html.Length);
+ Marshal.FreeHGlobal (native_html);
+
+ stream.closeStream ();
+
+ }
+
internal void AttachEvent (INode node, string eve, EventHandler handler) {
string key = String.Intern (node.GetHashCode() + ":" + eve);
-#if debug\r
- Console.Error.WriteLine ("Event Attached: " + key);\r
+#if debug
+ Console.Error.WriteLine ("Event Attached: " + key);
#endif
DomEvents.AddHandler (key, handler);
}
internal void DetachEvent (INode node, string eve, EventHandler handler) {
- string key = String.Intern (node.GetHashCode() + ":" + eve);\r
+ string key = String.Intern (node.GetHashCode() + ":" + eve);
#if debug
- Console.Error.WriteLine ("Event Detached: " + key);\r
+ Console.Error.WriteLine ("Event Detached: " + key);
#endif
DomEvents.RemoveHandler (key, handler);
}
- \r
- #endregion\r
-\r
- #region Events\r
- internal static object KeyDownEvent = new object ();\r
- internal static object KeyPressEvent = new object ();\r
- internal static object KeyUpEvent = new object ();\r
- internal static object MouseClickEvent = new object ();\r
- internal static object MouseDoubleClickEvent = new object ();\r
- internal static object MouseDownEvent = new object ();\r
- internal static object MouseEnterEvent = new object ();\r
- internal static object MouseLeaveEvent = new object ();\r
- internal static object MouseMoveEvent = new object ();\r
- internal static object MouseUpEvent = new object ();\r
- internal static object FocusEvent = new object ();\r
- internal static object BlurEvent = new object ();\r
- internal static object CreateNewWindowEvent = new object ();\r
- internal static object AlertEvent = new object ();\r
- \r
- internal static object LoadStartedEvent = new object ();\r
- internal static object LoadCommitedEvent = new object ();\r
- internal static object ProgressChangedEvent = new object ();\r
- internal static object LoadFinishedEvent = new object (); \r
- \r
- internal static object LoadEvent = new object ();\r
- internal static object UnloadEvent = new object ();\r
- internal static object StatusChangedEvent = new object ();\r
- internal static object SecurityChangedEvent = new object ();\r
- internal static object ProgressEvent = new object ();\r
- internal static object ContextMenuEvent = new object ();\r
- \r
- public event NodeEventHandler KeyDown\r
- {\r
- add { Events.AddHandler (KeyDownEvent, value); }\r
- remove { Events.RemoveHandler (KeyDownEvent, value); }\r
- }\r
-\r
- public event NodeEventHandler KeyPress\r
- {\r
- add { Events.AddHandler (KeyPressEvent, value); }\r
- remove { Events.RemoveHandler (KeyPressEvent, value); }\r
- }\r
- public event NodeEventHandler KeyUp\r
- {\r
- add { Events.AddHandler (KeyUpEvent, value); }\r
- remove { Events.RemoveHandler (KeyUpEvent, value); }\r
- }\r
- public event NodeEventHandler MouseClick\r
- {\r
- add { Events.AddHandler (MouseClickEvent, value); }\r
- remove { Events.RemoveHandler (MouseClickEvent, value); }\r
- }\r
- public event NodeEventHandler MouseDoubleClick\r
- {\r
- add { Events.AddHandler (MouseDoubleClickEvent, value); }\r
- remove { Events.RemoveHandler (MouseDoubleClickEvent, value); }\r
- }\r
- public event NodeEventHandler MouseDown\r
- {\r
- add { Events.AddHandler (MouseDownEvent, value); }\r
- remove { Events.RemoveHandler (MouseDownEvent, value); }\r
- }\r
- public event NodeEventHandler MouseEnter\r
- {\r
- add { Events.AddHandler (MouseEnterEvent, value); }\r
- remove { Events.RemoveHandler (MouseEnterEvent, value); }\r
- }\r
- public event NodeEventHandler MouseLeave\r
- {\r
- add { Events.AddHandler (MouseLeaveEvent, value); }\r
- remove { Events.RemoveHandler (MouseLeaveEvent, value); }\r
- }\r
- public event NodeEventHandler MouseMove\r
- {\r
- add { Events.AddHandler (MouseMoveEvent, value); }\r
- remove { Events.RemoveHandler (MouseMoveEvent, value); }\r
- }\r
- public event NodeEventHandler MouseUp\r
- {\r
- add { Events.AddHandler (MouseUpEvent, value); }\r
- remove { Events.RemoveHandler (MouseUpEvent, value); }\r
- }\r
- public event EventHandler Focus\r
- {\r
- add { Events.AddHandler (FocusEvent, value); }\r
- remove { Events.RemoveHandler (FocusEvent, value); }\r
- }\r
- public event EventHandler Blur\r
- {\r
- add { Events.AddHandler (BlurEvent, value); }\r
- remove { Events.RemoveHandler (BlurEvent, value); }\r
- }
- public event CreateNewWindowEventHandler CreateNewWindow\r
- {\r
- add { Events.AddHandler (CreateNewWindowEvent, value); }\r
- remove { Events.RemoveHandler (CreateNewWindowEvent, value); }\r
- }\r
- public event AlertEventHandler Alert\r
- {\r
- add { Events.AddHandler (AlertEvent, value); }\r
- remove { Events.RemoveHandler (AlertEvent, value); }\r
- }\r
- public event EventHandler Loaded\r
- {\r
- add { Events.AddHandler (LoadEvent, value); }\r
- remove { Events.RemoveHandler (LoadEvent, value); }\r
- }\r
- public event EventHandler Unloaded\r
- {\r
- add { Events.AddHandler (UnloadEvent, value); }\r
- remove { Events.RemoveHandler (UnloadEvent, value); }\r
- }\r
-\r
- public event StatusChangedEventHandler StatusChanged\r
- {\r
- add { Events.AddHandler (StatusChangedEvent, value); }\r
- remove { Events.RemoveHandler (StatusChangedEvent, value); }\r
- }\r
- \r
- public event SecurityChangedEventHandler SecurityChanged\r
- {\r
- add { Events.AddHandler (SecurityChangedEvent, value); }\r
- remove { Events.RemoveHandler (SecurityChangedEvent, value); }\r
- }\r
-\r
- public event LoadStartedEventHandler LoadStarted\r
- {\r
- add { Events.AddHandler (LoadStartedEvent, value); }\r
- remove { Events.RemoveHandler (LoadStartedEvent, value); }\r
- }\r
- \r
- public event LoadCommitedEventHandler LoadCommited\r
- {\r
- add { Events.AddHandler (LoadCommitedEvent, value); }\r
- remove { Events.RemoveHandler (LoadCommitedEvent, value); }\r
- } \r
- \r
- public event ProgressChangedEventHandler ProgressChanged\r
- {\r
- add { Events.AddHandler (ProgressChangedEvent, value); }\r
- remove { Events.RemoveHandler (ProgressChangedEvent, value); }\r
- }\r
- \r
- public event LoadFinishedEventHandler LoadFinished\r
- {\r
- add { Events.AddHandler (LoadFinishedEvent, value); }\r
- remove { Events.RemoveHandler (LoadFinishedEvent, value); }\r
- }\r
-
- public event ContextMenuEventHandler ContextMenuShown\r
- {\r
- add { Events.AddHandler (ContextMenuEvent, value); }\r
- remove { Events.RemoveHandler (ContextMenuEvent, value); }\r
- }\r
-\r
- internal static object GenericEvent = new object ();\r
- internal event EventHandler Generic\r
- {\r
- add { Events.AddHandler (GenericEvent, value); }\r
- remove { Events.RemoveHandler (GenericEvent, value); }\r
- }\r
-
- #endregion\r
-\r
-\r
- }\r
-}\r
+ #endregion
+
+ #region Events
+ internal static object KeyDownEvent = new object ();
+ internal static object KeyPressEvent = new object ();
+ internal static object KeyUpEvent = new object ();
+ internal static object MouseClickEvent = new object ();
+ internal static object MouseDoubleClickEvent = new object ();
+ internal static object MouseDownEvent = new object ();
+ internal static object MouseEnterEvent = new object ();
+ internal static object MouseLeaveEvent = new object ();
+ internal static object MouseMoveEvent = new object ();
+ internal static object MouseUpEvent = new object ();
+ internal static object FocusEvent = new object ();
+ internal static object BlurEvent = new object ();
+ internal static object CreateNewWindowEvent = new object ();
+ internal static object AlertEvent = new object ();
+
+ internal static object LoadStartedEvent = new object ();
+ internal static object LoadCommitedEvent = new object ();
+ internal static object ProgressChangedEvent = new object ();
+ internal static object LoadFinishedEvent = new object ();
+
+ internal static object LoadEvent = new object ();
+ internal static object UnloadEvent = new object ();
+ internal static object StatusChangedEvent = new object ();
+ internal static object SecurityChangedEvent = new object ();
+ internal static object ProgressEvent = new object ();
+ internal static object ContextMenuEvent = new object ();
+
+
+ public event NodeEventHandler KeyDown
+ {
+ add { Events.AddHandler (KeyDownEvent, value); }
+ remove { Events.RemoveHandler (KeyDownEvent, value); }
+ }
+
+ public event NodeEventHandler KeyPress
+ {
+ add { Events.AddHandler (KeyPressEvent, value); }
+ remove { Events.RemoveHandler (KeyPressEvent, value); }
+ }
+ public event NodeEventHandler KeyUp
+ {
+ add { Events.AddHandler (KeyUpEvent, value); }
+ remove { Events.RemoveHandler (KeyUpEvent, value); }
+ }
+ public event NodeEventHandler MouseClick
+ {
+ add { Events.AddHandler (MouseClickEvent, value); }
+ remove { Events.RemoveHandler (MouseClickEvent, value); }
+ }
+ public event NodeEventHandler MouseDoubleClick
+ {
+ add { Events.AddHandler (MouseDoubleClickEvent, value); }
+ remove { Events.RemoveHandler (MouseDoubleClickEvent, value); }
+ }
+ public event NodeEventHandler MouseDown
+ {
+ add { Events.AddHandler (MouseDownEvent, value); }
+ remove { Events.RemoveHandler (MouseDownEvent, value); }
+ }
+ public event NodeEventHandler MouseEnter
+ {
+ add { Events.AddHandler (MouseEnterEvent, value); }
+ remove { Events.RemoveHandler (MouseEnterEvent, value); }
+ }
+ public event NodeEventHandler MouseLeave
+ {
+ add { Events.AddHandler (MouseLeaveEvent, value); }
+ remove { Events.RemoveHandler (MouseLeaveEvent, value); }
+ }
+ public event NodeEventHandler MouseMove
+ {
+ add { Events.AddHandler (MouseMoveEvent, value); }
+ remove { Events.RemoveHandler (MouseMoveEvent, value); }
+ }
+ public event NodeEventHandler MouseUp
+ {
+ add { Events.AddHandler (MouseUpEvent, value); }
+ remove { Events.RemoveHandler (MouseUpEvent, value); }
+ }
+ public event EventHandler Focus
+ {
+ add { Events.AddHandler (FocusEvent, value); }
+ remove { Events.RemoveHandler (FocusEvent, value); }
+ }
+ public event EventHandler Blur
+ {
+ add { Events.AddHandler (BlurEvent, value); }
+ remove { Events.RemoveHandler (BlurEvent, value); }
+ }
+ public event CreateNewWindowEventHandler CreateNewWindow
+ {
+ add { Events.AddHandler (CreateNewWindowEvent, value); }
+ remove { Events.RemoveHandler (CreateNewWindowEvent, value); }
+ }
+ public event AlertEventHandler Alert
+ {
+ add { Events.AddHandler (AlertEvent, value); }
+ remove { Events.RemoveHandler (AlertEvent, value); }
+ }
+ public event EventHandler Loaded
+ {
+ add { Events.AddHandler (LoadEvent, value); }
+ remove { Events.RemoveHandler (LoadEvent, value); }
+ }
+ public event EventHandler Unloaded
+ {
+ add { Events.AddHandler (UnloadEvent, value); }
+ remove { Events.RemoveHandler (UnloadEvent, value); }
+ }
+
+ public event StatusChangedEventHandler StatusChanged
+ {
+ add { Events.AddHandler (StatusChangedEvent, value); }
+ remove { Events.RemoveHandler (StatusChangedEvent, value); }
+ }
+
+ public event SecurityChangedEventHandler SecurityChanged
+ {
+ add { Events.AddHandler (SecurityChangedEvent, value); }
+ remove { Events.RemoveHandler (SecurityChangedEvent, value); }
+ }
+
+ public event LoadStartedEventHandler LoadStarted
+ {
+ add { Events.AddHandler (LoadStartedEvent, value); }
+ remove { Events.RemoveHandler (LoadStartedEvent, value); }
+ }
+
+ public event LoadCommitedEventHandler LoadCommited
+ {
+ add { Events.AddHandler (LoadCommitedEvent, value); }
+ remove { Events.RemoveHandler (LoadCommitedEvent, value); }
+ }
+
+ public event ProgressChangedEventHandler ProgressChanged
+ {
+ add { Events.AddHandler (ProgressChangedEvent, value); }
+ remove { Events.RemoveHandler (ProgressChangedEvent, value); }
+ }
+
+ public event LoadFinishedEventHandler LoadFinished
+ {
+ add { Events.AddHandler (LoadFinishedEvent, value); }
+ remove { Events.RemoveHandler (LoadFinishedEvent, value); }
+ }
+
+ public event ContextMenuEventHandler ContextMenuShown
+ {
+ add { Events.AddHandler (ContextMenuEvent, value); }
+ remove { Events.RemoveHandler (ContextMenuEvent, value); }
+ }
+
+ internal static object GenericEvent = new object ();
+ internal event EventHandler Generic
+ {
+ add { Events.AddHandler (GenericEvent, value); }
+ remove { Events.RemoveHandler (GenericEvent, value); }
+ }
+
+ #endregion
+
+
+ }
+}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
-\r
-namespace Mono.WebBrowser.DOM\r
-{\r
- public interface IAttribute : INode\r
- {\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+
+namespace Mono.WebBrowser.DOM
+{
+ public interface IAttribute : INode
+ {
string Name { get;}
- int GetHashCode ();\r
- }\r
-}\r
+ int GetHashCode ();
+ }
+}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
-\r
-namespace Mono.WebBrowser.DOM\r
-{\r
- public interface IAttributeCollection : INodeList\r
- {\r
- IAttribute this[string name] { get; }\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+
+namespace Mono.WebBrowser.DOM
+{
+ public interface IAttributeCollection : INodeList
+ {
+ IAttribute this[string name] { get; }
bool Exists (string name);
- int GetHashCode ();\r
- }\r
-}\r
+ int GetHashCode ();
+ }
+}
-// 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, 2008 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 IDocument : INode\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using Mono.WebBrowser;
+
+namespace Mono.WebBrowser.DOM
+{
+ public interface IDocument : INode
{
IElement Active { get; }
- string ActiveLinkColor { get; set;}\r
+ string ActiveLinkColor { get; set;}
IElementCollection Anchors { get; }
IElementCollection Applets { get; }
string Background { get; set; }
IElement Body { get; }
string Charset { get; set; }
string Cookie { get; set; }
- IElement DocumentElement { get; }\r
+ IElement DocumentElement { get; }
IDocumentType DocType { get; }
string Domain { get; }
string ForeColor { get; set; }
IElementCollection Forms { get; }
- IElementCollection Images { get; }\r
+ IElementCollection Images { get; }
IDOMImplementation Implementation { get; }
string LinkColor { get; set; }
- IElementCollection Links { get; }\r
- IStylesheetList Stylesheets {get;}\r
- string Title { get; set;}\r
+ IElementCollection Links { get; }
+ IStylesheetList Stylesheets {get;}
+ string Title { get; set;}
string Url { get; }
- string VisitedLinkColor { get; set; }\r
+ string VisitedLinkColor { get; set; }
IWindow Window { get; }
- IAttribute CreateAttribute (string name);\r
+ IAttribute CreateAttribute (string name);
IElement CreateElement (string tagName);
IElement GetElementById (string id);
IElement GetElement (int x, int y);
- IElementCollection GetElementsByTagName (string id);\r
- void Write (string text);\r
+ IElementCollection GetElementsByTagName (string id);
+ void Write (string text);
- bool Equals (IDocument obj);\r
-\r
+ bool Equals (IDocument obj);
+
string InvokeScript (string script);
- int GetHashCode ();\r
- \r
- event EventHandler LoadStopped;\r
- }\r
-}\r
+ int GetHashCode ();
+
+ event EventHandler LoadStopped;
+ }
+}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
-\r
-namespace Mono.WebBrowser.DOM\r
-{\r
- public interface IElement : INode\r
- {\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+
+namespace Mono.WebBrowser.DOM
+{
+ public interface IElement : INode
+ {
IElementCollection All { get; }
- IElementCollection Children { get; }\r
-\r
- int ClientWidth { get; }\r
- int ClientHeight { get; }\r
- int ScrollHeight { get; }\r
- int ScrollWidth { get; }\r
- int ScrollLeft { get; set;}\r
- int ScrollTop { get; set; }\r
- int OffsetHeight { get; }\r
- int OffsetWidth { get; }\r
- int OffsetLeft { get; }\r
- int OffsetTop { get; }\r
- IElement OffsetParent { get; }\r
-\r
- string InnerText { get; set; }\r
- string InnerHTML { get; set; }\r
- string OuterText { get; set; }\r
- string OuterHTML { get; set; }\r
- string Style { get; set; }\r
- int TabIndex { get; set; }\r
- string TagName { get; }\r
+ IElementCollection Children { get; }
+
+ int ClientWidth { get; }
+ int ClientHeight { get; }
+ int ScrollHeight { get; }
+ int ScrollWidth { get; }
+ int ScrollLeft { get; set;}
+ int ScrollTop { get; set; }
+ int OffsetHeight { get; }
+ int OffsetWidth { get; }
+ int OffsetLeft { get; }
+ int OffsetTop { get; }
+ IElement OffsetParent { get; }
+
+ string InnerText { get; set; }
+ string InnerHTML { get; set; }
+ string OuterText { get; set; }
+ string OuterHTML { get; set; }
+ string Style { get; set; }
+ int TabIndex { get; set; }
+ string TagName { get; }
bool Disabled { get; set; }
- IElement AppendChild (IElement child);\r
- void Blur ();\r
- bool Equals (IElement obj);\r
+ IElement AppendChild (IElement child);
+ void Blur ();
+ bool Equals (IElement obj);
void Focus ();
- bool HasAttribute (string name);\r
+ bool HasAttribute (string name);
string GetAttribute (string name);
IElementCollection GetElementsByTagName (string id);
- int GetHashCode ();\r
- void ScrollIntoView (bool alignWithTop);\r
+ int GetHashCode ();
+ void ScrollIntoView (bool alignWithTop);
void SetAttribute (string name, string value);
- }\r
-}\r
+ }
+}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
// Andreia Gaita (avidigal@novell.com)
//
-using System;\r
-using Mono.WebBrowser;\r
-\r
-namespace Mono.WebBrowser.DOM\r
+using System;
+using Mono.WebBrowser;
+
+namespace Mono.WebBrowser.DOM
{
public interface IHistory
{
-// 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, 2008 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
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using Mono.WebBrowser;
+
+namespace Mono.WebBrowser.DOM
+{
+ public interface INavigation
+ {
+ bool CanGoBack { get; }
+ bool CanGoForward { get; }
+ bool Back ();
+ bool Forward ();
+ void Home ();
+ void Reload ();
+ void Reload (ReloadOption option);
void Stop ();
/// <summary>
/// <param name="flags">
/// A <see cref="LoadFlags"/> that control if the page comes from cache or not.
/// </param>
- void Go (string url, LoadFlags flags);\r
-\r
+ void Go (string url, LoadFlags flags);
+
int HistoryCount { get; }
}
BypassLocalCache = 0x0100,
BypassProxy = 0x0200,
CharsetChange = 0x0400
- }\r
-}\r
+ }
+}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
-\r
-namespace Mono.WebBrowser.DOM\r
-{\r
- public interface INode\r
- {\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+
+namespace Mono.WebBrowser.DOM
+{
+ public interface INode
+ {
IAttributeCollection Attributes { get; }
INodeList ChildNodes { get; }
INode FirstChild { get; }
- INode InsertBefore (INode newChild, INode refChild);\r
+ INode InsertBefore (INode newChild, INode refChild);
INode ReplaceChild (INode newChild, INode oldChild);
INode RemoveChild (INode child);
INode AppendChild (INode child);
IDocument Owner { get; }
INode Parent {get;}
INode Previous { get; }
- NodeType Type { get;}\r
+ NodeType Type { get;}
string Value {get; set;}
void FireEvent (string eventName);
- int GetHashCode ();\r
+ int GetHashCode ();
void AttachEventHandler (string eventName, EventHandler handler);
void DetachEventHandler (string eventName, EventHandler handler);
- \r
+
/// <summary>
- /// Attach a generic handler for events. The delegate needs to conform to the EventHandler signature, \r
+ /// Attach a generic handler for events. The delegate needs to conform to the EventHandler signature,
/// i.e., be in the form (object sender, EventArgs e)
/// </summary>
/// <param name="eventName">
/// A <see cref="System.String"/> with the name of the event to listen for.
/// </param>
/// <param name="handler">
- /// A <see cref="System.Delegate"/> conforming to the EventHandler signature. \r
+ /// A <see cref="System.Delegate"/> conforming to the EventHandler signature.
/// It will throw an exception if the delegate is not of the format (object sender, EventArgs e).
/// </param>
void AttachEventHandler (string eventName, System.Delegate handler);
void DetachEventHandler (string eventName, System.Delegate handler);
-\r
+
event NodeEventHandler Click;
event NodeEventHandler DoubleClick;
event NodeEventHandler KeyDown;
event NodeEventHandler MouseLeave;
event NodeEventHandler MouseMove;
event NodeEventHandler MouseOver;
- event NodeEventHandler MouseUp;\r
- event NodeEventHandler OnFocus;\r
- event NodeEventHandler OnBlur;\r
+ event NodeEventHandler MouseUp;
+ event NodeEventHandler OnFocus;
+ event NodeEventHandler OnBlur;
}
public enum NodeType
DocumentType = 10,
DocumentFragment = 11,
Notation = 12
- }\r
-}\r
+ }
+}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
string Name { get; set; }
IWindow Parent { get; }
string StatusText { get; }
- IWindow Top { get; }\r
+ IWindow Top { get; }
IHistory History {get;}
- \r
+
void AttachEventHandler (string eventName, EventHandler handler);
void DetachEventHandler (string eventName, EventHandler handler);
void Focus ();
void ScrollTo (int x, int y);
event EventHandler Load;
- event EventHandler Unload;\r
- event EventHandler OnFocus;\r
- event EventHandler OnBlur;\r
- event EventHandler Error;\r
+ event EventHandler Unload;
+ event EventHandler OnFocus;
+ event EventHandler OnBlur;
+ event EventHandler Error;
event EventHandler Scroll;
}
}
-// 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) 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
using System.Collections;
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
//
using System;
-using System.Text;\r
-using System.Collections;\r
+using System.Text;
+using System.Collections;
+
+namespace Mono.WebBrowser
+{
+ public class Exception : System.Exception
+ {
+ ErrorCodes code;
+ static ArrayList messages = new ArrayList();
+
+ static Exception ()
+ {
+ messages.Insert ((int) ErrorCodes.Other, String.Intern ("A critical error occurred."));
+ messages.Insert ((int) ErrorCodes.GluezillaInit, String.Intern ("An error occurred while initializing gluezilla. Please make sure you have libgluezilla installed."));
+ messages.Insert ((int) ErrorCodes.EngineNotSupported, String.Intern ("Browser engine not supported at this time: "));
+ messages.Insert ((int) ErrorCodes.ServiceManager, String.Intern ("Error obtaining a handle to the service manager."));
+ messages.Insert ((int) ErrorCodes.IOService, String.Intern ("Error obtaining a handle to the io service."));
+ messages.Insert ((int) ErrorCodes.DirectoryService, String.Intern ("Error obtaining a handle to the directory service."));
+ messages.Insert ((int) ErrorCodes.PrefService, String.Intern ("Error obtaining a handle to the preferences service."));
+ messages.Insert ((int) ErrorCodes.StreamNotOpen, String.Intern ("Stream is not open for writing. Call OpenStream before appending."));
+ messages.Insert ((int) ErrorCodes.Navigation, String.Intern ("An error occurred while initializing the navigation object."));
+ }
+
+
+ internal ErrorCodes ErrorCode
+ {
+ get { return code; }
+ }
+
+ internal Exception (ErrorCodes code)
+ : base (GetMessage (code, String.Empty))
+ {
+ this.code = code;
+ }
+
+ internal Exception (ErrorCodes code, string message)
+ : base (GetMessage (code, message))
+ {
+ this.code = code;
+ }
+
+ internal Exception (ErrorCodes code, System.Exception innerException)
+ : base (GetMessage (code, String.Empty), innerException)
+ {
+ this.code = code;
+ }
+
+ internal Exception (ErrorCodes code, string message, Exception innerException)
+ : base (GetMessage (code, message), innerException)
+ {
+ this.code = code;
+ }
+
+ private static string GetMessage (ErrorCodes code, string message)
+ {
+ string msg = Exception.messages[(int) code] as string;
+ return msg + " " + message;
+ }
-namespace Mono.WebBrowser\r
-{\r
- public class Exception : System.Exception\r
- {\r
- ErrorCodes code;\r
- static ArrayList messages = new ArrayList();\r
-\r
- static Exception ()\r
- {\r
- messages.Insert ((int) ErrorCodes.Other, String.Intern ("A critical error occurred."));\r
- messages.Insert ((int) ErrorCodes.GluezillaInit, String.Intern ("An error occurred while initializing gluezilla. Please make sure you have libgluezilla installed."));\r
- messages.Insert ((int) ErrorCodes.EngineNotSupported, String.Intern ("Browser engine not supported at this time: "));\r
- messages.Insert ((int) ErrorCodes.ServiceManager, String.Intern ("Error obtaining a handle to the service manager."));\r
- messages.Insert ((int) ErrorCodes.IOService, String.Intern ("Error obtaining a handle to the io service."));\r
- messages.Insert ((int) ErrorCodes.DirectoryService, String.Intern ("Error obtaining a handle to the directory service."));\r
- messages.Insert ((int) ErrorCodes.PrefService, String.Intern ("Error obtaining a handle to the preferences service."));\r
- messages.Insert ((int) ErrorCodes.StreamNotOpen, String.Intern ("Stream is not open for writing. Call OpenStream before appending."));\r
- messages.Insert ((int) ErrorCodes.Navigation, String.Intern ("An error occurred while initializing the navigation object."));\r
- }\r
-\r
-\r
- internal ErrorCodes ErrorCode\r
- {\r
- get { return code; }\r
- }\r
-\r
- internal Exception (ErrorCodes code)\r
- : base (GetMessage (code, String.Empty))\r
- {\r
- this.code = code;\r
- }\r
-\r
- internal Exception (ErrorCodes code, string message)\r
- : base (GetMessage (code, message))\r
- {\r
- this.code = code;\r
- }\r
-\r
- internal Exception (ErrorCodes code, System.Exception innerException)\r
- : base (GetMessage (code, String.Empty), innerException)\r
- {\r
- this.code = code;\r
- }\r
-\r
- internal Exception (ErrorCodes code, string message, Exception innerException)\r
- : base (GetMessage (code, message), innerException)\r
- {\r
- this.code = code;\r
- }\r
-\r
- private static string GetMessage (ErrorCodes code, string message)\r
- {\r
- string msg = Exception.messages[(int) code] as string;\r
- return msg + " " + message;\r
- }\r
-\r
- internal enum ErrorCodes\r
- {\r
- Other,\r
- GluezillaInit,\r
- EngineNotSupported,\r
- ServiceManager,\r
- IOService,\r
- DirectoryService,\r
- PrefService,\r
- StreamNotOpen,\r
- Navigation\r
- }\r
- }\r
-}\r
+ internal enum ErrorCodes
+ {
+ Other,
+ GluezillaInit,
+ EngineNotSupported,
+ ServiceManager,
+ IOService,
+ DirectoryService,
+ PrefService,
+ StreamNotOpen,
+ Navigation
+ }
+ }
+}
-// 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, 2008 Novell, Inc.\r
-//\r
-// Authors:\r
-// Andreia Gaita (avidigal@novell.com)\r
-//\r
-\r
-using System;\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Collections;
-using System.Collections.Specialized;\r
+using System.Collections.Specialized;
using Mono.WebBrowser.DOM;
namespace Mono.WebBrowser
-{\r
- public interface IWebBrowser\r
- {\r
+{
+ public interface IWebBrowser
+ {
/// <summary>
/// Initialize a browser instance.
/// </summary>
/// <returns>
/// A <see cref="System.Boolean"/>
/// </returns>
- bool Load (IntPtr handle, int width, int height);\r
- void Shutdown ();\r
- void FocusIn (FocusOption focus);\r
- void FocusOut ();\r
- void Activate ();\r
- void Deactivate ();\r
- void Resize (int width, int height);\r
-\r
- void Render (byte[] data);\r
- void Render (string html);\r
- void Render (string html, string uri, string contentType);\r
- \r
+ bool Load (IntPtr handle, int width, int height);
+ void Shutdown ();
+ void FocusIn (FocusOption focus);
+ void FocusOut ();
+ void Activate ();
+ void Deactivate ();
+ void Resize (int width, int height);
+
+ void Render (byte[] data);
+ void Render (string html);
+ void Render (string html, string uri, string contentType);
+
bool Initialized { get; }
- IWindow Window { get; }\r
- IDocument Document { get; }\r
- bool Offline {get; set;}\r
- \r
+ IWindow Window { get; }
+ IDocument Document { get; }
+ bool Offline {get; set;}
+
/// <value>
/// Object exposing navigation methods like Go, Back, etc.
- /// </value>\r
- INavigation Navigation { get; }\r
-\r
- event NodeEventHandler KeyDown;\r
- event NodeEventHandler KeyPress;\r
- event NodeEventHandler KeyUp;\r
- event NodeEventHandler MouseClick;\r
- event NodeEventHandler MouseDoubleClick;\r
- event NodeEventHandler MouseDown;\r
- event NodeEventHandler MouseEnter;\r
- event NodeEventHandler MouseLeave;\r
- event NodeEventHandler MouseMove;\r
- event NodeEventHandler MouseUp;\r
- event EventHandler Focus;\r
- event CreateNewWindowEventHandler CreateNewWindow;\r
- \r
- event AlertEventHandler Alert;\r
- \r
- event LoadStartedEventHandler LoadStarted;\r
- event LoadCommitedEventHandler LoadCommited;\r
- event ProgressChangedEventHandler ProgressChanged;\r
- event LoadFinishedEventHandler LoadFinished;\r
- \r
- event StatusChangedEventHandler StatusChanged;\r
- event SecurityChangedEventHandler SecurityChanged;\r
- \r
+ /// </value>
+ INavigation Navigation { get; }
+
+ event NodeEventHandler KeyDown;
+ event NodeEventHandler KeyPress;
+ event NodeEventHandler KeyUp;
+ event NodeEventHandler MouseClick;
+ event NodeEventHandler MouseDoubleClick;
+ event NodeEventHandler MouseDown;
+ event NodeEventHandler MouseEnter;
+ event NodeEventHandler MouseLeave;
+ event NodeEventHandler MouseMove;
+ event NodeEventHandler MouseUp;
+ event EventHandler Focus;
+ event CreateNewWindowEventHandler CreateNewWindow;
+
+ event AlertEventHandler Alert;
+
+ event LoadStartedEventHandler LoadStarted;
+ event LoadCommitedEventHandler LoadCommited;
+ event ProgressChangedEventHandler ProgressChanged;
+ event LoadFinishedEventHandler LoadFinished;
+
+ event StatusChangedEventHandler StatusChanged;
+ event SecurityChangedEventHandler SecurityChanged;
+
event ContextMenuEventHandler ContextMenuShown;
}
- public enum ReloadOption : uint\r
- {\r
- None = 0,\r
- Proxy = 1,\r
- Full = 2\r
- }\r
-\r
- public enum FocusOption\r
- {\r
- None = 0,\r
- FocusFirstElement = 1,\r
- FocusLastElement = 2\r
- }\r
-\r
- [Flags]\r
- public enum DialogButtonFlags\r
- {\r
- BUTTON_POS_0 = 1,\r
- BUTTON_POS_1 = 256,\r
- BUTTON_POS_2 = 65536,\r
- BUTTON_TITLE_OK = 1,\r
- BUTTON_TITLE_CANCEL = 2,\r
- BUTTON_TITLE_YES = 3,\r
- BUTTON_TITLE_NO = 4,\r
- BUTTON_TITLE_SAVE = 5,\r
- BUTTON_TITLE_DONT_SAVE = 6,\r
- BUTTON_TITLE_REVERT = 7,\r
- BUTTON_TITLE_IS_STRING = 127,\r
- BUTTON_POS_0_DEFAULT = 0,\r
- BUTTON_POS_1_DEFAULT = 16777216,\r
- BUTTON_POS_2_DEFAULT = 33554432,\r
- BUTTON_DELAY_ENABLE = 67108864,\r
- STD_OK_CANCEL_BUTTONS = 513\r
- }\r
-\r
- public enum DialogType\r
- {\r
- Alert = 1,\r
- AlertCheck = 2,\r
- Confirm = 3,\r
- ConfirmEx = 4,\r
- ConfirmCheck = 5,\r
- Prompt = 6,\r
- PromptUsernamePassword = 7,\r
- PromptPassword = 8,\r
- Select = 9\r
- }\r
-\r
- public enum Platform\r
- {\r
- Unknown = 0,\r
- Winforms = 1,\r
- Gtk = 2\r
- }\r
- \r
- public enum SecurityLevel {\r
- Insecure= 1,\r
- Mixed = 2,\r
- Secure = 3\r
- }\r
-\r
-#region Window Events\r
- public delegate bool CreateNewWindowEventHandler (object sender, CreateNewWindowEventArgs e);\r
- public class CreateNewWindowEventArgs : EventArgs\r
- {\r
- private bool isModal;\r
-\r
- #region Public Constructors\r
- public CreateNewWindowEventArgs (bool isModal)\r
- : base ()\r
- {\r
- this.isModal = isModal;\r
- }\r
- #endregion // Public Constructors\r
-\r
- #region Public Instance Properties\r
- public bool IsModal\r
- {\r
- get { return this.isModal; }\r
- }\r
- #endregion // Public Instance Properties\r
- }\r
-#endregion\r
-\r
-#region Script events\r
- \r
- public delegate void AlertEventHandler (object sender, AlertEventArgs e);\r
- public class AlertEventArgs : EventArgs\r
- {\r
- private DialogType type;\r
- private string title;\r
- private string text;\r
- private string text2;\r
- \r
- private string username;\r
- private string password;\r
- private string checkMsg; \r
- private bool checkState;\r
- private DialogButtonFlags dialogButtons;\r
- \r
- private StringCollection buttons;\r
- private StringCollection options;\r
-\r
- private object returnValue;\r
-\r
- #region Public Constructors\r
- /// <summary>\r
- /// void (STDCALL *OnAlert) (const PRUnichar * title, const PRUnichar * text);\r
- /// </summary>\r
- /// <param name="title"></param>\r
- /// <param name="text"></param>\r
- public AlertEventArgs ()\r
- : base ()\r
- {\r
- }\r
-\r
-\r
-#endregion // Public Constructors\r
-\r
- #region Public Instance Properties\r
- public DialogType Type {\r
- get { return this.type; }\r
- set { this.type = value; }\r
- }\r
- public string Title {\r
- get { return this.title; }\r
- set { this.title = value; }\r
- }\r
- public string Text {\r
- get { return this.text; }\r
- set { this.text = value; }\r
- }\r
- public string Text2 {\r
- get { return this.text2; }\r
- set { this.text2 = value; }\r
- }\r
- public string CheckMessage\r
- {\r
- get { return this.checkMsg; }\r
- set { this.checkMsg = value; }\r
- }\r
- public bool CheckState {\r
- get { return this.checkState; }\r
- set { this.checkState = value; }\r
- }\r
- public DialogButtonFlags DialogButtons {\r
- get { return this.dialogButtons; }\r
- set { this.dialogButtons = value; }\r
- }\r
- public StringCollection Buttons {\r
- get { return buttons; }\r
- set { buttons = value; }\r
- }\r
- public StringCollection Options {\r
- get { return options; }\r
- set { options = value; }\r
- }\r
-\r
- public string Username {\r
- get { return username; }\r
- set { username = value; }\r
- }\r
-\r
- public string Password {\r
- get { return password; }\r
- set { password = value; }\r
- }\r
-\r
- public bool BoolReturn {\r
- get { \r
- if (returnValue is bool)\r
- return (bool) returnValue;\r
- return false;\r
- }\r
- set { returnValue = value; }\r
- }\r
-\r
- public int IntReturn {\r
- get { \r
- if (returnValue is int)\r
- return (int) returnValue;\r
- return -1;\r
- }\r
- set { returnValue = value; }\r
- }\r
-\r
- public string StringReturn {\r
- get { \r
- if (returnValue is string)\r
- return (string) returnValue;\r
- return String.Empty;\r
- }\r
- set { returnValue = value; }\r
- }\r
-\r
-#endregion\r
+ public enum ReloadOption : uint
+ {
+ None = 0,
+ Proxy = 1,
+ Full = 2
+ }
+
+ public enum FocusOption
+ {
+ None = 0,
+ FocusFirstElement = 1,
+ FocusLastElement = 2
+ }
+
+ [Flags]
+ public enum DialogButtonFlags
+ {
+ BUTTON_POS_0 = 1,
+ BUTTON_POS_1 = 256,
+ BUTTON_POS_2 = 65536,
+ BUTTON_TITLE_OK = 1,
+ BUTTON_TITLE_CANCEL = 2,
+ BUTTON_TITLE_YES = 3,
+ BUTTON_TITLE_NO = 4,
+ BUTTON_TITLE_SAVE = 5,
+ BUTTON_TITLE_DONT_SAVE = 6,
+ BUTTON_TITLE_REVERT = 7,
+ BUTTON_TITLE_IS_STRING = 127,
+ BUTTON_POS_0_DEFAULT = 0,
+ BUTTON_POS_1_DEFAULT = 16777216,
+ BUTTON_POS_2_DEFAULT = 33554432,
+ BUTTON_DELAY_ENABLE = 67108864,
+ STD_OK_CANCEL_BUTTONS = 513
+ }
+
+ public enum DialogType
+ {
+ Alert = 1,
+ AlertCheck = 2,
+ Confirm = 3,
+ ConfirmEx = 4,
+ ConfirmCheck = 5,
+ Prompt = 6,
+ PromptUsernamePassword = 7,
+ PromptPassword = 8,
+ Select = 9
+ }
+
+ public enum Platform
+ {
+ Unknown = 0,
+ Winforms = 1,
+ Gtk = 2
+ }
+
+ public enum SecurityLevel {
+ Insecure= 1,
+ Mixed = 2,
+ Secure = 3
+ }
+
+#region Window Events
+ public delegate bool CreateNewWindowEventHandler (object sender, CreateNewWindowEventArgs e);
+ public class CreateNewWindowEventArgs : EventArgs
+ {
+ private bool isModal;
+
+ #region Public Constructors
+ public CreateNewWindowEventArgs (bool isModal)
+ : base ()
+ {
+ this.isModal = isModal;
+ }
+ #endregion // Public Constructors
+
+ #region Public Instance Properties
+ public bool IsModal
+ {
+ get { return this.isModal; }
+ }
+ #endregion // Public Instance Properties
+ }
+#endregion
+
+#region Script events
+
+ public delegate void AlertEventHandler (object sender, AlertEventArgs e);
+ public class AlertEventArgs : EventArgs
+ {
+ private DialogType type;
+ private string title;
+ private string text;
+ private string text2;
+
+ private string username;
+ private string password;
+ private string checkMsg;
+ private bool checkState;
+ private DialogButtonFlags dialogButtons;
+
+ private StringCollection buttons;
+ private StringCollection options;
+
+ private object returnValue;
+
+ #region Public Constructors
+ /// <summary>
+ /// void (STDCALL *OnAlert) (const PRUnichar * title, const PRUnichar * text);
+ /// </summary>
+ /// <param name="title"></param>
+ /// <param name="text"></param>
+ public AlertEventArgs ()
+ : base ()
+ {
+ }
+
+
+#endregion // Public Constructors
+
+ #region Public Instance Properties
+ public DialogType Type {
+ get { return this.type; }
+ set { this.type = value; }
+ }
+ public string Title {
+ get { return this.title; }
+ set { this.title = value; }
+ }
+ public string Text {
+ get { return this.text; }
+ set { this.text = value; }
+ }
+ public string Text2 {
+ get { return this.text2; }
+ set { this.text2 = value; }
+ }
+ public string CheckMessage
+ {
+ get { return this.checkMsg; }
+ set { this.checkMsg = value; }
+ }
+ public bool CheckState {
+ get { return this.checkState; }
+ set { this.checkState = value; }
+ }
+ public DialogButtonFlags DialogButtons {
+ get { return this.dialogButtons; }
+ set { this.dialogButtons = value; }
+ }
+ public StringCollection Buttons {
+ get { return buttons; }
+ set { buttons = value; }
+ }
+ public StringCollection Options {
+ get { return options; }
+ set { options = value; }
+ }
+
+ public string Username {
+ get { return username; }
+ set { username = value; }
+ }
+
+ public string Password {
+ get { return password; }
+ set { password = value; }
+ }
+
+ public bool BoolReturn {
+ get {
+ if (returnValue is bool)
+ return (bool) returnValue;
+ return false;
+ }
+ set { returnValue = value; }
+ }
+
+ public int IntReturn {
+ get {
+ if (returnValue is int)
+ return (int) returnValue;
+ return -1;
+ }
+ set { returnValue = value; }
+ }
+
+ public string StringReturn {
+ get {
+ if (returnValue is string)
+ return (string) returnValue;
+ return String.Empty;
+ }
+ set { returnValue = value; }
+ }
+
+#endregion
}
#endregion
-\r
-#region Loading events\r
+
+#region Loading events
+
+ public delegate void StatusChangedEventHandler (object sender, StatusChangedEventArgs e);
+ public class StatusChangedEventArgs : EventArgs
+ {
+ private string message;
+ public string Message {
+ get { return message; }
+ set { message = value; }
+ }
+
+ private int status;
+ public int Status {
+ get { return status; }
+ set { status = value; }
+ }
+
+ public StatusChangedEventArgs (string message, int status)
+ {
+ this.message = message;
+ this.status = status;
+ }
+ }
+
+ public delegate void ProgressChangedEventHandler (object sender, ProgressChangedEventArgs e);
+ public class ProgressChangedEventArgs : EventArgs
+ {
+ private int progress;
+ public int Progress {
+ get { return progress; }
+ }
+ private int maxProgress;
+ public int MaxProgress {
+ get { return maxProgress; }
+ }
+
+ public ProgressChangedEventArgs (int progress, int maxProgress) {
+ this.progress = progress;
+ this.maxProgress = maxProgress;
+ }
+ }
- public delegate void StatusChangedEventHandler (object sender, StatusChangedEventArgs e);\r
- public class StatusChangedEventArgs : EventArgs\r
- {\r
- private string message;\r
- public string Message {\r
- get { return message; }\r
- set { message = value; }\r
- }\r
-\r
- private int status;\r
- public int Status {\r
- get { return status; }\r
- set { status = value; }\r
- }\r
-\r
- public StatusChangedEventArgs (string message, int status)\r
- {\r
- this.message = message;\r
- this.status = status;\r
- }\r
- }\r
-\r
- public delegate void ProgressChangedEventHandler (object sender, ProgressChangedEventArgs e);\r
- public class ProgressChangedEventArgs : EventArgs \r
- {\r
- private int progress;\r
- public int Progress {\r
- get { return progress; }\r
- }\r
- private int maxProgress;\r
- public int MaxProgress {\r
- get { return maxProgress; }\r
- }\r
- \r
- public ProgressChangedEventArgs (int progress, int maxProgress) {\r
- this.progress = progress;\r
- this.maxProgress = maxProgress;\r
- }\r
- }\r
- \r
- public delegate void LoadStartedEventHandler (object sender, LoadStartedEventArgs e);\r
- public class LoadStartedEventArgs : System.ComponentModel.CancelEventArgs {\r
- private string uri;\r
- public string Uri {\r
- get {return uri;}\r
- }\r
- private string frameName;\r
- public string FrameName {\r
- get {return frameName;}\r
- }\r
- public LoadStartedEventArgs (string uri, string frameName) {\r
- this.uri = uri;\r
- this.frameName = frameName;\r
- }\r
- }\r
- public delegate void LoadCommitedEventHandler (object sender, LoadCommitedEventArgs e);\r
- public class LoadCommitedEventArgs : EventArgs {\r
- private string uri;\r
- public string Uri {\r
- get {return uri;}\r
- }\r
- public LoadCommitedEventArgs (string uri) {\r
- this.uri = uri;\r
- }\r
- }\r
-\r
- public delegate void LoadFinishedEventHandler (object sender, LoadFinishedEventArgs e);\r
- public class LoadFinishedEventArgs : EventArgs {\r
- private string uri;\r
- public string Uri {\r
- get {return uri;}\r
- }\r
- public LoadFinishedEventArgs (string uri) {\r
- this.uri = uri;\r
- }\r
- }\r
- \r
- public delegate void SecurityChangedEventHandler (object sender, SecurityChangedEventArgs e);\r
- public class SecurityChangedEventArgs : EventArgs\r
- {\r
- private SecurityLevel state;\r
- public SecurityLevel State {\r
- get { return state; }\r
- set { state = value; }\r
- }\r
-\r
- public SecurityChangedEventArgs (SecurityLevel state)\r
- {\r
- this.state = state;\r
- }\r
- }\r
- \r
- public delegate void ContextMenuEventHandler (object sender, ContextMenuEventArgs e);\r
- public class ContextMenuEventArgs : EventArgs\r
- {\r
- private int x;\r
- private int y;\r
-\r
- public int X {\r
- get { return x; }\r
- }\r
- public int Y {\r
- get { return y; }\r
- }\r
-\r
- public ContextMenuEventArgs (int x, int y)\r
- {\r
- this.x = x;\r
- this.y = y;\r
- }\r
- } \r
+ public delegate void LoadStartedEventHandler (object sender, LoadStartedEventArgs e);
+ public class LoadStartedEventArgs : System.ComponentModel.CancelEventArgs {
+ private string uri;
+ public string Uri {
+ get {return uri;}
+ }
+ private string frameName;
+ public string FrameName {
+ get {return frameName;}
+ }
+ public LoadStartedEventArgs (string uri, string frameName) {
+ this.uri = uri;
+ this.frameName = frameName;
+ }
+ }
+ public delegate void LoadCommitedEventHandler (object sender, LoadCommitedEventArgs e);
+ public class LoadCommitedEventArgs : EventArgs {
+ private string uri;
+ public string Uri {
+ get {return uri;}
+ }
+ public LoadCommitedEventArgs (string uri) {
+ this.uri = uri;
+ }
+ }
+
+ public delegate void LoadFinishedEventHandler (object sender, LoadFinishedEventArgs e);
+ public class LoadFinishedEventArgs : EventArgs {
+ private string uri;
+ public string Uri {
+ get {return uri;}
+ }
+ public LoadFinishedEventArgs (string uri) {
+ this.uri = uri;
+ }
+ }
+
+ public delegate void SecurityChangedEventHandler (object sender, SecurityChangedEventArgs e);
+ public class SecurityChangedEventArgs : EventArgs
+ {
+ private SecurityLevel state;
+ public SecurityLevel State {
+ get { return state; }
+ set { state = value; }
+ }
+
+ public SecurityChangedEventArgs (SecurityLevel state)
+ {
+ this.state = state;
+ }
+ }
+
+ public delegate void ContextMenuEventHandler (object sender, ContextMenuEventArgs e);
+ public class ContextMenuEventArgs : EventArgs
+ {
+ private int x;
+ private int y;
+
+ public int X {
+ get { return x; }
+ }
+ public int Y {
+ get { return y; }
+ }
+
+ public ContextMenuEventArgs (int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ }
#endregion
}