File:  [mozdev] / abimoz / plugin / wpplugintst.html
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Fri Nov 9 17:55:46 2001 UTC (15 years, 11 months ago) by mostafa
Branches: MAIN
CVS tags: HEAD
Beautified source. Removed dependency to ev_UnixToolbar.cpp

<HTML>
<H1> WordProcessor Plug-in </H1>

<p> This sample invokes a word processor plug-in.
Click the buttons, to change the text attributes.
<HR>

<center>

<EMBED type=application/msword name="wordp" width=750 height=300>

<script>
function New()
{
document.wordp.nsIWPPluginInstance.New();
}
function OpenByName( str, type )
{
var result = document.wordp.nsIWPPluginInstance.OpenByName( str, type );
}
function Save()
{
document.wordp.nsIWPPluginInstance.Save();
}
function SaveAs()
{
document.wordp.nsIWPPluginInstance.SaveAs();
}
function SaveByName( str )
{
document.wordp.nsIWPPluginInstance.SaveByName( str );
}
function ToggleBold()
{
document.wordp.nsIWPPluginInstance.ToggleBold();
}
function ToggleItalic()
{
document.wordp.nsIWPPluginInstance.ToggleItalic();
}
function ToggleUline()
{
document.wordp.nsIWPPluginInstance.ToggleUline();
}
function ChooseFont()
{
document.wordp.nsIWPPluginInstance.ChooseFont();
}
function SpellCheck()
{
document.wordp.nsIWPPluginInstance.SpellCheck();
}
function InsertImage()
{
document.wordp.nsIWPPluginInstance.InsertImage();
}
function SetStyle(style)
{
document.wordp.nsIWPPluginInstance.SetStyle(style);
}
function SetAlignment(alignment)
{
document.wordp.nsIWPPluginInstance.SetAlignment(alignment);
}
function ToggleBullets()
{
document.wordp.nsIWPPluginInstance.ToggleBullets();
}
function IncreaseIndent()
{
document.wordp.nsIWPPluginInstance.IncreaseIndent();
}
function DecreaseIndent()
{
document.wordp.nsIWPPluginInstance.DecreaseIndent();
}
function GetCurrentDocument()
{
var result = document.wordp.nsIWPPluginInstance.GetCurrentDocument();
alert( result );
}
function IsDocumentModified()
{
var result = document.wordp.nsIWPPluginInstance.IsDocumentModified();
alert( result );
}
function SetColor(col)
{
document.wordp.nsIWPPluginInstance.SetColor(col);
}
function GetAttribute( attr )
{
var result = document.wordp.nsIWPPluginInstance.GetAttribute( attr );
alert( result );
}
function GetAlignment()
{
var result = document.wordp.nsIWPPluginInstance.GetAlignment();
alert( result );
}
function IsList()
{
var result = document.wordp.nsIWPPluginInstance.IsList();
alert( result );
}
function GetFontList()
{
var result = document.wordp.nsIWPPluginInstance.GetFontList();
alert( result );
}
function GetRecentList()
{
var result = document.wordp.nsIWPPluginInstance.GetRecentList();
alert( result );
}
function SetZoomPercent( zoomval )
{
document.wordp.nsIWPPluginInstance.SetZoom( zoomval );
}
function SetFont(font)
{
document.wordp.nsIWPPluginInstance.SetFont(font);
}
function ToggleNumbers()
{
document.wordp.nsIWPPluginInstance.ToggleNumbers();
}
function InsertImageFromFile( str )
{
var result = document.wordp.nsIWPPluginInstance.InsertImageFromFile( str );
}
function SetFontSize(fontsize)
{
document.wordp.nsIWPPluginInstance.SetFontSize(fontsize);
}
function SetTabStop(tabstop)
{
document.wordp.nsIWPPluginInstance.SetTabStop(tabstop);
}
function SetBGColor(col)
{
document.wordp.nsIWPPluginInstance.SetBGColor(col);
}
function SetColumns(columns)
{
document.wordp.nsIWPPluginInstance.SetColumns(columns);
}
function EditHeader()
{
document.wordp.nsIWPPluginInstance.EditHeader();
}
function EditFooter()
{
document.wordp.nsIWPPluginInstance.EditFooter();
}
function Undo()
{
document.wordp.nsIWPPluginInstance.Undo();
}
function Redo()
{
document.wordp.nsIWPPluginInstance.Redo();
}
function SaveAsFileType( str, type )
{
document.wordp.nsIWPPluginInstance.SaveAsFileType( str, type );
}
function SetPortrait( val )
{
document.wordp.nsIWPPluginInstance.SetPortrait( val );
}
function SetPrintScale( scale )
{
document.wordp.nsIWPPluginInstance.SetPrintScale( scale );
}
function SetPaperSize( papersize )
{
document.wordp.nsIWPPluginInstance.SetPaperSize( papersize );
}
function SetMargins( left,right,top,bottom,footer,header )
{
document.wordp.nsIWPPluginInstance.SetMargins( left,right,top,bottom,footer,header );
}
function PrintToFile()
{
document.wordp.nsIWPPluginInstance.DoCommand("print");
}
</script>

