-
Notifications
You must be signed in to change notification settings - Fork 4
IPluginHost
Provides application-level interaction with Paratext.
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
CancelEventHandler ShuttingDown
Raised when Paratext starts shutting down
ReferenceChangedHandler VerseRefChanged
Raised when the Scripture reference is changed.
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.
IReadOnlyList<IReadOnlyProject> AllEnhancedResources
Get all of the enhanced resource projects on the user's machine
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.
IReadOnlyList<IReadOnlyProject> AllResources
Get all of the resource projects on the user's machine
string ApplicationName
Gets the host application name.
Version ApplicationVersion
Gets the version of the host application
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.
IKeyboard DefaultKeyboard
Gets the default keyboard for the system default input language.
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.
IUserInfo UserInfo
Gets an object representing the current user
IUserSettings UserSettings
The per-user settings currently in effect
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 |
void FlushLog()
Forces any outstanding writes to the log file to be flushed to disk.
IReadOnlyList<IProject> GetAllProjects()
Get all of the non resource projects on the user's machine
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. |
IBiblicalTermList GetBiblicalTermList(BiblicalTermListType type)
Gets the requested list of biblical terms.
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 |
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 |
IVersification GetStandardVersification(StandardScrVersType type)
Gets the requested standard versification.
Exception | Condition |
---|---|
ParatextPluginException | type is StandardScrVersType.Unknown |
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. |
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. |
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 |
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 |
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 |
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 |
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 |
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.