LibreOffice logo
BASEDOCUMENTER
The software tool for documenting your LibreOffice Base applications
 
Database file/home/jean-pierre/Documents/BaseDocumenter/www/databases/Basic/Basic Primitives.odb
File actual save date2018-07-07 13:08:10
Scanning done on2018-07-07 12:37:19
Documentation generated on2018-07-29 18:21:30
Table of contents
Basic Primitives
List of modules
Location Library Module name Module type Number of code lines Procedures by module Declaratives
Document LibOPrim App Standard 152 _GetPropertyValueByName
_UNOCommand
SetFullScreen
ShowDocumentProperties
ShowNavigator
ShowPrinterDialog
ShowPrintPreview
ShowSidebar
'====================================================================
'
' LibOPrim Library - App Module
'
' LibO primitives for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Global Const ERR_LOPRIM_CMDUNK = 3 'unknown command

Global Const LOPRIM_SERV_DISPATCH = "com.sun.star.frame.DispatchHelper" 'dispatcher

' Variables ---------------------------------------------------------


' Subprograms -------------------------------------------------------
'note: internal subprograms and functions are prefixed with an underscore '_'
Document ArrayPrim Arrays Standard 620 _ConcatVectorsTest
_TestVectorFromStringNums
_VectorToDataArrayTest
AddToVector
Array2DToDataArray
ArrayDimCount
ArrayExists
ArrayIsEmpty
ConcatVectors
DataArrayToArray2D
QuickSort
QuickSort2
ReverseVector
ShellSort
SortVectorBubble
StringPosInArray
SwapValues
VectorFromStringNums
VectorToDataArray
'====================================================================
'
' ArrayPrim Library - Arrays Module
'
' Array management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document WriterPrim Autotexts Standard 838 _CreateHiddenDocument
AddAutoText
AddAutotextGroup
AddAutoTexts
AddRawAutoTexts
AutoTextExists
AutotextGroupExists
AutotextGroupID
AutotextGroupNameIndex
AutoTextShortcutIndex
CreateAutoTextContainer
DeleteAutoTextByShortcut
DeleteAutotextGroupByName
GetAutoTextByShortcut
GetAutotextGroupByIndex
GetAutotextGroupByName
GetAutotextGroupNames
GetAutoTextShortcuts
GetAutoTextTitles
NewAutoText
NewAutotextGroup
RenameAutoText
UpdateAutoText
UpdateAutoTextTitle
'====================================================================
'
' WriterPrim Library - Autotexts Module
'
' Autotexts management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' Vocabulary
' An Autotext is made of three items:
' -- its shortcut
' This is the string that is entered by the user in the document before hitting <F3>
' -- its name/description/title
' This is the contents of the "Name" textbox within the UI
' -- its contents
' This is the actual text that is inserted in the document after hitting <F3>
' The contents may be either raw text or formatted text.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'error codes
Global Const ERR_AUTOTEXT_NONE = 0 'ok
Global Const ERR_AUTOTEXT_UNKNOWN = 1 'shortcut not found
Global Const ERR_AUTOTEXT_CANTCREATE = 2 'autotext entry creation problem
Global Const ERR_AUTOTEXT_CANTDELETE = 3 'autotext entry deletion problem
Global Const ERR_AUTOTEXT_CANTUPDATE = 4 'autotext entry update problem
Global Const ERR_AUTOTEXT_EXISTS = 5 'autotext entry shortcut already exists
Global Const ERR_AUTOTEXT_NAME = 6 'non valid autotext entry title
Global Const ERR_AUTOTEXT_SHORTCUT = 7 'non valid autotext entry shortcut
Global Const ERR_AUTOTEXTGROUP_UNKNOWN = 11 'group not found
Global Const ERR_AUTOTEXTGROUP_CANTCREATE = 12 'group creation problem
Global Const ERR_AUTOTEXTGROUP_CANTDELETE = 13 'group deletion problem
Global Const ERR_AUTOTEXTGROUP_EXISTS = 14 'group already exists

