集成OpenOffice替换为LibreOffice

This commit is contained in:
陈精华
2021-06-23 10:26:22 +08:00
parent 8a1eebb9b0
commit 79341b2c8e
14724 changed files with 2184695 additions and 551131 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="SF_Platform" script:language="StarBasic" script:moduleType="normal">REM =======================================================================================================================
REM === The ScriptForge library and its associated libraries are part of the LibreOffice project. ===
REM === Full documentation is available on https://help.libreoffice.org/ ===
REM =======================================================================================================================
Option Compatible
Option Explicit
&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;
&apos;&apos;&apos; SF_Platform
&apos;&apos;&apos; ===========
&apos;&apos;&apos; Singleton class implementing the &quot;ScriptForge.Platform&quot; service
&apos;&apos;&apos; Implemented as a usual Basic module
&apos;&apos;&apos;
&apos;&apos;&apos; A collection of properties about the execution environment:
&apos;&apos;&apos; - HW platform
&apos;&apos;&apos; - Operating System
&apos;&apos;&apos; - current user
&apos;&apos;&apos; - LibreOffice version
&apos;&apos;&apos;
&apos;&apos;&apos; Service invocation example:
&apos;&apos;&apos; Dim platform As Variant
&apos;&apos;&apos; platform = CreateScriptService(&quot;Platform&quot;)
&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;
REM ================================================================== EXCEPTIONS
REM ============================================================ MODULE CONSTANTS
REM ===================================================== CONSTRUCTOR/DESTRUCTOR
REM -----------------------------------------------------------------------------
Public Function Dispose() As Variant
Set Dispose = Nothing
End Function &apos; ScriptForge.SF_Array Explicit destructor
REM ================================================================== PROPERTIES
REM -----------------------------------------------------------------------------
Property Get Architecture() As String
&apos;&apos;&apos; Returns the actual bit architecture
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.Architecture &apos; 64bit
Architecture = _PropertyGet(&quot;Architecture&quot;)
End Property &apos; ScriptForge.SF_Platform.Architecture (get)
REM -----------------------------------------------------------------------------
Property Get ComputerName() As String
&apos;&apos;&apos; Returns the computer&apos;s network name
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.ComputerName
ComputerName = _PropertyGet(&quot;ComputerName&quot;)
End Property &apos; ScriptForge.SF_Platform.ComputerName (get)
REM -----------------------------------------------------------------------------
Property Get CPUCount() As Integer
&apos;&apos;&apos; Returns the number of Central Processor Units
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.CPUCount &apos; 4
CPUCount = _PropertyGet(&quot;CPUCount&quot;)
End Property &apos; ScriptForge.SF_Platform.CPUCount (get)
REM -----------------------------------------------------------------------------
Property Get CurrentUser() As String
&apos;&apos;&apos; Returns the name of logged in user
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.CurrentUser
CurrentUser = _PropertyGet(&quot;CurrentUser&quot;)
End Property &apos; ScriptForge.SF_Platform.CurrentUser (get)
REM -----------------------------------------------------------------------------
Property Get Machine() As String
&apos;&apos;&apos; Returns the machine type like &apos;i386&apos; or &apos;x86_64&apos;
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.Machine
Machine = _PropertyGet(&quot;Machine&quot;)
End Property &apos; ScriptForge.SF_Platform.Machine (get)
REM -----------------------------------------------------------------------------
Property Get ObjectType As String
&apos;&apos;&apos; Only to enable object representation
ObjectType = &quot;SF_Platform&quot;
End Property &apos; ScriptForge.SF_Platform.ObjectType
REM -----------------------------------------------------------------------------
Property Get ServiceName As String
&apos;&apos;&apos; Internal use
ServiceName = &quot;ScriptForge.Platform&quot;
End Property &apos; ScriptForge.SF_Platform.ServiceName
REM -----------------------------------------------------------------------------
Property Get OfficeVersion() As String
&apos;&apos;&apos; Returns the office software version in the form &apos;LibreOffice w.x.y.z (The Document Foundation)&apos;
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.OfficeVersion
OfficeVersion = _PropertyGet(&quot;OfficeVersion&quot;)
End Property &apos; ScriptForge.SF_Platform.OfficeVersion (get)
REM -----------------------------------------------------------------------------
Property Get OSName() As String
&apos;&apos;&apos; Returns the name of the operating system like &apos;Linux&apos; or &apos;Windows&apos;
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.OSName
OSName = _PropertyGet(&quot;OSName&quot;)
End Property &apos; ScriptForge.SF_Platform.OSName (get)
REM -----------------------------------------------------------------------------
Property Get OSPlatform() As String
&apos;&apos;&apos; Returns a single string identifying the underlying platform with as much useful and human-readable information as possible
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.OSPlatform &apos; Linux-4.15.0-117-generic-x86_64-with-Ubuntu-18.04-bionic
OSPlatform = _PropertyGet(&quot;OSPlatform&quot;)
End Property &apos; ScriptForge.SF_Platform.OSPlatform (get)
REM -----------------------------------------------------------------------------
Property Get OSRelease() As String
&apos;&apos;&apos; Returns the operating system&apos;s release
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.OSRelease &apos; 4.15.0-117-generic
OSRelease = _PropertyGet(&quot;OSRelease&quot;)
End Property &apos; ScriptForge.SF_Platform.OSRelease (get)
REM -----------------------------------------------------------------------------
Property Get OSVersion() As String
&apos;&apos;&apos; Returns the name of the operating system build or version
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.OSVersion &apos; #118-Ubuntu SMP Fri Sep 4 20:02:41 UTC 2020
OSVersion = _PropertyGet(&quot;OSVersion&quot;)
End Property &apos; ScriptForge.SF_Platform.OSVersion (get)
REM -----------------------------------------------------------------------------
Property Get Processor() As String
&apos;&apos;&apos; Returns the (real) processor name, e.g. &apos;amdk6&apos;. Might return the same value as Machine
&apos;&apos;&apos; Example:
&apos;&apos;&apos; MsgBox platform.Processor
Processor = _PropertyGet(&quot;Processor&quot;)
End Property &apos; ScriptForge.SF_Platform.Processor (get)
REM ===================================================================== METHODS
REM -----------------------------------------------------------------------------
Public Function GetProperty(Optional ByVal PropertyName As Variant) As Variant
&apos;&apos;&apos; Return the actual value of the given property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; PropertyName: the name of the property as a string
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; The actual value of the property
&apos;&apos;&apos; If the property does not exist, returns Null
&apos;&apos;&apos; Exceptions:
&apos;&apos;&apos; ARGUMENTERROR The property does not exist
Const cstThisSub = &quot;Platform.GetProperty&quot;
Const cstSubArgs = &quot;&quot;
If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
GetProperty = Null
Check:
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
If Not SF_Utils._Validate(PropertyName, &quot;PropertyName&quot;, V_STRING, Properties()) Then GoTo Catch
End If
Try:
GetProperty = _PropertyGet(PropertyName)
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
Catch:
GoTo Finally
End Function &apos; ScriptForge.SF_Platform.GetProperty
REM -----------------------------------------------------------------------------
Public Function Methods() As Variant
&apos;&apos;&apos; Return the list of public methods of the Model service as an array
Methods = Array( _
)
End Function &apos; ScriptForge.SF_Platform.Methods
REM -----------------------------------------------------------------------------
Public Function Properties() As Variant
&apos;&apos;&apos; Return the list or properties of the Platform class as an array
Properties = Array( _
&quot;Architecture&quot; _
, &quot;ComputerName&quot; _
, &quot;CPUCount&quot; _
, &quot;CurrentUser&quot; _
, &quot;Machine&quot; _
, &quot;OfficeVersion&quot; _
, &quot;OSName&quot; _
, &quot;OSPlatform&quot; _
, &quot;OSRelease&quot; _
, &quot;OSVersion&quot; _
, &quot;Processor&quot; _
)
End Function &apos; ScriptForge.SF_Platform.Properties
REM =========================================================== PRIVATE FUNCTIONS
REM -----------------------------------------------------------------------------
Public Function _GetProductName() as String
&apos;&apos;&apos; Returns Office product and version numbers found in configuration registry
&apos;&apos;&apos; Derived from the Tools library
Dim oProdNameAccess as Object &apos; configmgr.RootAccess
Dim sProdName as String
Dim sVersion as String
Dim sVendor As String
On Local Error GoTo Catch &apos; Prevent any error
_GetProductName = &quot;&quot;
Try:
Set oProdNameAccess = SF_Utils._GetRegistryKeyContent(&quot;org.openoffice.Setup/Product&quot;)
sProdName = oProdNameAccess.ooName
sVersion = oProdNameAccess.ooSetupVersionAboutBox
sVendor = oProdNameAccess.ooVendor
_GetProductName = sProdName &amp; &quot; &quot; &amp; sVersion &amp; &quot; (&quot; &amp; sVendor &amp; &quot;)&quot;
Finally:
Exit Function
Catch:
GoTo Finally
End Function &apos; ScriptForge.SF_Platform._GetProductName
REM -----------------------------------------------------------------------------
Private Function _PropertyGet(Optional ByVal psProperty As String) As Variant
&apos;&apos;&apos; Return the value of the named property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; psProperty: the name of the property
Dim sOSName As String &apos; Operating system
Const cstPyHelper = &quot;$&quot; &amp; &quot;_SF_Platform&quot;
Dim cstThisSub As String
Const cstSubArgs = &quot;&quot;
cstThisSub = &quot;Platform.get&quot; &amp; psProperty
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Select Case psProperty
Case &quot;Architecture&quot;, &quot;ComputerName&quot;, &quot;CPUCount&quot;, &quot;CurrentUser&quot;, &quot;Machine&quot; _
, &quot;OSPlatform&quot;, &quot;OSRelease&quot;, &quot;OSVersion&quot;, &quot;Processor&quot;
With ScriptForge.SF_Session
_PropertyGet = .ExecutePythonScript(.SCRIPTISSHARED, _SF_.PythonHelper &amp; cstPyHelper, psProperty)
End With
Case &quot;OfficeVersion&quot;
_PropertyGet = _GetProductName()
Case &quot;OSName&quot;
&apos; Calc INFO function preferred to Python script to avoid ScriptForge initialization risks when Python is not installed
sOSName = _SF_.OSName
If sOSName = &quot;&quot; Then
sOSName = SF_Session.ExecuteCalcFunction(&quot;INFO&quot;, &quot;system&quot;)
Select Case sOSName
Case &quot;WNT&quot; : sOSName = &quot;Windows&quot;
Case &quot;MACOSX&quot; : sOSName = &quot;macOS&quot;
Case &quot;LINUX&quot; : sOSName = &quot;Linux&quot;
Case &quot;SOLARIS&quot; : sOSName = &quot;Solaris&quot;
Case Else : sOSName = SF_String.Capitalize(sOSName)
End Select
EndIf
_PropertyGet = sOSName
Case Else
_PropertyGet = Null
End Select
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Platform._PropertyGet
REM ============================================ END OF SCRIPTFORGE.SF_PLATFORM
</script:module>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,463 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="SF_Timer" script:language="StarBasic" script:moduleType="normal">REM =======================================================================================================================
REM === The ScriptForge library and its associated libraries are part of the LibreOffice project. ===
REM === Full documentation is available on https://help.libreoffice.org/ ===
REM =======================================================================================================================
Option Compatible
Option ClassModule
Option Explicit
&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;
&apos;&apos;&apos; SF_Timer
&apos;&apos;&apos; ========
&apos;&apos;&apos; Class for management of scripts execution performance
&apos;&apos;&apos; A Timer measures durations. It can be suspended, resumed, restarted
&apos;&apos;&apos; Duration properties are expressed in seconds with a precision of 3 decimal digits
&apos;&apos;&apos;
&apos;&apos;&apos; Service invocation example:
&apos;&apos;&apos; Dim myTimer As Variant
&apos;&apos;&apos; myTimer = CreateScriptService(&quot;Timer&quot;)
&apos;&apos;&apos; myTimer = CreateScriptService(&quot;Timer&quot;, True) &apos; =&gt; To start timer immediately
&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;
REM ================================================================== EXCEPTIONS
REM ============================================================= PRIVATE MEMBERS
Private [Me] As Object
Private [_Parent] As Object
Private ObjectType As String &apos; Must be &quot;TIMER&quot;
Private ServiceName As String
Private _TimerStatus As Integer &apos; inactive, started, suspended or stopped
Private _StartTime As Double &apos; Moment when timer started, restarted
Private _EndTime As Double &apos; Moment when timer stopped
Private _SuspendTime As Double &apos; Moment when timer suspended
Private _SuspendDuration As Double &apos; Duration of suspended status as a difference of times
REM ============================================================ MODULE CONSTANTS
Private Const STATUSINACTIVE = 0
Private Const STATUSSTARTED = 1
Private Const STATUSSUSPENDED = 2
Private Const STATUSSTOPPED = 3
Private Const DSECOND As Double = 1 / (24 * 60 * 60) &apos; Duration of 1 second as compared to 1.0 = 1 day
REM ===================================================== CONSTRUCTOR/DESTRUCTOR
REM -----------------------------------------------------------------------------
Private Sub Class_Initialize()
Set [Me] = Nothing
Set [_Parent] = Nothing
ObjectType = &quot;TIMER&quot;
ServiceName = &quot;ScriptForge.Timer&quot;
_TimerStatus = STATUSINACTIVE
_StartTime = 0
_EndTime = 0
_SuspendTime = 0
_SuspendDuration = 0
End Sub &apos; ScriptForge.SF_Timer Constructor
REM -----------------------------------------------------------------------------
Private Sub Class_Terminate()
Call Class_Initialize()
End Sub &apos; ScriptForge.SF_Timer Destructor
REM -----------------------------------------------------------------------------
Public Function Dispose() As Variant
Call Class_Terminate()
Set Dispose = Nothing
End Function &apos; ScriptForge.SF_Timer Explicit destructor
REM ================================================================== PROPERTIES
REM -----------------------------------------------------------------------------
Public Function Duration() As Double
&apos;&apos;&apos; Returns the actual (out of suspensions) time elapsed since start or between start and stop
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; A Double expressing the duration in seconds
&apos;&apos;&apos; Example:
&apos;&apos;&apos; myTimer.Duration returns 1.234 (1 sec, 234 ms)
Duration = _PropertyGet(&quot;Duration&quot;)
End Function &apos; ScriptForge.SF_Timer.Duration
REM -----------------------------------------------------------------------------
Property Get IsStarted() As Boolean
&apos;&apos;&apos; Returns True if timer is started or suspended
&apos;&apos;&apos; Example:
&apos;&apos;&apos; myTimer.IsStarted
IsStarted = _PropertyGet(&quot;IsStarted&quot;)
End Property &apos; ScriptForge.SF_Timer.IsStarted
REM -----------------------------------------------------------------------------
Property Get IsSuspended() As Boolean
&apos;&apos;&apos; Returns True if timer is started and suspended
&apos;&apos;&apos; Example:
&apos;&apos;&apos; myTimer.IsSuspended
IsSuspended = _PropertyGet(&quot;IsSuspended&quot;)
End Property &apos; ScriptForge.SF_Timer.IsSuspended
REM -----------------------------------------------------------------------------
Public Function SuspendDuration() As Double
&apos;&apos;&apos; Returns the actual time elapsed while suspended since start or between start and stop
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; A Double expressing the duration in seconds
&apos;&apos;&apos; Example:
&apos;&apos;&apos; myTimer.SuspendDuration returns 1.234 (1 sec, 234 ms)
SuspendDuration = _PropertyGet(&quot;SuspendDuration&quot;)
End Function &apos; ScriptForge.SF_Timer.SuspendDuration
REM -----------------------------------------------------------------------------
Public Function TotalDuration() As Double
&apos;&apos;&apos; Returns the actual time elapsed (including suspensions) since start or between start and stop
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; A Double expressing the duration in seconds
&apos;&apos;&apos; Example:
&apos;&apos;&apos; myTimer.TotalDuration returns 1.234 (1 sec, 234 ms)
TotalDuration = _PropertyGet(&quot;TotalDuration&quot;)
End Function &apos; ScriptForge.SF_Timer.TotalDuration
REM ===================================================================== METHODS
REM -----------------------------------------------------------------------------
Public Function Continue() As Boolean
&apos;&apos;&apos; Halt suspension of a running timer
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; True if successful, False if the timer is not suspended
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myTimer.Continue()
Const cstThisSub = &quot;Timer.Continue&quot;
Const cstSubArgs = &quot;&quot;
Check:
Continue = False
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Try:
If _TimerStatus = STATUSSUSPENDED Then
_TimerStatus = STATUSSTARTED
_SuspendDuration = _SuspendDuration + _Now() - _SuspendTime
_SuspendTime = 0
Continue = True
End If
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Timer.Continue
REM -----------------------------------------------------------------------------
Public Function GetProperty(Optional ByVal PropertyName As Variant) As Variant
&apos;&apos;&apos; Return the actual value of the given property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; PropertyName: the name of the property as a string
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; The actual value of the property
&apos;&apos;&apos; Exceptions
&apos;&apos;&apos; ARGUMENTERROR The property does not exist
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myTimer.GetProperty(&quot;Duration&quot;)
Const cstThisSub = &quot;Timer.GetProperty&quot;
Const cstSubArgs = &quot;PropertyName&quot;
If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
GetProperty = Null
Check:
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
If Not SF_Utils._Validate(PropertyName, &quot;PropertyName&quot;, V_STRING, Properties()) Then GoTo Catch
End If
Try:
GetProperty = _PropertyGet(PropertyName)
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
Catch:
GoTo Finally
End Function &apos; ScriptForge.SF_Timer.Properties
REM -----------------------------------------------------------------------------
Public Function Methods() As Variant
&apos;&apos;&apos; Return the list or methods of the Timer class as an array
Methods = Array( _
&quot;Continue&quot; _
, &quot;Restart&quot; _
, &quot;Start&quot; _
, &quot;Suspend&quot; _
, &quot;Terminate&quot; _
)
End Function &apos; ScriptForge.SF_Timer.Methods
REM -----------------------------------------------------------------------------
Public Function Properties() As Variant
&apos;&apos;&apos; Return the list or properties of the Timer class as an array
Properties = Array( _
&quot;Duration&quot; _
, &quot;IsStarted&quot; _
, &quot;IsSuspended&quot; _
, &quot;SuspendDuration&quot; _
, &quot;TotalDuration&quot; _
)
End Function &apos; ScriptForge.SF_Timer.Properties
REM -----------------------------------------------------------------------------
Public Function Restart() As Boolean
&apos;&apos;&apos; Terminate the timer and restart a new clean timer
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; True if successful, False if the timer is inactive
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myTimer.Restart()
Const cstThisSub = &quot;Timer.Restart&quot;
Const cstSubArgs = &quot;&quot;
Check:
Restart = False
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Try:
If _TimerStatus &lt;&gt; STATUSINACTIVE Then
If _TimerStatus &lt;&gt; STATUSSTOPPED Then Terminate()
Start()
Restart = True
End If
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Timer.Restart
REM -----------------------------------------------------------------------------
Public Function SetProperty(Optional ByVal PropertyName As Variant _
, Optional ByRef Value As Variant _
) As Boolean
&apos;&apos;&apos; Set a new value to the given property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; PropertyName: the name of the property as a string
&apos;&apos;&apos; Value: its new value
&apos;&apos;&apos; Exceptions
&apos;&apos;&apos; ARGUMENTERROR The property does not exist
Const cstThisSub = &quot;Timer.SetProperty&quot;
Const cstSubArgs = &quot;PropertyName, Value&quot;
If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
SetProperty = False
Check:
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
If Not SF_Utils._Validate(PropertyName, &quot;PropertyName&quot;, V_STRING, Properties()) Then GoTo Catch
End If
Try:
Select Case UCase(PropertyName)
Case Else
End Select
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
Catch:
GoTo Finally
End Function &apos; ScriptForge.SF_Timer.SetProperty
REM -----------------------------------------------------------------------------
Public Function Start() As Boolean
&apos;&apos;&apos; Start a new clean timer
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; True if successful, False if the timer is already started
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myTimer.Start()
Const cstThisSub = &quot;Timer.Start&quot;
Const cstSubArgs = &quot;&quot;
Check:
Start = False
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Try:
If _TimerStatus = STATUSINACTIVE Or _TimerStatus = STATUSSTOPPED Then
_TimerStatus = STATUSSTARTED
_StartTime = _Now()
_EndTime = 0
_SuspendTime = 0
_SuspendDuration = 0
Start = True
End If
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Timer.Start
REM -----------------------------------------------------------------------------
Public Function Suspend() As Boolean
&apos;&apos;&apos; Suspend a running timer
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; True if successful, False if the timer is not started or already suspended
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myTimer.Suspend()
Const cstThisSub = &quot;Timer.Suspend&quot;
Const cstSubArgs = &quot;&quot;
Check:
Suspend = False
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Try:
If _TimerStatus = STATUSSTARTED Then
_TimerStatus = STATUSSUSPENDED
_SuspendTime = _Now()
Suspend = True
End If
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Timer.Suspend
REM -----------------------------------------------------------------------------
Public Function Terminate() As Boolean
&apos;&apos;&apos; Terminate a running timer
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; True if successful, False if the timer is neither started nor suspended
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myTimer.Terminate()
Const cstThisSub = &quot;Timer.Terminate&quot;
Const cstSubArgs = &quot;&quot;
Check:
Terminate = False
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Try:
If _TimerStatus = STATUSSTARTED Or _TimerStatus = STATUSSUSPENDED Then
If _TimerSTatus = STATUSSUSPENDED Then Continue()
_TimerStatus = STATUSSTOPPED
_EndTime = _Now()
Terminate = True
End If
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Timer.Terminate
REM =========================================================== PRIVATE FUNCTIONS
REM -----------------------------------------------------------------------------
Private Function _Now() As Double
&apos;&apos;&apos; Returns the current date and time
&apos;&apos;&apos; Uses the Calc NOW() function to get a higher precision than the usual Basic Now() function
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; The actual time as a number
&apos;&apos;&apos; The integer part represents the date, the decimal part represents the time
_Now = SF_Session.ExecuteCalcFunction(&quot;NOW&quot;)
End Function &apos; ScriptForge.SF_Timer._Now
REM -----------------------------------------------------------------------------
Private Function _PropertyGet(Optional ByVal psProperty As String)
&apos;&apos;&apos; Return the named property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; psProperty: the name of the property
Dim dDuration As Double &apos; Computed duration
Dim cstThisSub As String
Dim cstSubArgs As String
cstThisSub = &quot;Timer.get&quot; &amp; psProperty
cstSubArgs = &quot;&quot;
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Select Case UCase(psProperty)
Case UCase(&quot;Duration&quot;)
Select Case _TimerStatus
Case STATUSINACTIVE : dDuration = 0.0
Case STATUSSTARTED
dDuration = _Now() - _StartTime - _SuspendDuration
Case STATUSSUSPENDED
dDuration = _SuspendTime - _StartTime - _SuspendDuration
Case STATUSSTOPPED
dDuration = _EndTime - _StartTime - _SuspendDuration
End Select
_PropertyGet = Fix(dDuration * 1000 / DSECOND) / 1000
Case UCase(&quot;IsStarted&quot;)
_PropertyGet = ( _TimerStatus = STATUSSTARTED Or _TimerStatus = STATUSSUSPENDED )
Case UCase(&quot;IsSuspended&quot;)
_PropertyGet = ( _TimerStatus = STATUSSUSPENDED )
Case UCase(&quot;SuspendDuration&quot;)
Select Case _TimerStatus
Case STATUSINACTIVE : dDuration = 0.0
Case STATUSSTARTED, STATUSSTOPPED
dDuration = _SuspendDuration
Case STATUSSUSPENDED
dDuration = _Now() - _SuspendTime + _SuspendDuration
End Select
_PropertyGet = Fix(dDuration * 1000 / DSECOND) / 1000
Case UCase(&quot;TotalDuration&quot;)
Select Case _TimerStatus
Case STATUSINACTIVE : dDuration = 0.0
Case STATUSSTARTED, STATUSSUSPENDED
dDuration = _Now() - _StartTime
Case STATUSSTOPPED
dDuration = _EndTime - _StartTime
End Select
_PropertyGet = Fix(dDuration * 1000 / DSECOND) / 1000
End Select
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Timer._PropertyGet
REM -----------------------------------------------------------------------------
Private Function _Repr() As String
&apos;&apos;&apos; Convert the Timer instance to a readable string, typically for debugging purposes (DebugPrint ...)
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Return:
&apos;&apos;&apos; &quot;[Timer] Duration:xxx.yyy
Const cstTimer = &quot;[Timer] Duration: &quot;
Const cstMaxLength = 50 &apos; Maximum length for items
_Repr = cstTimer &amp; Replace(SF_Utils._Repr(Duration), &quot;.&quot;, &quot;&quot;&quot;&quot;)
End Function &apos; ScriptForge.SF_Timer._Repr
REM ============================================ END OF SCRIPTFORGE.SF_TIMER
</script:module>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="_CodingConventions" script:language="StarBasic" script:moduleType="normal">REM =======================================================================================================================
REM === The ScriptForge library and its associated libraries are part of the LibreOffice project. ===
REM === Full documentation is available on https://help.libreoffice.org/ ===
REM =======================================================================================================================
&apos;&apos;&apos;
&apos; Conventions used in the coding of the *ScriptForge* library
&apos; -----------------------------------------------------------
&apos;&apos;&apos;
&apos; Library and Modules
&apos; ===================
&apos; * Module names are all prefixed with &quot;SF_&quot;.
&apos; * The *Option Explicit* statement is mandatory in every module.
&apos; * The *Option Private Module* statement is recommended in internal modules.
&apos; * A standard header presenting the module/class is mandatory
&apos; * An end of file (eof) comment line is mandatory
&apos; * Every module lists the constants that are related to it and documented as return values, arguments, etc.
&apos; They are defined as *Global Const*.
&apos; The scope of global constants being limited to one single library, their invocation from user scripts shall be qualified.
&apos; * The Basic reserved words are *Proper-Cased*.
&apos;&apos;&apos;
&apos; Functions and Subroutines
&apos; =========================
&apos; * LibreOffice ignores the Private/Public attribute in Functions or Subs declarations.
&apos; Nevertheless the attribute must be present.
&apos; Rules to recognize their scope are:
&apos; * Public + name starts with a letter
&apos; The Sub/Function belongs to the official ScriptForge API.
&apos; As such it may be called from any user script.
&apos; * Public + name starts with an underscore &quot;_&quot;
&apos; The Sub/Function may be called only from within the ScriptForge library.
&apos; As such it MUST NOT be called from another library or from a user script,
&apos; as there is no guarantee about the arguments, the semantic or even the existence of that piece of code in a later release.
&apos; * Private - The Sub/Function name must start with an underscore &quot;_&quot;.
&apos; The Sub/Function may be called only from the module in which it is located.
&apos; * Functions and Subroutines belonging to the API (= &quot;standard&quot; functions/Subs) are defined in their module in alphabetical order.
&apos; For class modules, all the properties precede the methods which precede the events.
&apos; * Functions and Subroutines not belonging to the API are defined in their module in alphabetical order below the standard ones.
&apos; * The return value of a function is always declared explicitly.
&apos; * The parameters are always declared explicitly even if they&apos;re variants.
&apos; * The Function and Sub declarations start at the 1st column of the line.
&apos; * The End Function/Sub statement is followed by a comment reminding the name of the containing library.module and of the function or sub.
&apos; If the Function/Sub is declared for the first time or modified in a release &gt; initial public release, the actual release number is mentioned as well.
&apos;&apos;&apos;
&apos; Variable declarations
&apos; =====================
&apos; * Variable names use only alpha characters, the underscore and digits (no accented characters).
&apos; Exceptionally, names of private variables may be embraced with `[` and `]` if `Option Compatible` is present.
&apos; * The Global, Dim and Const statements always start in the first column of the line.
&apos; * The type (*Dim ... As ...*, *Function ... As ...*) is always declared explicitly, even if the type is Variant.
&apos; * Variables are *Proper-Cased*. They are always preceded by a lower-case letter indicating their type.
&apos; With next exception: variables i, j, k, l, m and n must be declared as integers or longs.
&apos; &gt; b Boolean
&apos; &gt; d Date
&apos; &gt; v Variant
&apos; &gt; o Object
&apos; &gt; i Integer
&apos; &gt; l Long
&apos; &gt; s String
&apos; Example:
&apos; Dim sValue As String
&apos; * Parameters are preceded by the letter *p* which itself precedes the single *typing letter*.
&apos; In official methods, to match their published documentation, the *p* and the *typing letter* may be omitted. Like in:
&apos; Private Function MyFunction(psValue As String) As Variant
&apos; Public Function MyOfficialFunction(Value As String) As Variant
&apos; * Global variables in the ScriptForge library are ALL preceded by an underscore &quot;_&quot; as NONE of them should be invoked from outside the library.
&apos; * Constant values with a local scope are *Proper-Cased* and preceded by the letters *cst*.
&apos; * Constants with a global scope are *UPPER-CASED*.
&apos; Example:
&apos; Global Const ACONSTANT = &quot;This is a global constant&quot;
&apos; Function MyFunction(pocControl As Object, piValue) As Variant
&apos; Dim iValue As Integer
&apos; Const cstMyConstant = 3
&apos;&apos;&apos;
&apos; Indentation
&apos; ===========
&apos; Code shall be indented with TAB characters.
&apos;&apos;&apos;
&apos; Goto/Gosub
&apos; ==========
&apos; The *GoSub* *Return* statement is forbidden.
&apos; The *GoTo* statement is forbidden.
&apos; However *GoTo* is highly recommended for *error* and *exception* handling.
&apos;&apos;&apos;
&apos; Comments (english only)
&apos; ========
&apos; * Every public routine should be documented with a python-like &quot;docstring&quot;:
&apos; 1. Role of Sub/Function
&apos; 2. List of arguments, mandatory/optional, role
&apos; 3. Returned value(s) type and meaning
&apos; 4. Examples when useful
&apos; 5. Eventual specific exception codes
&apos; * The &quot;docstring&quot; comments shall be marked by a triple (single) quote character at the beginning of the line
&apos; * Meaningful variables shall be declared one per line. Comment on same line.
&apos; * Comments about a code block should be left indented.
&apos; If it concerns only the next line, no indent required (may also be put at the end of the line).
&apos;&apos;&apos;
</script:module>

