Files
help/source/text/sbasic/shared/03/lib_ScriptForge.xhp
Jean-Pierre Ledure 66646a128d ScriptForge - new sf_contextmenu.xhp help page
References in
  - basic tree page (sbasic.tree)
  - SF table of content (sf_toc)
  - make files
have been added.

Change-Id: Idade4f50d6eec04a2820a13bcde6f09489d72629
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/196575
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2026-01-06 15:45:47 +01:00

272 lines
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<meta>
<topic id="toolsbasiclibrary" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">ScriptForge Libraries</title>
<filename>/text/sbasic/shared/03/lib_ScriptForge.xhp</filename>
</topic>
</meta>
<body>
<h1 id="hd_id31529004750471" xml-lang="en-US"><variable id="ScriptForge_lib"><link href="text/sbasic/shared/03/lib_ScriptForge.xhp">The <literal>ScriptForge</literal> Library</link></variable></h1>
<bookmark xml-lang="en-US" branch="index" id="bm_id491529070339774">
<bookmark_value>BASIC ScriptForge library</bookmark_value>
<bookmark_value>Python scriptforge module</bookmark_value>
</bookmark>
<section id="howtoget">
<embed href="text/sbasic/shared/00000003.xhp#basiclibhowtoget"/>
</section>
<paragraph role="paragraph" id="par_id681619700336879">ScriptForge libraries build up an extensible collection of macro scripting resources for %PRODUCTNAME to be invoked from Basic macros or Python scripts.</paragraph>
<section id="importLibs">
<note id="par_id901528999850603">&#8226; Basic macros require to load <literal>ScriptForge</literal> library using the following statement:<br/><literal>GlobalScope.BasicLibraries.loadLibrary("ScriptForge")</literal><br/><br/>&#8226; Python scripts require an import from <literal>scriptforge</literal> module:<br/><literal>from scriptforge import CreateScriptService</literal>
</note>
</section>
<tip id="par_id1001623412767893">To learn more about how to create and execute Python scripts using the <literal>ScriptForge</literal> library, read the help page <link href="text/sbasic/shared/03/sf_intro.xhp">Creating Python Scripts with ScriptForge</link>.</tip>
<h2 id="hd_id781637256119733">Invoking ScriptForge services</h2>
<paragraph role="paragraph" id="par_id781606153472028">The described modules and classes are invoked from user scripts as "Services". A generic constructor of those services has been designed for that purpose for each language.</paragraph>
<paragraph role="paragraph" id="par_id871637256506167">The <literal>Dispose</literal> method is available in all services and should be called to free up resources after usage:</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id901619770181787">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id201606153529501">Set oSvc = CreateScriptService("servicename"[, arg0, arg1, ...])</paragraph>
<paragraph role="bascode" localize="false" id="bas_id701637256465858">' ...</paragraph>
<paragraph role="bascode" localize="false" id="bas_id851637256466244">oSvc.Dispose()</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id701619701322002">from scriptforge import CreateScriptService</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id531619701322249">svc = CreateScriptService('servicename'[, arg0, arg1, ...])</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id271637256185236"># ...</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id501637256192213">svc.Dispose()</paragraph>
</pycode>
<h2 id="hd_id851613836643580">Services provided by the ScriptForge library</h2>
<table id="tab_id311613838858931" class="sf_table">
<tablehead>
<tablerow>
<tablecell>
<paragraph id="par_id131613838858931" role="tablehead">Category</paragraph>
</tablecell>
<tablecell colspan="3">
<paragraph id="par_id441613838858931" role="tablehead">Services</paragraph>
</tablecell>
</tablerow>
</tablehead>
<tablerow>
<tablecell>
<paragraph id="par_id851613847558931" role="tablecontent">%PRODUCTNAME Basic</paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="par_id581613836728425">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Array">Array</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Dictionary">Dictionary</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="par_id731613840022120">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Exception">Exception</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#FileSystem">FileSystem</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id701643305576028" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#String">String</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#TextStream">TextStream</link><br/>
</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id131613838825831" role="tablecontent">Document Content</paragraph>
</tablecell>
<tablecell>
<paragraph role="paragraph" localize="false" id="par_id771613836902464">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Base">Base</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Calc">Calc</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Chart">Chart</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id441543838858931" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Database">Database</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Dataset">Dataset</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Datasheet">Datasheet</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id701643305576137" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Document">Document</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#FormDocument">FormDocument</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Writer">Writer</link><br/>
</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id131613947858931" role="tablecontent">User Interface</paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="par_id481613837033056">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#ContextMenu">ContextMenu</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Dialog">Dialog</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#DialogControl">DialogControl</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Form">Form</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id441613885558931" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#FormControl">FormControl</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Menu">Menu</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#PopupMenu">PopupMenu</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id701643305576632" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Toolbar">Toolbar</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#ToolbarButton">ToolbarButton</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#UI">UI</link><br/>
</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id131613866258931" role="tablecontent">Utilities</paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="par_id461613837133275">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Basic">Basic</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#L10N">L10N</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Platform">Platform</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id441613723858931" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Region">Region</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Services">Services</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Session">Session</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id701643305572058" localize="false" role="tablecontent">
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Timer">Timer</link><br/>
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp#UnitTest">UnitTest</link><br/><br/>
</paragraph>
</tablecell>
</tablerow>
</table>
<section id="Array">
<embed href="text/sbasic/shared/03/sf_array.xhp#abstract"/>
</section>
<section id="Base">
<embed href="text/sbasic/shared/03/sf_base.xhp#abstract"/>
</section>
<section id="Basic">
<embed href="text/sbasic/shared/03/sf_basic.xhp#abstract"/>
</section>
<section id="Calc">
<embed href="text/sbasic/shared/03/sf_calc.xhp#abstract"/>
</section>
<section id="Chart">
<embed href="text/sbasic/shared/03/sf_chart.xhp#abstract"/>
</section>
<section id="ContextMenu">
<embed href="text/sbasic/shared/03/sf_contextmenu.xhp#abstract"/>
</section>
<section id="Database">
<embed href="text/sbasic/shared/03/sf_database.xhp#abstract"/>
</section>
<section id="Dataset">
<embed href="text/sbasic/shared/03/sf_dataset.xhp#abstract"/>
</section>
<section id="Datasheet">
<embed href="text/sbasic/shared/03/sf_datasheet.xhp#abstract"/>
</section>
<section id="Dialog">
<embed href="text/sbasic/shared/03/sf_dialog.xhp#abstract"/>
</section>
<section id="DialogControl">
<embed href="text/sbasic/shared/03/sf_dialogcontrol.xhp#abstract"/>
</section>
<section id="Dictionary">
<embed href="text/sbasic/shared/03/sf_dictionary.xhp#abstract"/>
</section>
<section id="Document">
<embed href="text/sbasic/shared/03/sf_document.xhp#abstract"/>
</section>
<section id="Exception">
<embed href="text/sbasic/shared/03/sf_exception.xhp#abstract"/>
</section>
<section id="FileSystem">
<embed href="text/sbasic/shared/03/sf_filesystem.xhp#abstract"/>
</section>
<section id="Form">
<embed href="text/sbasic/shared/03/sf_form.xhp#abstract"/>
</section>
<section id="FormControl">
<embed href="text/sbasic/shared/03/sf_formcontrol.xhp#abstract"/>
</section>
<section id="FormDocument">
<embed href="text/sbasic/shared/03/sf_formdocument.xhp#abstract"/>
</section>
<section id="L10N">
<embed href="text/sbasic/shared/03/sf_l10n.xhp#abstract"/>
</section>
<section id="Menu">
<embed href="text/sbasic/shared/03/sf_menu.xhp#abstract"/>
</section>
<section id="Platform">
<embed href="text/sbasic/shared/03/sf_platform.xhp#abstract"/>
</section>
<section id="PopupMenu">
<embed href="text/sbasic/shared/03/sf_popupmenu.xhp#abstract"/>
</section>
<section id="Region">
<embed href="text/sbasic/shared/03/sf_region.xhp#abstract"/>
</section>
<section id="Services">
<embed href="text/sbasic/shared/03/sf_services.xhp#abstract"/>
</section>
<section id="Session">
<embed href="text/sbasic/shared/03/sf_session.xhp#abstract"/>
</section>
<section id="String">
<embed href="text/sbasic/shared/03/sf_string.xhp#abstract"/>
</section>
<section id="TextStream">
<embed href="text/sbasic/shared/03/sf_textstream.xhp#abstract"/>
</section>
<section id="Timer">
<embed href="text/sbasic/shared/03/sf_timer.xhp#abstract"/>
</section>
<section id="Toolbar">
<embed href="text/sbasic/shared/03/sf_toolbar.xhp#abstract"/>
</section>
<section id="ToolbarButton">
<embed href="text/sbasic/shared/03/sf_toolbarbutton.xhp#abstract"/>
</section>
<section id="UI">
<embed href="text/sbasic/shared/03/sf_ui.xhp#abstract"/>
</section>
<section id="UnitTest">
<embed href="text/sbasic/shared/03/sf_unittest.xhp#abstract"/>
</section>
<section id="Writer">
<embed href="text/sbasic/shared/03/sf_writer.xhp#abstract"/>
</section>
<comment>Restricted use for SF_Root, SF_Utils modules as well as internal methods</comment>
<paragraph role="paragraph" id="par_id331608220104798"><emph>Note:</emph> Other <literal>ScriptForge</literal> undescribed modules are reserved for internal use. Their content is subject to change without notice.</paragraph>
<section id="SF_InternalUse">
<warning id="par_id851506659675843">All <literal>ScriptForge</literal> Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros or Python scripts.</warning>
</section>
</body>
</helpdocument>