'services used
Const SVC_AUTOCONTAINER = "com.sun.star.text.AutoTextContainer"
Const SVC_TEXTRANGE = "com.sun.star.text.TextRange"

' -------------------------------------------------------------------
Document WriterPrim Bookmarks Standard 177 CreateBookmark
GotoBookmark
GotoBookmarkFromCursor
RemoveBookmark
'====================================================================
'
' WriterPrim Library - Bookmarks Module
'
' Bookmarks management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------


' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document DataStructPrim Collections Standard 82 AddCollectionItem
'====================================================================
'
' DataStructPrim Library - KeyValue Module
'
' Provides a Key/Value storage type
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit
Document LibOPrim CustomProperties Standard 429 _CreateCustomProperty_Test
_CustomPropertiesToArray_Test
_CustomPropertyExists_Test
_CustomPropertyType_Test
_DeleteAllCustomProperties_Test
_DeleteCustomProperty_Test
_GetCustomProperty_Test
_GetCustomPropertyValue_Test
_SetCustomPropertyValue_Test
CreateCustomProperty
CustomPropertiesToArray
CustomPropertyExists
CustomPropertyType
DeleteAllCustomProperties
DeleteCustomProperty
GetCustomProperty
GetCustomPropertyValue
SetCustomPropertyValue
'====================================================================
'
' LibOPrim Library - CustomProperties Module
'
' Custom properties management
'
' Notes
' 1. Subprograms are in alphabetical order.
' 2. Each Xxxx subprogram is followed with a _Xxxx_Test() subprogram
' created to test the Xxxx subprogram process.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: LibOPrim.UNO
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20170207
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------
'error status
Global Const ERR_CPROP_NORUN = -1 'process did not run
Global Const ERR_CPROP_OK = 0 'no error
Global Const ERR_CPROP_CREATE = 1
Global Const ERR_CPROP_DELETE = 2 'the property couldn't be deleted
Global Const ERR_CPROP_NOTFOUND = 3 'attempt to access to an inexisting property
Global Const ERR_CPROP_NAME = 4 'illegal property name
Global Const ERR_CPROP_EXISTS = 5 'attempt to create an existing property
Global Const ERR_CPROP_TYPE = 6 'not supported type for a property

'property types
Global Const CPROP_TYPE_UNK = -1
Global Const CPROP_TYPE_STRING = 1
Global Const CPROP_TYPE_NUMBER = 2
Global Const CPROP_TYPE_DATE = 3
Global Const CPROP_TYPE_UNODATE = 4
Global Const CPROP_TYPE_UNODATETIME = 5
Global Const CPROP_TYPE_UNODURATION = 6
Global Const CPROP_TYPE_YESNO = 7

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
'note: internal subprograms and functions are prefixed with an underscore '_'
Document DialogPrim Dialogs Standard 102 BrowseForDir
CreateDialog
YesNoDialog
'====================================================================
'
' DialogPrim Library - Dialogs Module
'
' Dialog management helpers
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

Document LibOPrim Document Standard 369 CreateDocument
DocumentProtectionFlag
GetCurrentDirectory
GetLibODocType
IsBaseDocument
IsCalcDocument
IsDrawDocument
IsImpressDocument
IsMathDocument
IsWriterDocument
ModuleIdentifierStr
OpenDocument
OpenDocumentCopy
OpenDocumentEx
'====================================================================
'
' LibOPrim Library - Document Module
'
' LibO documents primitives for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

'Option VBASupport 1 'this allows for more compatibility with VBA instructions
Option Explicit

' Constants ---------------------------------------------------------

Global Const ERR_LOPRIM_DOCTYPE = -1 'the document object is not set

Global Const LOPRIM_DOCTYPEUNK = 0 'unknown type
Global Const LOPRIM_DOCTYPECALC = 1
Global Const LOPRIM_DOCTYPEWRITER = 2
Global Const LOPRIM_DOCTYPEIMPRESS = 3
Global Const LOPRIM_DOCTYPEDRAW = 4
Global Const LOPRIM_DOCTYPEMATH = 5
Global Const LOPRIM_DOCTYPECBASE = 6


