svn path=/trunk/gtk-sharp/; revision=16277
This commit is contained in:
Miguel de Icaza 2003-07-15 23:42:15 +00:00
parent 9d32a838a0
commit 7880ee2044

View file

@ -1,5 +1,5 @@
<Type Name="HTML" FullName="Gtk.HTML"> <Type Name="HTML" FullName="Gtk.HTML">
<TypeSignature Language="C#" Value="public class HTML : Gtk.Layout, Implementor, IWrapper, IWrapper, IDisposable" Maintainer="auto" /> <TypeSignature Language="C#" Value="public class HTML : Gtk.Layout, Implementor, IWrapper, IWrapper, IDisposable" Maintainer="Miguel de Icaza" />
<AssemblyInfo> <AssemblyInfo>
<AssemblyName>gtk-sharp</AssemblyName> <AssemblyName>gtk-sharp</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion> <AssemblyVersion>0.0.0.0</AssemblyVersion>
@ -7,8 +7,22 @@
</AssemblyInfo> </AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement> <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Docs> <Docs>
<summary>To be added</summary> <summary>Lightweight HTML rendering widget.</summary>
<remarks>To be added</remarks> <remarks>
<para>
Gtk.HTML is a lightweight HTML rendering widget, as well as as
simple graphical HTML editor.
</para>
<para>
Developers can also be used as a widget container (<see
cref="T:Gtk.Container"/>). It is an easy way for viewing HTML
documents in your application and for layout UI of your
application throught HTML.
</para>
<para>
Gtk.HTML does not have support for CSS or JavaScript.
</para>
</remarks>
</Docs> </Docs>
<Base> <Base>
<BaseTypeName>Gtk.Layout</BaseTypeName> <BaseTypeName>Gtk.Layout</BaseTypeName>
@ -39,9 +53,10 @@
<Parameter Name="html" Type="Gtk.Widget" /> <Parameter Name="html" Type="Gtk.Widget" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Constructs an instance of a Gtk.HTML widget</summary>
<param name="html">To be added: an object of type 'Gtk.Widget'</param> <param name="html">A Gtk.HTML derivative object.</param>
<remarks>To be added</remarks> <remarks>This is a low-level routine, and should only be used
to initialize an instance of a Gtk.HTML derivative class.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="GetObjectById"> <Member MemberName="GetObjectById">
@ -54,10 +69,11 @@
<Parameter Name="id" Type="System.String" /> <Parameter Name="id" Type="System.String" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Locates an object whose id is provided</summary>
<param name="id">To be added: an object of type 'string'</param> <param name="id">The id assigned to an object in the HTML stream</param>
<returns>To be added: an object of type 'IntPtr'</returns> <returns>An IntPtr to the internal HTMLObject</returns>
<remarks>To be added</remarks> <remarks>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="Export"> <Member MemberName="Export">
@ -86,8 +102,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Copies the selection to the clipboard.</summary>
<remarks>To be added</remarks> <remarks>Copies the selection into the clipboard.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="SelectWord"> <Member MemberName="SelectWord">
@ -98,8 +114,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Selects the word under the cursor.</summary>
<remarks>To be added</remarks> <remarks>This routine selects the word under the cursor.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="ToggleFontStyle"> <Member MemberName="ToggleFontStyle">
@ -168,8 +184,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Undoes the last operation.</summary>
<remarks>To be added</remarks> <remarks>If the widget is Editable, this undoes the last operation.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="Cut"> <Member MemberName="Cut">
@ -180,8 +196,10 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Cuts the selection into the clipboard.</summary>
<remarks>To be added</remarks> <remarks>If the widget is editable, this cuts the selection
into the clipboard; Otherwise it just copies the selection
into the clipboard.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="GetUrlBaseRelative"> <Member MemberName="GetUrlBaseRelative">
@ -194,10 +212,10 @@
<Parameter Name="url" Type="System.String" /> <Parameter Name="url" Type="System.String" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Computes url from widget base url.</summary>
<param name="url">To be added: an object of type 'string'</param> <param name="url">The new component of the url.</param>
<returns>To be added: an object of type 'string'</returns> <returns>The new base-relative url.</returns>
<remarks>To be added</remarks> <remarks></remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="UpdateStyles"> <Member MemberName="UpdateStyles">
@ -220,9 +238,52 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Starts incremental content updating.</summary>
<returns>To be added: an object of type 'Gtk.HTMLStream'</returns> <returns>A <see cref="T:Gtk.HTMLStream"/> handle to push content.</returns>
<remarks>To be added</remarks> <remarks>
<para>
Use the Begin method to push new HTML content into the
widget. The content type is expected to be in the format
defined by <see cref="P:Gtk.HTML.DefaultContentType"/>,
which by default is "html/text; charset=utf-8".
</para>
<example>
<code lang="C#">
using System;
using Gtk;
class X {
static void Main ()
{
Application.Init ();
Window w = new Window ("Sample");
HTML html = new HTML ();
w.Add (html);
w.ShowAll ();
HTMLStream s = html.Begin ();
string line;
while ((line = Console.ReadLine ()) != null)
s.Write (line);
html.End (s, HTMLStreamStatus.Ok);
Application.Run ();
}
}
</code>
</example>
<para>
Compile and run:
</para>
<para>
mcs sample.cs -r:gtk-sharp
</para>
<para>
echo "<html><body>Hello <b>World</b></body></html>" | mono sample.exe
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="ImagesRef"> <Member MemberName="ImagesRef">
@ -247,9 +308,15 @@
<Parameter Name="as_cite" Type="System.Boolean" /> <Parameter Name="as_cite" Type="System.Boolean" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Paste clipboard contents into editor</summary>
<param name="as_cite">To be added: an object of type 'bool'</param> <param name="as_cite">Whether to paste as a citation.</param>
<remarks>To be added</remarks> <remarks>
If the widget is in editing mode (see <see
cref="P:Gtk.HTML.Editable"/>), the contents of the clipboard
are pasted into the HTML editor. If the value of <see
paramref="as_cite"/> is true, then the contents are pasted
as a citation.
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="LoadEmpty"> <Member MemberName="LoadEmpty">
@ -288,10 +355,52 @@
<Parameter Name="status" Type="Gtk.HTMLStreamStatus" /> <Parameter Name="status" Type="Gtk.HTMLStreamStatus" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Ends incremental updating</summary>
<param name="handle">To be added: an object of type 'Gtk.HTMLStream'</param> <param name="handle">The <see cref="T:Gtk.HTMLStream"/> to close.</param>
<param name="status">To be added: an object of type 'Gtk.HTMLStreamStatus'</param> <param name="status">The <see cref="T:Gtk.HTMLStreamStatus"/> representing the state of the stream when closed.</param>
<remarks>To be added</remarks> <remarks>
<para>
Closes the <see cref="Gtk.HTMLStream"/> represented
by <see paramref="stream"/> and notifies the HTML widget that
it should not expect any more content from that stream.
</para>
<example>
<code lang="C#">
using System;
using Gtk;
class X {
static void Main ()
{
Application.Init ();
Window w = new Window ("Sample");
HTML html = new HTML ();
w.Add (html);
w.ShowAll ();
HTMLStream s = html.Begin ();
string line;
while ((line = Console.ReadLine ()) != null)
s.Write (line);
html.End (s, HTMLStreamStatus.Ok);
Application.Run ();
}
}
</code>
</example>
<para>
Compile and run:
</para>
<para>
mcs sample.cs -r:gtk-sharp
</para>
<para>
echo "<html><body>Hello <b>World</b></body></html>" | mono sample.exe
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="Redo"> <Member MemberName="Redo">
@ -302,8 +411,9 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Redoes the last Undone operation</summary>
<remarks>To be added</remarks> <remarks>If the widget is editable, this redoes the last
undone operation.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="AppendHtml"> <Member MemberName="AppendHtml">
@ -353,8 +463,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Selects all the contents.</summary>
<remarks>To be added</remarks> <remarks>Selects all of the contents of the HTML widget.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="BeginFull"> <Member MemberName="BeginFull">
@ -416,10 +526,10 @@
<Parameter Name="data" Type="System.IntPtr" /> <Parameter Name="data" Type="System.IntPtr" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Unsupported in Gtk#. Installs hooks for the editor.</summary>
<param name="api">To be added: an object of type 'Gtk.HTMLEditorAPI'</param> <param name="api">To be added: an object of type 'Gtk.HTMLEditorAPI'</param>
<param name="data">To be added: an object of type 'IntPtr'</param> <param name="data">To be added: an object of type 'IntPtr'</param>
<remarks>To be added</remarks> <remarks>This API is currently not supported.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="InsertGtkHtml"> <Member MemberName="InsertGtkHtml">
@ -445,8 +555,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Zooms in.</summary>
<remarks>To be added</remarks> <remarks>Zooms in the view.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="InsertHtml"> <Member MemberName="InsertHtml">
@ -521,10 +631,10 @@
<Parameter Name="anchor" Type="System.String" /> <Parameter Name="anchor" Type="System.String" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Jumps to an anchor by name, making it visible.</summary>
<param name="anchor">To be added: an object of type 'string'</param> <param name="anchor">The anchor to locate.</param>
<returns>To be added: an object of type 'bool'</returns> <returns><see langword="true"/> if the anchor is found.</returns>
<remarks>To be added</remarks> <remarks>Scroll the document display to show the HTML anchor requested.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="ImagePreload"> <Member MemberName="ImagePreload">
@ -602,10 +712,55 @@
<Parameter Name="content_type" Type="System.String" /> <Parameter Name="content_type" Type="System.String" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Starts incremental content updating. With a specific
<param name="content_type">To be added: an object of type 'string'</param> content type.</summary>
<returns>To be added: an object of type 'Gtk.HTMLStream'</returns> <param name="content_type">The content type for the data to be
<remarks>To be added</remarks> streamed.</param>
<returns>A <see cref="T:Gtk.HTMLStream"/> handle to push content.</returns>
<remarks>
<para>
Use the Begin method to push new HTML content into the
widget. The content type has to be specified (like this
for example: "html/text; charset=utf-8").
</para>
<example>
<code lang="C#">
using System;
using Gtk;
class X {
static void Main ()
{
Application.Init ();
Window w = new Window ("Sample");
HTML html = new HTML ();
w.Add (html);
w.ShowAll ();
HTMLStream s = html.BeginContent ("text/html; charset=utf-8");
string line;
while ((line = Console.ReadLine ()) != null)
s.Write (line);
html.End (s, HTMLStreamStatus.Ok);
Application.Run ();
}
}
</code>
</example>
<para>
Compile and run:
</para>
<para>
mcs sample.cs -r:gtk-sharp
</para>
<para>
echo "<html><body>Hello <b>World</b></body></html>" | mono sample.exe
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="AllowSelection"> <Member MemberName="AllowSelection">
@ -631,8 +786,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Drops all the undo information.</summary>
<remarks>To be added</remarks> <remarks>Drops all the Undo and Redo information from the widget.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="SelectParagraphExtended"> <Member MemberName="SelectParagraphExtended">
@ -655,8 +810,8 @@
</ReturnValue> </ReturnValue>
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Zooms out.</summary>
<remarks>To be added</remarks> <remarks>Zooms out the view.</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="Command"> <Member MemberName="Command">
@ -709,9 +864,14 @@
<ReturnValue /> <ReturnValue />
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Creates an empty GtkHTML widget.</summary>
<returns>To be added: an object of type 'Gtk.HTML'</returns> <returns>The new constructed <see cref="T:Gtk.HTML"/> widget.</returns>
<remarks>To be added</remarks> <remarks>
<para>
It creates an empty <see cref="T:Gtk.HTML"/> widget. The
returned widget is empty, and defaults to not be editable.
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="GType"> <Member MemberName="GType">
@ -736,10 +896,14 @@
<Parameter Name="value" Type="System.Boolean" /> <Parameter Name="value" Type="System.Boolean" />
</Parameters> </Parameters>
<Docs> <Docs>
<summary>To be added</summary> <summary>Whether the contents can be edited.</summary>
<param name="value">To be added: an object of type 'bool'</param> <param name="value">Editing state.</param>
<returns>To be added: an object of type 'bool'</returns> <returns><see langword="true"/> if the contents are editable,
<remarks>To be added</remarks> <see langword="false"/>otherwise. </returns>
<remarks>
Whether this Gtk.HTML instance can be used as an HTML
editor.
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="ParagraphIndentation"> <Member MemberName="ParagraphIndentation">
@ -898,8 +1062,12 @@
<ReturnValue /> <ReturnValue />
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Occurs when the title changes in HTML</summary>
<remarks>To be added</remarks> <remarks>
This event is raised when the HTML parser encounters the
&lt;title&gt; tag on the HTML stream. To get the title, use
the <see cref="P:Gtk.HTML.Title"/> property.
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="SetBase"> <Member MemberName="SetBase">
@ -948,8 +1116,11 @@
<ReturnValue /> <ReturnValue />
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Occurs when the cursor moves.</summary>
<remarks>To be added</remarks> <remarks>
This event is raised when the widget is in editing mode and
the cursor has moved.
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="OnCommand"> <Member MemberName="OnCommand">
@ -968,8 +1139,75 @@
<ReturnValue /> <ReturnValue />
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Occurs when a url is Requested</summary>
<remarks>To be added</remarks> <remarks>
<para>
This event is raised when an URL is requested (typically
an image).
</para>
<para>
The following example shows how a simple HTML source that
requests an image (hello.png). If the file is found, then
it will be streamed into the HTML widget. The model
allows for data to be delivered as it comes, and when the
data has all arrived, the End method can be invoked on the
html stream provided by the <see
cref="P:GtkSharp.UrlRequestedArgs.Handle"/>.
</para>
<example>
<code lang="C#">
using System;
using System.IO;
using Gtk;
using GtkSharp;
class X {
static void Main ()
{
Application.Init ();
Window w = new Window ("Sample");
HTML html = new HTML ();
html.UrlRequested += new UrlRequestedHandler (LoadFromDisk);
w.Add (html);
w.ShowAll ();
HTMLStream s = html.Begin ();
s.Write ("&lt;html&gt;&lt;body&gt;My image: &lt;img src=\"hello.png\"&gt;&lt;/body&gt;&lt;/html&gt;");
html.End (s, HTMLStreamStatus.Ok);
Application.Run ();
}
static void LoadFromDisk (object sender, UrlRequestedArgs args)
{
try {
FileStream s = File.OpenRead (args.Url);
byte [] buffer = new byte [8192];
int n;
while ((n = s.Read (buffer, 0, 8192)) != 0) {
args.Handle.Write (buffer, n);
}
args.Handle.Close (HTMLStreamStatus.Ok);
} catch {
// Ignore errors.
}
}
}
</code>
</example>
<para>
Make sure there is a "hello.png" file in your directory to
see it, otherwise the sample will show the "broken image
link" image.
</para>
<para>
mcs sample.cs -r:gtk-sharp
</para>
<para>
mono sample.exe
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="IframeCreated"> <Member MemberName="IframeCreated">
@ -1028,8 +1266,49 @@
<ReturnValue /> <ReturnValue />
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Occurs when the user clicks on a hyperlink</summary>
<remarks>To be added</remarks> <remarks>
<para>
This event is raised when the user clicks on a hyperlink
in the HTML widget.
</para>
<example>
<code lang="C#">
using System;
using System.IO;
using Gtk;
using GtkSharp;
class X {
static void Main ()
{
Application.Init ();
Window w = new Window ("Sample");
HTML html = new HTML ("&lt;html&gt;&lt;body&gt;Click &lt;a href=\"http://www.go-mono.com\"&gt;me&lt;/a&gt;");
html.LinkClicked += new LinkClickedHandler (OnLinkClicked);
w.Add (html);
w.ShowAll ();
Application.Run ();
}
static void OnLinkClicked (object o, LinkClickedArgs args)
{
Console.WriteLine ("The link clicked url is: " + args.Url);
}
}
</code>
</example>
<para>
mcs sample.cs -r:gtk-sharp
</para>
<para>
mono sample.exe
</para>
<para>
Click on the "me" link to see the message on the console.
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="Submit"> <Member MemberName="Submit">
@ -1058,8 +1337,51 @@
<ReturnValue /> <ReturnValue />
<Parameters /> <Parameters />
<Docs> <Docs>
<summary>To be added</summary> <summary>Occurs when the user hovers over a hyper-link.</summary>
<remarks>To be added</remarks> <remarks>
<para>
This event is raised when the mouse pointer hovers over a
hyper link or leaves a link. In the former case the value
of <see cref="P:GtkSharp.OnUrlHandler.Url"/> is the link
target, and in the later the empty string.
</para>
<example>
<code lang="C#">
using System;
using System.IO;
using Gtk;
using GtkSharp;
class X {
static void Main ()
{
Application.Init ();
Window w = new Window ("Sample");
HTML html = new HTML ("&lt;html&gt;&lt;body&gt;Click &lt;a href=\"http://www.go-mono.com\"&gt;me&lt;/a&gt;");
html.OnUrl += new OnUrlHandler (OnUrl);
w.Add (html);
w.ShowAll ();
Application.Run ();
}
static void OnUrl (object o, OnUrlArgs args)
{
Console.WriteLine ("The mouse is over: " + args.Url);
}
}
</code>
</example>
<para>
mcs sample.cs -r:gtk-sharp
</para>
<para>
mono sample.exe
</para>
<para>
Hover in and out of the link to see the effects on the console.
</para>
</remarks>
</Docs> </Docs>
</Member> </Member>
<Member MemberName="SetBaseTarget"> <Member MemberName="SetBaseTarget">