Skip to content
FoolRunning edited this page Jul 26, 2022 · 15 revisions

Description

Provides application-level interaction with Paratext.

Events

ActiveWindowSelectionChanged

WindowSelectionChangedHandler ActiveWindowSelectionChanged

Raised when the active window and/or the selection in that window is changed

NOTE: Note that the currentSelections is passed for convenience; it is always the same object as returned by the IParatextChildState.Selections property of the ActiveWindowState


ShuttingDown

CancelEventHandler ShuttingDown

Raised when Paratext starts shutting down


VerseRefChanged

ReferenceChangedHandler VerseRefChanged

Raised when the Scripture reference is changed.


Properties

ActiveWindowState

IParatextChildState ActiveWindowState

State of the active Paratext child window. Null if no child window is active.

NOTE: During Paratext startup, the state of the active window might be undefined. Therefore, plugins should avoid accessing this property in EmbeddedPluginControl.OnAddedToParent.


AllEnhancedResources

IReadOnlyList<IReadOnlyProject> AllEnhancedResources

Get all of the enhanced resource projects on the user's machine


AllOpenWindows

IReadOnlyList<IParatextChildState> AllOpenWindows

Gets all of the open Paratext child windows. An empty list is returned if there are no open windows.

NOTE: During Paratext startup, the state of the open windows might be undefined. Therefore, plugins should avoid accessing this property in EmbeddedPluginControl.OnAddedToParent.


AllResources

IReadOnlyList<IReadOnlyProject> AllResources

Get all of the resource projects on the user's machine


ApplicationName

string ApplicationName

Gets the host application name.


ApplicationVersion

Version ApplicationVersion

Gets the version of the host application


BiblicalTermsWindow

IBiblicalTermsWindow BiblicalTermsWindow

Gets an object representing the (one and only) Biblical Terms tool window.

NOTE: Even if the Biblical Terms tool window is not showing in Paratext, this will return a valid object.


DefaultKeyboard

IKeyboard DefaultKeyboard

Gets the default keyboard for the system default input language.


ReferenceList

IReferenceListWindow ReferenceList

Gets an object representing the (one and only) list of references.

NOTE: Even if the list window is not showing in Paratext, this will return a valid object.


UserInfo

IUserInfo UserInfo

Gets an object representing the current user


UserSettings

IUserSettings UserSettings

The per-user settings currently in effect


Methods

DeletePluginData

void DeletePluginData(IPluginObject obj, string dataIdentifier)

Removes project-agnostic data.

Parameter Description
obj Any object owned by the plugin that can be used to uniquely identify the plugin
dataIdentifier string identifying the data (e.g. a filename)
Exception Condition
ParatextPluginException Plugin gave invalid data
IOException If something went wrong accessing the file on disk

FlushLog

void FlushLog()

Forces any outstanding writes to the log file to be flushed to disk.


GetAllProjects

IReadOnlyList<IProject> GetAllProjects()

Get all of the non resource projects on the user's machine


GetAllProjects

IReadOnlyList<IProject> GetAllProjects(bool includeResources)

Get all of the non resource projects on the user's machine

Parameter Description
includeResources Determines if resources are included in the list of projects returned.

GetBiblicalTermList

IBiblicalTermList GetBiblicalTermList(BiblicalTermListType type)

Gets the requested list of biblical terms.


GetPluginData

TextReader GetPluginData(IPluginObject obj, string dataIdentifier)

Gets a text reader that the plugin can use to read project-agnostic data. The plugin is responsible for closing the reader.

Parameter Description
return value The reader containing the data, or null if it did not exist
obj Any object owned by the plugin that can be used to uniquely identify the plugin
dataIdentifier string identifying the data (e.g. a filename)
Exception Condition
ParatextPluginException Plugin gave invalid data
IOException If something went wrong accessing the file on disk

GetPluginDataModifiedTime

DateTime GetPluginDataModifiedTime(IPluginObject obj, string dataIdentifier)

Gets the date/time when the specified project-agnostic data was last modified.

Parameter Description
return value The date/time when the data was last modified
obj Any object owned by the plugin that can be used to uniquely identify the plugin
dataIdentifier string identifying the data (e.g. a filename)
Exception Condition
ParatextPluginException Plugin gave invalid data
IOException If something went wrong accessing the file on disk

GetStandardVersification

IVersification GetStandardVersification(StandardScrVersType type)

Gets the requested standard versification.

Exception Condition
ParatextPluginException type is StandardScrVersType.Unknown

GetXmlMerger

IDataFileMerger GetXmlMerger(XMLDataMergeInfo mergeInfo)

Gets a standard XML-based merger that uses XMLDataMergeInfo.

Parameter Description
mergeInfo The merge information
Exception Condition
ParatextPluginException mergeInfo is null.

Log

void Log(IPluginObject obj, string logFormatStr, params object[] formatArguments)

Writes the given string to the host's log file as an error (tagged with the plugin's ID to identify the source of the logged info).

NOTE: The log is not guaranteed to be written to disk immediately. If you need to ensure that the contents are written to disk, call FlushLog.

Parameter Description
obj Any object owned by the plugin that can be used to uniquely identify the plugin
logFormatStr The string to log. May be a standard .Net format string.
formatArguments Optional parameters for the format string.

OpenDictionaryWindowFor

void OpenDictionaryWindowFor(IReadOnlyProject project, OpenWindowBehavior behavior, string dictionaryEntry)

Open a window in Paratext for a dictionary project

Parameter Description
project The project to open a window for
behavior The desired behavior for opening the window
dictionaryEntry The dictionary entry to show when opening the project

OpenEnhancedResourceWindowFor

void OpenEnhancedResourceWindowFor(IReadOnlyProject project, OpenWindowBehavior behavior, IVerseRef verseRef)

Open a window in Paratext for an enhanced resource project

Parameter Description
project The project to open a window for
behavior The desired behavior for opening the window
verseRef The reference to show when opening the project

OpenSLTWindowFor

void OpenSLTWindowFor(SLTProject project, OpenWindowBehavior behavior, IVerseRef verseRef, int wordToSelect=-1)

Open a window in Paratext for a dictionary project

Parameter Description
project The project to open a window for
behavior The desired behavior for opening the window
verseRef The reference to show when opening the project
wordToSelect the word to select in the verse reference. -1 will select the beginning of the verse

OpenTextWindowFor

void OpenTextWindowFor(IReadOnlyProject project, OpenWindowBehavior behavior, IVerseRef verseRef)

Open a window in Paratext for a text project

Parameter Description
project The project to open a window for
behavior The desired behavior for opening the window
verseRef The reference to show when opening the project

PutPluginData

void PutPluginData(IPluginObject obj, string dataIdentifier, Action< TextWriter > writeData)

Requests Paratext to obtain a text writer and call back to the plugin so it can use it to write project-agnostic data (will not be Sent/Received by any project).

Parameter Description
obj Any object owned by the plugin that can be used to uniquely identify the plugin
dataIdentifier string identifying the data (e.g. a filename)
writeData A callback supplying a TextWriter that the plugin should use to write the data.
Exception Condition
ParatextPluginException Plugin gave invalid data
IOException If something went wrong accessing the file on disk

SetReferenceForSyncGroup

void SetReferenceForSyncGroup(IVerseRef verseRef, SyncReferenceGroup group)

Sets the Scripture reference for the specified synchronized reference group (i.e., a "scroll group" in Paratext).


This page is auto-generated. User edits will be lost when regenerated.

Clone this wiki locally