' Variables ---------------------------------------------------------


' Subprograms -------------------------------------------------------
Document CalcPrim Document Standard 66 SecureCalcUI
'====================================================================
'
' CalcPrim Library - Document Module
'
' Calc document primitives
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

'--------------------------------------------------------------------
Document LibOPrim Extensions Standard 65 ExtensionDir
'====================================================================
'
' LibOPrim Library - Extensions Module
'
' Primitives for use within extensions
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: LibOPrim.System
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Const LOPRIM_PACKAGEINFOSING = "/singletons/com.sun.star.deployment.PackageInformationProvider"

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document WriterPrim Fields Standard 311 CreateMasterField
DeleteAllMasterFields
DeleteMasterField
ExportMasterFields
GetMasterFieldNameOnly
GetMasterFieldType
GetMasterFieldValue
IsMasterFieldUser
SetMasterFieldValue
'====================================================================
'
' WriterPrim Library - Fields Module
'
' Master fields management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Public Const MFLD_USERSERVICE = "com.sun.star.text.fieldmaster.User."
Public Const MFLD_USERINSTANCE = "com.sun.star.text.fieldmaster.User"

'masterfield type indentifiers
Public Const MFLD_TYPEUSERID = ".User."
Public Const MFLD_TYPEEXPRID = ".SetExpression."
'note: "expression fields" are named as 'Sequence' in the UI

'masterfield types
Public Const MFLD_TYPE_UNK = 0 'unknown
Public Const MFLD_TYPE_USER = 1 'user
Public Const MFLD_TYPE_EXPR = 2 'expression

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document IOPrim Files Standard 414 ChangeFileExt
ExtractFileExt
ExtractFileName
ExtractFilePath
GetFileContents
GetFileDateTimeModified
GetFileSize
GetSafeDateTimeStr
IsHidden
IsReadOnly
JustFileName
NTFSFileNameString
SetHidden
SetReadOnly
'====================================================================
'
' IOPrim Library - Files Module
'
' On device file management class
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: StringsPrim.Strings
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Const IOPRIM_DATETIMESEPCHAR = "_" 'date-time separator for GetSafeDateTimeStr()

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document IOPrim Folders Standard 316 CheckPathStr
CopyFolder
CreateFolder
DeleteFolder
FolderExists
FolderIsEmpty
GetFolderContents
GetParentFolder
IsFolder
IsSubFolder
'====================================================================
'
' IOPrim Library - Folders Module
'
' Folders management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: ArrayPrim.Arrays, IOPrim.Files
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Global Const IOPRIM_FOLDERFILTER_ALL = 0
Global Const IOPRIM_FOLDERFILTER_FILESONLY = 1
Global Const IOPRIM_FOLDERFILTER_FOLDERSONLY = 2

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document CalcPrim Functions Standard 241 _CalcFuncRange
CalcFunc_CountIf
CalcFunc_FilterXML
CalcFunc_Match
CalcFunc_VLookup
CalcFunc_WebService
GetCalcFunctionObject
GetI8NSpreadsheetFuncName
RunSpreadsheetFunction
'====================================================================
'
' CalcPrim Library - Functions Module
'
' Run Calc spreadsheet functions
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

'--------------------------------------------------------------------

'supported services depending on ranges
Const SERV_SPREADFUNC = "com.sun.star.sheet.FunctionAccess"