<form>
<input	type=button value="New" onclick='New()' >
<input	type=button value="OpenByName" onclick='OpenByName("/home/mostafah/1.abw", "auto" )' >
<input	type=button value="Save" onclick='Save()' >
<input	type=button value="SaveAs" onclick='SaveAs()' >
<input	type=button value="SaveAsFileType" onclick='SaveAsFileType("/home/mostafah/1.html", "html" )' >
</BR>
<input	type=button value="Toggle Bold" onclick='ToggleBold()' >
<input	type=button value="Toggle Italic" onclick='ToggleItalic()' >
<input	type=button value="Toggle Underline" onclick='ToggleUline()' >
<input	type=button value="Choose Font" onclick='ChooseFont()' >
</BR>
<input	type=button value="Spell Check" onclick='SpellCheck()' >
<input	type=button value="Insert Image" onclick='InsertImage()' >
</BR>
<input	type=button value="Normal" onclick='SetStyle(0)' >
<input	type=button value="Heading 1" onclick='SetStyle(1)' >
<input	type=button value="Heading 2" onclick='SetStyle(2)' >
<input	type=button value="Heading 3" onclick='SetStyle(3)' >
</BR>
<input	type=button value="Left" onclick='SetAlignment(0)' >
<input	type=button value="Right" onclick='SetAlignment(1)' >
<input	type=button value="Center" onclick='SetAlignment(2)' >
<input	type=button value="Justify" onclick='SetAlignment(3)' >
</BR>
<input	type=button value="ToggleBullets" onclick='ToggleBullets()' >
<input	type=button value="IncreaseIndent" onclick='IncreaseIndent()' >
<input	type=button value="DecreaseIndent" onclick='DecreaseIndent()' >
</BR>
<input	type=button value="GetDocName" onclick='GetCurrentDocument()' >
<input	type=button value="IsModified" onclick='IsDocumentModified()' >
<input	type=button value="SetColor" onclick='SetColor("ff0000")' >
</BR>
<input	type=button value="GetFontName" onclick='GetAttribute("font-family")' >
<input	type=button value="GetFontSize" onclick='GetAttribute("font-size")' >
<input	type=button value="GetFontWeight" onclick='GetAttribute("font-weight")' >
<input	type=button value="GetFontStyle" onclick='GetAttribute("font-style")' >
<input	type=button value="GetFontColor" onclick='GetAttribute("color")' >
<input	type=button value="GetDecoration" onclick='GetAttribute("text-decoration")' >
<input	type=button value="GetAlignment" onclick='GetAlignment()' >
<input	type=button value="IsBulleted" onclick='IsList()' >
<input	type=button value="GetFontList" onclick='GetFontList()' >
</BR>
<input	type=button value="GetRecentList" onclick='GetRecentList()' >
<input	type=button value="SetZoomPercent" onclick='SetZoomPercent(200)' >
</BR>
<input	type=button value="SetFont" onclick='SetFont("Courier")' >
<input	type=button value="ToggleNumbers" onclick='ToggleNumbers()' >
<input	type=button value="SetFontSize" onclick='SetFontSize("18pt")' >
<input	type=button value="InsertPic" onclick='InsertImageFromFile("tst.png")' >
</BR>
<input	type=button value="SetTabStop" onclick='SetTabStop("2.0in")' >
<input	type=button value="SetBGColor" onclick='SetBGColor("0000ff")' >
<input	type=button value="SetColumns" onclick='SetColumns("3")' >
<input	type=button value="EditHeader" onclick='EditHeader()' >
<input	type=button value="EditFooter" onclick='EditFooter()' >
<input	type=button value="Undo" onclick='Undo()' >
<input	type=button value="Redo" onclick='Redo()' >
</BR>
<input	type=button value="SetPortrait" onclick='SetPortrait(false)' >
<input	type=button value="SetPrintScale" onclick='SetPrintScale( 50 )' >
<input	type=button value="SetPaperSize" onclick='SetPaperSize( "B6" )' >
<input	type=button value="SetMargins" onclick='SetMargins( 3.1,3.2,3.3,3.4,1.5,1.6 )' >
<input	type=button value="Print" onclick='PrintToFile()' >
</form>
</center>

<HR>

</HTML>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>