View File

@@ -0,0 +1,221 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="_ModuleModel" script:language="StarBasic" script:moduleType="normal">REM =======================================================================================================================
REM === The ScriptForge library and its associated libraries are part of the LibreOffice project. ===
REM === Full documentation is available on https://help.libreoffice.org/ ===
REM =======================================================================================================================
Option Compatible
Option ClassModule
&apos;Option Private Module
Option Explicit
&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;
&apos;&apos;&apos; ModuleModel (aka SF_Model)
&apos;&apos;&apos; ===========
&apos;&apos;&apos; Illustration of how the ScriptForge modules are structured
&apos;&apos;&apos; Copy and paste this code in an empty Basic module to start a new service
&apos;&apos;&apos; Comment in, comment out, erase what you want, but at the end respect the overall structure
&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;&apos;
REM ================================================================== EXCEPTIONS
&apos;&apos;&apos; FAKENEWSERROR
REM ============================================================= PRIVATE MEMBERS
Private [Me] As Object &apos; Should be initialized immediately after the New statement
&apos; Dim obj As Object : Set obj = New SF_Model
&apos; Set obj.[Me] = obj
Private [_Parent] As Object &apos; To keep trace of the instance having created a sub-instance
&apos; Set obj._Parent = [Me]
Private ObjectType As String &apos; Must be UNIQUE
REM ============================================================ MODULE CONSTANTS
Private Const SOMECONSTANT = 1
REM ====================================================== CONSTRUCTOR/DESTRUCTOR
REM -----------------------------------------------------------------------------
Private Sub Class_Initialize()
Set [Me] = Nothing
Set [_Parent] = Nothing
ObjectType = &quot;MODEL&quot;
End Sub &apos; ScriptForge.SF_Model Constructor
REM -----------------------------------------------------------------------------
Private Sub Class_Terminate()
Call Class_Initialize()
End Sub &apos; ScriptForge.SF_Model Destructor
REM -----------------------------------------------------------------------------
Public Function Dispose() As Variant
Call Class_Terminate()
Set Dispose = Nothing
End Function &apos; ScriptForge.SF_Model Explicit Destructor
REM ================================================================== PROPERTIES
REM -----------------------------------------------------------------------------
Property Get MyProperty() As Boolean
&apos;&apos;&apos; Returns True or False
&apos;&apos;&apos; Example:
&apos;&apos;&apos; myModel.MyProperty
MyProperty = _PropertyGet(&quot;MyProperty&quot;)
End Property &apos; ScriptForge.SF_Model.MyProperty
REM ===================================================================== METHODS
REM -----------------------------------------------------------------------------
Public Function GetProperty(Optional ByVal PropertyName As Variant) As Variant
&apos;&apos;&apos; Return the actual value of the given property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; PropertyName: the name of the property as a string
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; The actual value of the property
&apos;&apos;&apos; If the property does not exist, returns Null
&apos;&apos;&apos; Exceptions:
&apos;&apos;&apos; see the exceptions of the individual properties
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; myModel.GetProperty(&quot;MyProperty&quot;)
Const cstThisSub = &quot;Model.GetProperty&quot;
Const cstSubArgs = &quot;&quot;
If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
GetProperty = Null
Check:
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
If Not SF_Utils._Validate(PropertyName, &quot;PropertyName&quot;, V_STRING, Properties()) Then GoTo Catch
End If
Try:
GetProperty = _PropertyGet(PropertyName)
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
Catch:
GoTo Finally
End Function &apos; ScriptForge.SF_Model.GetProperty
REM -----------------------------------------------------------------------------
Public Function Methods() As Variant
&apos;&apos;&apos; Return the list of public methods of the Model service as an array
Methods = Array( _
&quot;MyFunction&quot; _
, &quot;etc&quot; _
)
End Function &apos; ScriptForge.SF_Model.Methods
REM -----------------------------------------------------------------------------
Public Function MyFunction(Optional ByVal Arg1 As Variant _
, Optional ByVal Arg2 As Variant _
) As Variant
&apos;&apos;&apos; Fictive function that concatenates Arg1 Arg2 times
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Arg1 String Text
&apos;&apos;&apos; Arg2 Numeric Number of times (default = 2)
&apos;&apos;&apos; Returns:
&apos;&apos;&apos; The new string
&apos;&apos;&apos; Exceptions:
&apos;&apos;&apos; FAKENEWSERROR
&apos;&apos;&apos; Examples:
&apos;&apos;&apos; MyFunction(&quot;value1&quot;) returns &quot;value1value1&quot;
Dim sOutput As String &apos; Output buffer
Dim i As Integer
Const cstThisSub = &quot;Model.myFunction&quot;
Const cstSubArgs = &quot;Arg1, [Arg2=2]&quot;
&apos; _ErrorHandling returns False when, for debugging, the standard error handling is preferred
If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
myFunction = &quot;&quot;
Check:
If IsMissing(Arg2) Then Arg2 = 2
&apos; _EnterFunction returns True when current method is invoked from a user script
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
&apos; Check Arg1 is a string and Arg2 is a number.
&apos; Validation rules for scalars and arrays are described in SF_Utils
If Not SF_Utils._Validate(Arg1, &quot;Arg1&quot;, V_STRING) Then GoTo Finally
If Not SF_Utils._Validate(Arg2, &quot;Arg2&quot;, V_NUMERIC) Then GoTo Finally
&apos; Fatal error ?
If Arg2 &lt; 0 Then GoTo CatchFake
End If
Try:
sOutput = &quot;&quot;
For i = 0 To Arg2
sOutput = sOutput &amp; Arg1
Next i
myFunction = sOutput
Finally:
&apos; _ExitFunction manages internal (On Local) errors
SF_Utils._ExitFunction(cstThisSub)
Exit Function
Catch:
GoTo Finally
CatchFake:
SF_Exception.RaiseFatal(&quot;FAKENEWSERROR&quot;, cstThisSub)
GoTo Finally
End Function &apos; ScriptForge.SF_Model.myFunction
REM -----------------------------------------------------------------------------
Public Function Properties() As Variant
&apos;&apos;&apos; Return the list or properties of the Model class as an array
Properties = Array( _
&quot;MyProperty&quot; _
, &quot;etc&quot; _
)
End Function &apos; ScriptForge.SF_Model.Properties
REM =========================================================== PRIVATE FUNCTIONS
REM -----------------------------------------------------------------------------
Private Function _PropertyGet(Optional ByVal psProperty As String) As Variant
&apos;&apos;&apos; Return the value of the named property
&apos;&apos;&apos; Args:
&apos;&apos;&apos; psProperty: the name of the property
Dim cstThisSub As String
Const cstSubArgs = &quot;&quot;
cstThisSub = &quot;SF_Model.get&quot; &amp; psProperty
SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
Select Case psProperty
Case &quot;MyProperty&quot;
_PropertyGet = TBD
Case Else
_PropertyGet = Null
End Select
Finally:
SF_Utils._ExitFunction(cstThisSub)
Exit Function
End Function &apos; ScriptForge.SF_Model._PropertyGet
REM -----------------------------------------------------------------------------
Private Function _Repr() As String
&apos;&apos;&apos; Convert the Model instance to a readable string, typically for debugging purposes (DebugPrint ...)
&apos;&apos;&apos; Args:
&apos;&apos;&apos; Return:
&apos;&apos;&apos; &quot;[MODEL]: A readable string&quot;
_Repr = &quot;[MODEL]: A readable string&quot;
End Function &apos; ScriptForge.SF_Model._Repr
REM ============================================ END OF SCRIPTFORGE.SF_MODEL
</script:module>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="__License" script:language="StarBasic" script:moduleType="normal">
&apos;&apos;&apos; Copyright 2019-2020 Jean-Pierre LEDURE, Jean-François NIFENECKER, Alain ROMEDENNE
REM =======================================================================================================================
REM === The ScriptForge library and its associated libraries are part of the LibreOffice project. ===
REM === Full documentation is available on https://help.libreoffice.org/ ===
REM =======================================================================================================================
&apos;&apos;&apos; ScriptForge is distributed in the hope that it will be useful,
&apos;&apos;&apos; but WITHOUT ANY WARRANTY; without even the implied warranty of
&apos;&apos;&apos; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
&apos;&apos;&apos; ScriptForge is free software; you can redistribute it and/or modify it under the terms of either (at your option):
&apos;&apos;&apos; 1) The Mozilla Public License, v. 2.0. If a copy of the MPL was not
&apos;&apos;&apos; distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/ .
&apos;&apos;&apos; 2) The GNU Lesser General Public License as published by
&apos;&apos;&apos; the Free Software Foundation, either version 3 of the License, or
&apos;&apos;&apos; (at your option) any later version. If a copy of the LGPL was not
&apos;&apos;&apos; distributed with this file, see http://www.gnu.org/licenses/ .
</script:module>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ScriptForge" library:readonly="false" library:passwordprotected="false">
<library:element library:name="dlgConsole"/>
<library:element library:name="dlgProgress"/>
</library:library>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="dlgConsole" dlg:left="114" dlg:top="32" dlg:width="321" dlg:height="239" dlg:closeable="true" dlg:moveable="true" dlg:title="ScriptForge">
<dlg:styles>
<dlg:style dlg:style-id="0" dlg:font-name="Courier New" dlg:font-stylename="Regular" dlg:font-family="modern"/>
</dlg:styles>
<dlg:bulletinboard>
<dlg:textfield dlg:style-id="0" dlg:id="ConsoleLines" dlg:tab-index="0" dlg:left="4" dlg:top="2" dlg:width="312" dlg:height="225" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true" dlg:readonly="true"/>
<dlg:button dlg:id="CloseNonModalButton" dlg:tab-index="2" dlg:left="265" dlg:top="228" dlg:width="50" dlg:height="10" dlg:default="true" dlg:value="Close">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ScriptForge.SF_Exception._CloseConsole?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="CloseModalButton" dlg:tab-index="1" dlg:left="265" dlg:top="228" dlg:width="50" dlg:height="10" dlg:default="true" dlg:value="Close" dlg:button-type="ok"/>
</dlg:bulletinboard>
</dlg:window>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="dlgProgress" dlg:left="180" dlg:top="90" dlg:width="275" dlg:height="37" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="ProgressText" dlg:tab-index="1" dlg:left="16" dlg:top="7" dlg:width="245" dlg:height="8" dlg:value="ProgressText" dlg:tabstop="true"/>
<dlg:progressmeter dlg:id="ProgressBar" dlg:tab-index="0" dlg:left="16" dlg:top="18" dlg:width="190" dlg:height="10" dlg:value="50"/>
<dlg:button dlg:id="CloseButton" dlg:tab-index="2" dlg:left="210" dlg:top="18" dlg:width="50" dlg:height="10" dlg:value="Close">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ScriptForge.SF_UI._CloseProgressBar?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ScriptForge" library:readonly="false" library:passwordprotected="false">
<library:element library:name="__License"/>
<library:element library:name="SF_String"/>
<library:element library:name="_CodingConventions"/>
<library:element library:name="SF_Timer"/>
<library:element library:name="_ModuleModel"/>
<library:element library:name="SF_Utils"/>
<library:element library:name="SF_Root"/>
<library:element library:name="SF_Array"/>
<library:element library:name="SF_Services"/>
<library:element library:name="SF_Dictionary"/>
<library:element library:name="SF_Session"/>
<library:element library:name="SF_FileSystem"/>
<library:element library:name="SF_TextStream"/>
<library:element library:name="SF_L10N"/>
<library:element library:name="SF_Exception"/>
<library:element library:name="SF_UI"/>
<library:element library:name="SF_Platform"/>
</library:library>