'--------------------------------------------------------------------
Document IOPrim Globals Standard 80  
'====================================================================
'
' IOPrim Library - Globals Module
'
' IO routines - global constants and variables
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'Error handling
Global Const ERR_IOPRIM_NOERR = 0 'no error
Global Const ERR_IOPRIM = 100000 'IO error base. All other error codes are added to that one
'folders
Global Const ERR_IOPRIM_NOSUCHFOLDER = ERR_IOPRIM + 1 'folder not found
Global Const ERR_IOPRIM_FOLDERDELETE = ERR_IOPRIM + 2 'can't delete folder
Global Const ERR_IOPRIM_FOLDERMOVE = ERR_IOPRIM + 3 'can't move folder
Global Const ERR_IOPRIM_FOLDERCOPY = ERR_IOPRIM + 4 'can't copy folder
Global Const ERR_IOPRIM_FOLDEREXISTS = ERR_IOPRIM + 5 'target folder already exists
Global Const ERR_IOPRIM_FOLDERLIST = ERR_IOPRIM + 6 'folder contents listing error
Global Const ERR_IOPRIM_FOLDERTOSELF = ERR_IOPRIM + 7 'can't copy folder
'files
Global Const ERR_IOPRIM_NOSUCHFILE = ERR_IOPRIM + 101 'file not found
Global Const ERR_IOPRIM_UNKNOWNMODE = ERR_IOPRIM + 102 'text file mode unknown
Global Const ERR_IOPRIM_FILEEXISTS = ERR_IOPRIM + 103 'file already exists
Global Const ERR_IOPRIM_FILETOSELF = ERR_IOPRIM + 104 'can't copy file
Global Const ERR_IOPRIM_FILEREADONLY = ERR_IOPRIM + 105 'can't set file as read-only
Global Const ERR_IOPRIM_FILEHIDE = ERR_IOPRIM + 106 'can't set file as hidden
'text files
Global Const ERR_IOPRIM_CANTCLOSETEXT = ERR_IOPRIM + 201 'can't close a text file
'drive
Global Const ERR_IOPRIM_NOSPACE = ERR_IOPRIM + 301 'no space left on drive
'ini
Global Const ERR_IOPRIM_INISECUNKNOWN = ERR_IOPRIM + 401 'section not found
Global Const ERR_IOPRIM_INIKEYUNKNOWN = ERR_IOPRIM + 402 'key not found

'Text file access modes (same as VB codes)
Global Const IOPRIM_READMODE = 1
Global Const IOPRIM_WRITEMODE = 2
Global Const IOPRIM_APPENDMODE = 8

'Other constants
Global Const IOPRIM_PATHSEPCHAR = "/"
Global Const IOPRIM_EXTSEPCHAR = "."


' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------

'(none)

' eof ===============================================================
Document LibOPrim Graphics Standard 134 GetGraphicFromResource
GetImage
GetImageManager
SetImageURL
'====================================================================
'
' LibOPrim Library - Graphics Module
'
' Primitives for graphics and images
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: LibOPrim.System
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document Standard Install Standard 89 _AddLibrary
_CheckLibrary
AddBasicLibrary
'Installation d'une bibliothèque dans Mes Macros
' JFN 10/2014
'adapté d'après https://wiki.openoffice.org/wiki/Documentation/Administration_Guide/Using_Custom_Macros_and_Libraries

Option Explicit
Document IOPrim Log Standard 258 _WriteToLog
CloseLog
DisableLogging
EnableLogging
LogError
LogInfo
LogIt
OpenLog
SetLogging
'====================================================================
'
' IOPrim Library - Log Module
'
' Logging for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Logging Strategy
' ----------------
' In your program:
' 0. Define the logging context (file name and overwrite mode) (SetLogging())
' 1. Enable logging (EnableLogging())
' (...) log events by choosing the event type (error or information) (LogIt(), LogError() or LogInfo())
' 2. End logging (CloseLog()), which closes the log file
'
' Logging may be suspended and resumed at any time, using DisableLogging() and EnableLogging()
'--------------------------------------------------------------------
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: none, so that no other error can be introduced here
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'error codes
Global Const ERR_IOPRIMLOGNONE = 0 'no error
Global Const ERR_IOPRIM_LOGCANTCLOSE = 1
Global Const ERR_IOPRIM_LOGSUSPENDED = 2
Global Const ERR_IOPRIM_LOGFILECLOSED = 3
Global Const ERR_IOPRIM_LOGCANTWRITE = 4
Global Const ERR_IOPRIM_LOGCANTOPEN = 5
Global Const ERR_IOPRIM_LOGSET = 6

'logging information
Global Const IOPRIM_LOGUNK = 0 'unknown log message
Global Const IOPRIM_LOGERROR = 1 'error message
Global Const IOPRIM_LOGINFO = 2 'information message
Global Const IOPRIM_LOGERRORSTR = "ERR " 'yes, it's 4 char long!
Global Const IOPRIM_LOGINFOSTR = "INFO"

'separator
Const IOPRIM_LOGSEP = " " 'strings separator for the output string


' Variables ---------------------------------------------------------

Dim g_LogSet As Boolean 'log settings definition flag (see SetLogging())
Dim g_LogFileName As String 'log file name (URL mode)
Dim g_LogOverwrite As Boolean 'log overwrite mode
Dim g_LogOpen As Boolean 'log file open flag
Dim g_LogFileH As Integer 'log file handle
Dim g_LogEnabled As Boolean 'logging flag. Allows to suspend/resume logging without closing the log file

' Subprograms -------------------------------------------------------
Document MathPrim Math Standard 349 _AverageTest
Average
BankersRound
Init
IsDifferent
IsEqual
IsGreater
IsGreaterEqual
IsInRange
IsLower
IsLowerEqual
Max
MaxInArray
MaxLng
Median
Min
MinInArray
Round
SetEpsilon
SwapValues
'====================================================================
'
' MathPrim Library - Math Module
'
' Basic mathematical routines
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: ArrayPrim/Arrays (QuickSort)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'default value for the mEpsilon var (see below)
Const MATH_DELTA = 0.000001 '10E-6

' Variables ---------------------------------------------------------

'a value for math comparisons.
'All number comparisons in the Math library are checked against this value
Public mEpsilon As Double 'this var pertains to the MathPrim library *only*

' Subprograms -------------------------------------------------------
Document ErrorMgr Module1 Standard 59  
'====================================================================
'
' ErrorMgr Library - Module1 Module
'
' (temporary naming) TBD
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================


Option Explicit

'error constants for all libraries and modules ----------------------
'Each module may introduce its own error codes.
'The general policy for avoiding naming conflicts is:
'-- error constant names always begin with 'ERR_'
'-- then comes a module suffix (eg: 'ERR_IOPRIM_')
'-- then comes the actual constant name (eg: 'ERR_IOPRIM_NOSUCHFOLDER')
'Note: a module may have a base constant, named from the module name (eg: 'ERR_IOPRIM')
' It is highly suggested that module error values start higher than 65535, because
' this is the highest error value LibreOffice Basic can return. Thus our error codes
' won't collide.
'Global common error constants have only a 'ERR_' prefix, as below.

Global Const ERR_NONE = 0 'no error
Global Const ERR_UNKNOWN = -1 'unknown error


' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------

'(none)

' eof ===============================================================
Document OSPrim OS Standard 107 GetOSName
IsLinux
IsOSX
IsWindows
RunCommand
'====================================================================
'
' OSPrim Library - OS Module
'
' Operating system primitives
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'OS names
Global Const OSPRIM_OSWIN = "Windows"
Global Const OSPRIM_OSLINUX = "Linux"
Global Const OSPRIM_OSMAC = "Mac"
Global Const OSPRIM_OSOSX = "OSX"

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document CalcPrim RangeCell Standard 1478 ArrayFromVectorRangeName
CalcValue
CellAddressFromReference
ClearRange
ClearRangeContents
ClearRanges
ColumnIndexFromReference
CopyUsedRange
CreateCalcRangeEnumerator
FetchInRangeColumn
FormatRange
GetAdjustedRange
GetDataArea
GetNamedCell
GetNamedCellString
GetNamedCellValue
GetNamedRange
GetRange
GetRangeColumn
GetRangeFromColumns
GetRangeFromRows
GetRangeRow
GetRangeType
GotoLastCell
IsMultiRange
IsNamedRange
IsRangeInRange
IsRangeInRanges
IsSingleCell
IsSingleRange
PasteSpecial
PasteTransferable
RangeAddressFromReference
RangeAddrString
RangeAsSheetCellRange
SetActiveCellByName
SetActiveSheetByName
SetNamedCellValue
ShiftRange
UpdateRangeColumnValues
UpdateRangeMultiColumnValues
UpdateRangeMultiColumnValuesArray
UsedRange
VLookupCell
'====================================================================
'
' CalcPrim Library - RangeCell Module
'
' Ranges and cells management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

'range types
Global Const RANGETYPE_NULL = -1 'null range
Global Const RANGETYPE_UNK = 0 'unknown (default value)
Global Const RANGETYPE_CELL = 1 'a single cell
Global Const RANGETYPE_RANGE = 2 'a simple range
Global Const RANGETYPE_RANGES = 3 'a multiple range
Global Const RANGETYPE_NAMED = 4 'a named range

'error constants
Global Const ERR_RANGE_BADSRCARRAY = -4 'the source array is unusable
Global Const ERR_RANGE_ENUMERATOR = -3 'the enumerator couldn't be created
Global Const ERR_RANGE_OUTOFBOUNDS = -2 'the (column/row) index is out of bounds
Global Const ERR_RANGE_NOEXEC = -1 'the code didn't execute
Global Const ERR_RANGE_OK = 0 'processed without error
Global Const ERR_RANGE_UNK = 10001 'the range is unknown
Global Const ERR_RANGE_NONE = 10002 'the range is empty
Global Const ERR_RANGE_ARRAY = 10003 'the array is invalid
Global Const ERR_RANGE_SRCSHEET = 10004 'source sheet unknown
Global Const ERR_RANGE_TGTSHEET = 10005 'target sheet unknown

'supported services depending on ranges
Const SERV_CELLRANGES = "com.sun.star.sheet.SheetCellRanges"
Const SERV_NAMEDRANGE = "com.sun.star.sheet.NamedRange"
Const SERV_CELLRANGE = "com.sun.star.table.CellRange"
Const SERV_CELL = "com.sun.star.table.Cell"

Const CELL_ORIGIN = "A1"

'--------------------------------------------------------------------
Document CalcPrim Sheet Standard 398 CopyRangeAt
FixRowCols
GetColNameFromNumber
GetSheet
LastRowIndex
LastUsedCell
LastUsedColumn
LastUsedRow
ProtectSheet
ProtectSheetByName
ShowSheetByName
'====================================================================
'
' CalcPrim Library - Sheets Module
'
' Sheets management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

'--------------------------------------------------------------------

Global Const MAXCOL400 = 1024 'max number of colums in a sheet
Global Const MAXROW400 = &H100000 'max number of rows in a sheet

'--------------------------------------------------------------------
'LastRowIndex function return errors
'these codes have to be negative (null or positive ones are for regular rows)
Global Const ERR_ROWINDEX_EMPTY = -1 'the column is empty (this is not an error per se)
Global Const ERR_ROWINDEX_UNKSHEET = -2 'the sheet is unknown
Global Const ERR_ROWINDEX_UNKSHEETINDEX = -3 'the sheet index doesn't exist
Global Const ERR_ROWINDEX_UNKSHEETNAME = -4 'the sheet name doesn't exist
Global Const ERR_ROWINDEX_UNKCOLINDEX = -5 'the column index doesn't exist
Global Const ERR_ROWINDEX_UNKCOLNAME = -6 'the column name doesn't exist

'--------------------------------------------------------------------
Document LibOPrim SpecialFiles Standard 173 CalcShareFileName
GetLibreOfficeSpecialFileData
IsCalcDocumentShared
LockFileName
'====================================================================
'
' LibOPrim Library - SpecialFiles Module
'
' LibreOffice Special files primitives
'
' Note: subprograms are in alphabetical order.
'
'
' This module helps managing the LibreOffice special files.
'
' These special files are the lock files and the (Calc-only) share files.
' These are automatically created by LibreOffice whenever a document is opened (lock file)
' or a Calc spreadsheet is opened which share mode is enabled (share file).
' The file naming is similar in both situations: .~lock.somefile.ods# and
' .~sharing.somefile.ods#, where the 'somefile.ods' part is the name of the associated
' user’s file name.
' Note: These special files are always created in the same directory as the user’s file.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document CalcPrim Spreadsheet Standard 110 ShowColumns
ShowInputLine
ShowRows
ToggleGrid
'====================================================================
'
' CalcPrim Library - Spreadsheet Module
'
' Spreadsheet management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: LibOPrim.App
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit


'--------------------------------------------------------------------



'--------------------------------------------------------------------
Document IOPrim Streams Standard 214 CloseTextStream
LoadTextStreamAsString
LoadTextStreamAsVector
OpenStream
ReadTextStreamAsString
StoreToStream
WriteTextToStream
'====================================================================
'
' IOPrim Library - Streams Module
'
' File access using the SimplefileAccess service (streams)
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'Services
Global Const IOPRIM_SERV_SFA = "com.sun.star.ucb.SimpleFileAccess"


' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document StringsPrim Strings Standard 335 DelChar
DelSpaces
FilterNonPrintableStr
LeftPad
NoAccentStr
QuoteStr
ReplaceStr
RightPad
StripChars
SuppressMultipleChars
TitleCase
TrimEx
UnQuoteStr
'====================================================================
'
' StringsPrim Library - Strings Module
'
' String primitives for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'common quoting chars
Global Const STRPRIM_SGLQUOTECHAR = "'" 'chr(39)
Global Const STRPRIM_DBLQUOTECHAR = """" 'chr(34)

' Variables ---------------------------------------------------------


' Subprograms -------------------------------------------------------
Document WriterPrim Styles Standard 106 GetStyleAtCursor
'====================================================================
'
' WriterPrim Library - Styles Module
'
' Writer styles management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016-2017 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------
'style families
Public Const STY_WFAMPAGES = "PageStyles"
Public Const STY_WFAMPARAS = "ParagraphStyles"
Public Const STY_WFAMCHARS = "CharacterStyles"
Public Const STY_WFAMFRAMES = "FrameStyles"
Public Const STY_WFAMNUMBER = "NumberingStyles"
Public Const STY_WFAMTABLES = "TableStyles" 'added to LibreOffice in v.5.3

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document LibOPrim System Standard 146 CreateProperty
ExpandMacro
GetRegKeyContent
'====================================================================
'
' LibOPrim Library - System Module
'
' LibO system primitives for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Const LOPRIM_THEEXPANDER = "/singletons/com.sun.star.util.theMacroExpander"
Const LOPRIM_PROPERTYVALUE = "com.sun.star.beans.PropertyValue"

Const LOPRIM_REGADMINPROV = "com.sun.star.configuration.AdministrationProvider"
Const LOPRIM_REGUSERPROV = "com.sun.star.configuration.ConfigurationProvider"

Const LOPRIM_REGWRITE = "com.sun.star.configuration.ConfigurationUpdateAccess"
Const LOPRIM_REGREAD = "com.sun.star.configuration.ConfigurationAccess"

'for use with GetRegKeyContent
Public Const LOPRIM_CONFIGUSER = 1 'user acces to the configuration registry
Public Const LOPRIM_CONFIGADMIN = 2 'administrative acces to the configuration registry
Public Const LOPRIM_CONFIGREAD = 4 'configuration registry read mode
Public Const LOPRIM_CONFIGWRITE = 8 'configuration registry write mode

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document WriterPrim Tables Standard 202 GetColumnWidths
GetTableActualWidth
GetTableColCountByName
GetTableRowCountByName
LockCell
'====================================================================
'
' WriterPrim Library - Tables Module
'
' Writer Tables handling
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: WriterPrim.Styles
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document WriterPrim Text Standard 122 GetSelection
HasSelection
'====================================================================
'
' WriterPrim Library - Text Module
'
' Writer Text management
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document IOPrim TextFiles Standard 210 CloseTextFile
LoadTextFileAsString
LoadTextFileAsVector
OpenTextFile
ReadTextAsString
ReadTextAsVector
ReadTextLine
StoreFromArray
StoreFromString
WriteText
'====================================================================
'
' IOPrim Library - TextFiles Module
'
' Text files access
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document LibOPrim Toolbars Standard 276 _GetPropertyValueByName
_ToolbarCommand
CustomToolbarsToArray
DeleteToolbar
DisplayToolbar
GetToolbarResName
HideToolbar
ToolbarVisible
'====================================================================
'
' LibOPrim Library - Toolbars Module
'
' LibO primitives for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Global Const ERR_TBAR_HIDDEN = -2 '(pseudo-error) the toolbar is hidden
Global Const ERR_TBAR_VISIBLE = -1 '(pseudo-error) the toolbar is visible
Global Const ERR_TBAR_NONE = 0 'no error
Global Const ERR_TBAR_UNKNOWN = 1 'unknown toolbar
Global Const ERR_TBAR_DEL = 2 'can't delete the specified toolbar

'standard toolbar names (resource names)
' for use with DisplayToolbar() / HideToolbar()
Global Const LOPRIM_TB_STANDARD = "private:resource/toolbar/standardbar"
Global Const LOPRIM_TB_FIND = "private:resource/toolbar/findbar"
Global Const LOPRIM_TB_FORMAT = "private:resource/toolbar/formatobjectbar"
Global Const LOPRIM_TB_FULLSCREEN = "private:resource/toolbar/fullscreenbar"
Global Const LOPRIM_TB_MENU = "private:resource/menubar/menubar"
Global Const LOPRIM_TB_STATUS = "private:resource/statusbar/statusbar"


'internal constants
Const LOPRIM_TB_ROOT = "private:resource/"
Const LOPRIM_TB_UINAME = "UIName"
Const LOPRIM_TB_RESNAME = "ResourceURL"

'toolbar commands
Const LOPRIM_TBCMD_VIS = "?"
Const LOPRIM_TBCMD_DEL = "D"
Const LOPRIM_TBCMD_HIDE = "H"
Const LOPRIM_TBCMD_VIEW = "V"

' Variables ---------------------------------------------------------


' Subprograms -------------------------------------------------------
'note: internal subprograms and functions are prefixed with an underscore '_'
Document LibOPrim UNO Standard 63 ImplementsUNOstruct
'====================================================================
'
' LibOPrim Library - UNO Module
'
' UNO management primitives for LibreOffice macros
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: (none)
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20180309
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

'(none)

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------
Document FormPrim Widgets Standard 159 CheckBoxCount
GetFormControl
'====================================================================
'
' FormPrim Library - Widgets Module
'
' Form widgets manipulation
'
' Note: subprograms are in alphabetical order.
'
'--------------------------------------------------------------------
' (c) 2016 - Jean-Francois Nifenecker - jean-francois.nifenecker@laposte.net
'====================================================================
' Tested with / under
'
'--------------------------------------------------------------------
' Dependencies: LibOPrim Library - Document Module
'--------------------------------------------------------------------
' History
'
' v.0.1 - 20160321
' -- first inception
'
'====================================================================
' License
' This LibreOffice module is released under the
' CreativeCommons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
' See: http://creativecommons.org/licenses/by-sa/4.0/
' The legal license text is available at:
' http://creativecommons.org/licenses/by-sa/4.0/legalcode
'====================================================================

Option Explicit

' Constants ---------------------------------------------------------

Global Const ERR_FORMPRIM_NODOC = -1 'The specified document doesn’t exist.
Global Const ERR_FORMPRIM_NOFORM = -2 'The specified form doesn’t exist.
Global Const ERR_FORMPRIM_NOCONTROL = -3 'No controls on the form.
Global Const ERR_FORMPRIM_NOWIDGET = -4 'No such widget on the form.

Global Const WIDG_ID_CBX = 5 'checkbox widget ID

' Variables ---------------------------------------------------------

'(none)

' Subprograms -------------------------------------------------------