C# Class SIL.FieldWorks.TE.ScripturePublication

Inheritance: SIL.FieldWorks.Common.PrintLayout.PublicationControl, IxCoreColleague, ILocationTracker, ITeView, IBtAwareView
Mostrar archivo Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_BackTranslationWS int
m_app IApp
m_bookFilter SIL.FieldWorks.FDO.DomainServices.FilteredScrBooks
m_filterInstance int
m_footnoteVc SIL.FieldWorks.TE.FootnoteVc
m_viewType TeViewType

Private Properties

Property Type Description
GetSectionLevel int
GetSharedSubstream IVwLayoutStream
UpdateFindReplaceMenuItem bool

Public Methods

Method Description
ActivateView ( ) : void

Perform TE-specific user view activation.

GetBook ( SelectionHelper selHelper, SelectionHelper selLimitType ) : IScrBook

Gets the current book, or null if there is no current book (e.g. no selection or empty view).

GetBookIndex ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int

Get the index of the current book (relative to book filter), or -1 if there is no current book (e.g. no selection or empty view).

The returned value is suitable for making a selection.

GetLevelCount ( int tag ) : int

Gets the number of levels for the given tag.

GetLevelIndex ( int tag ) : int

Gets the index of the level for the given tag based on the current selection.

GetMessageTargets ( ) : IxCoreColleague[]

Get the possible message targets, i.e. the view(s) we are showing

GetSection ( SelectionHelper selHelper, SelectionHelper selLimitType ) : IScrSection

Gets the current section, or null if we're not in a section (e.g. the IP is in a title).

GetSectionIndexInBook ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int

Gets the index of the section relative to the book, or -1 if we're not in a section.

GetSectionIndexInView ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int

Get the index of the section (relative to RootBox), or -1 if we're not in a section (e.g. the IP is in a title).

The returned value is suitable for making a selection.

GetWritingSystemForHvo ( int hvo ) : int

Gets the writing system for the HVO. This could either be the vernacular or analysis writing system.

Init ( XCore.Mediator mediator, System configurationParameters ) : void

Not used

OnInsertDiffPara ( IVwRootBox rootBox, ITsTextProps ttpDest, ITsTextProps ttpSrc, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse

see OnInsertDiffParas

OnInsertDiffParas ( IVwRootBox rootBox, ITsTextProps ttpDest, int cPara, ITsTextProps ttpSrcArray, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse

Handle insertion of paragraphs (i.e., from clipboard) with properties that don't match the properties of the paragraph where they are being inserted. This gives us the opportunity to create/modify the DB structure to recieve the paragraphs being inserted and to reject certain types of paste operations (such as attempting to paste a book).

OnProblemDeletion ( IVwSelection sel, VwDelProbType dpt ) : VwDelProbResponse

Override to pass handling of problem deletion on to editing helper.

ScripturePublication ( FwStyleSheet stylesheet, int filterInstance, IPublication publication, TeViewType viewType, System.DateTime printDateTime, IHelpTopicProvider helpTopicProvider, IApp app, int btWs ) : System

Constructs a general-purpose publication for printing Scripture

SetBookAndSection ( SelectionHelper selHelper, SelectionHelper selLimitType, int iBook, int iSection ) : void

Set both book and section. Don't make a selection; typically the caller will proceed to do that.

This method should change only the book and section levels of the selection, but not any other level.

ShowContextMenu ( Point loc ) : void

Shows the context menu.

Protected Methods

Method Description
AddDivisionsForBooks ( ) : void

Adds the divisions for books.

ApplyBookFilterAndCreateDivisions ( ) : void

Applies the book filter and creates divisions.

Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

GetDivisionLayoutMgr ( PrintLayoutPortion divisionPortion, int hvoBook ) : SIL.FieldWorks.Common.PrintLayout.DivisionLayoutMgr

Gets a DivisionLayoutMgr for a division.

Allows sub classes to override the type of DivisionLayoutMgr that is created.

GetInternalEditingHelper ( ) : SIL.FieldWorks.Common.RootSites.RootSiteEditingHelper

Gets a instance of the EditingHelper used to process editing requests.

GetNonFocusedSelectionState ( Control windowGainingFocus ) : VwSelectionState

If the annotations window is gaining focus, then we don't want the print layout's range selections to be hidden.

GetPrintLayoutConfigurer ( PrintLayoutPortion divisionPortion, int hvoBook, IVwLayoutStream sharedStream, int ws ) : SIL.FieldWorks.TE.TePrintLayoutConfig

Gets the print layout configurer.

OnKeyPress ( System e ) : void

Override to restore prompt selection if relevant (for segmented BT).

OnMouseUp ( MouseEventArgs e ) : void

Process mouse button up event

OnPaint ( PaintEventArgs e ) : void

Override of UserControl.OnPaint

OnUpdateEditFind ( object args ) : bool

Determine if Edit Find menu item should be enabled.

OnUpdateEditFindNext ( object args ) : bool

Determine if Edit Find Next menu item should be enabled.

OnUpdateEditFindPrev ( object args ) : bool

Determine if Edit Find Prev menu item should be enabled.

OnUpdateEditReplace ( object args ) : bool

Determine if Edit Replace menu item should be enabled.

OnUpdateInformationBar ( object args ) : bool

RefreshDisplay ( bool fPreserveSelection ) : void

Refreshes the display.

Private Methods

Method Description
GetSectionLevel ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int

Gets the level for the section tag.

GetSharedSubstream ( ) : IVwLayoutStream

Gets the shared substream.

UpdateFindReplaceMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : bool

Updates any of the Edit/Find,replace menu items based on the selected view

Method Details

ActivateView() public method

Perform TE-specific user view activation.
public ActivateView ( ) : void
return void

AddDivisionsForBooks() protected method

Adds the divisions for books.
protected AddDivisionsForBooks ( ) : void
return void

ApplyBookFilterAndCreateDivisions() protected method

Applies the book filter and creates divisions.
protected ApplyBookFilterAndCreateDivisions ( ) : void
return void

Dispose() protected method

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetBook() public method

Gets the current book, or null if there is no current book (e.g. no selection or empty view).
public GetBook ( SelectionHelper selHelper, SelectionHelper selLimitType ) : IScrBook
selHelper SIL.FieldWorks.Common.RootSites.SelectionHelper The selection helper.
selLimitType SIL.FieldWorks.Common.RootSites.SelectionHelper Which end of the selection
return IScrBook

GetBookIndex() public method

Get the index of the current book (relative to book filter), or -1 if there is no current book (e.g. no selection or empty view).
The returned value is suitable for making a selection.
public GetBookIndex ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int
selHelper SIL.FieldWorks.Common.RootSites.SelectionHelper The selection helper.
selLimitType SIL.FieldWorks.Common.RootSites.SelectionHelper Which end of the selection
return int

GetDivisionLayoutMgr() protected method

Gets a DivisionLayoutMgr for a division.
Allows sub classes to override the type of DivisionLayoutMgr that is created.
protected GetDivisionLayoutMgr ( PrintLayoutPortion divisionPortion, int hvoBook ) : SIL.FieldWorks.Common.PrintLayout.DivisionLayoutMgr
divisionPortion PrintLayoutPortion portion of book to be layed out in divsion
hvoBook int The hvo of the book.
return SIL.FieldWorks.Common.PrintLayout.DivisionLayoutMgr

GetInternalEditingHelper() protected method

Gets a instance of the EditingHelper used to process editing requests.
protected GetInternalEditingHelper ( ) : SIL.FieldWorks.Common.RootSites.RootSiteEditingHelper
return SIL.FieldWorks.Common.RootSites.RootSiteEditingHelper

GetLevelCount() public method

Gets the number of levels for the given tag.
public GetLevelCount ( int tag ) : int
tag int The tag.
return int

GetLevelIndex() public method

Gets the index of the level for the given tag based on the current selection.
public GetLevelIndex ( int tag ) : int
tag int The tag.
return int

GetMessageTargets() public method

Get the possible message targets, i.e. the view(s) we are showing
public GetMessageTargets ( ) : IxCoreColleague[]
return IxCoreColleague[]

GetNonFocusedSelectionState() protected method

If the annotations window is gaining focus, then we don't want the print layout's range selections to be hidden.
protected GetNonFocusedSelectionState ( Control windowGainingFocus ) : VwSelectionState
windowGainingFocus System.Windows.Forms.Control
return VwSelectionState

GetPrintLayoutConfigurer() protected method

Gets the print layout configurer.
protected GetPrintLayoutConfigurer ( PrintLayoutPortion divisionPortion, int hvoBook, IVwLayoutStream sharedStream, int ws ) : SIL.FieldWorks.TE.TePrintLayoutConfig
divisionPortion PrintLayoutPortion portion of book to be layed out in division
hvoBook int The hvo of the book.
sharedStream IVwLayoutStream A layout stream used for footnotes which is shared across /// multiple divisions
ws int The writing system.
return SIL.FieldWorks.TE.TePrintLayoutConfig

GetSection() public method

Gets the current section, or null if we're not in a section (e.g. the IP is in a title).
public GetSection ( SelectionHelper selHelper, SelectionHelper selLimitType ) : IScrSection
selHelper SIL.FieldWorks.Common.RootSites.SelectionHelper The selection helper.
selLimitType SIL.FieldWorks.Common.RootSites.SelectionHelper Which end of the selection
return IScrSection

GetSectionIndexInBook() public method

Gets the index of the section relative to the book, or -1 if we're not in a section.
public GetSectionIndexInBook ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int
selHelper SIL.FieldWorks.Common.RootSites.SelectionHelper The selection helper.
selLimitType SIL.FieldWorks.Common.RootSites.SelectionHelper Which end of the selection
return int

GetSectionIndexInView() public method

Get the index of the section (relative to RootBox), or -1 if we're not in a section (e.g. the IP is in a title).
The returned value is suitable for making a selection.
public GetSectionIndexInView ( SelectionHelper selHelper, SelectionHelper selLimitType ) : int
selHelper SIL.FieldWorks.Common.RootSites.SelectionHelper The selection helper.
selLimitType SIL.FieldWorks.Common.RootSites.SelectionHelper Which end of the selection
return int

GetWritingSystemForHvo() public method

Gets the writing system for the HVO. This could either be the vernacular or analysis writing system.
public GetWritingSystemForHvo ( int hvo ) : int
hvo int HVO
return int

Init() public method

Not used
public Init ( XCore.Mediator mediator, System configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System
return void

OnInsertDiffPara() public method

see OnInsertDiffParas
public OnInsertDiffPara ( IVwRootBox rootBox, ITsTextProps ttpDest, ITsTextProps ttpSrc, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse
rootBox IVwRootBox
ttpDest ITsTextProps
ttpSrc ITsTextProps
tssParas ITsString
tssTrailing ITsString
return VwInsertDiffParaResponse

OnInsertDiffParas() public method

Handle insertion of paragraphs (i.e., from clipboard) with properties that don't match the properties of the paragraph where they are being inserted. This gives us the opportunity to create/modify the DB structure to recieve the paragraphs being inserted and to reject certain types of paste operations (such as attempting to paste a book).
public OnInsertDiffParas ( IVwRootBox rootBox, ITsTextProps ttpDest, int cPara, ITsTextProps ttpSrcArray, ITsString tssParas, ITsString tssTrailing ) : VwInsertDiffParaResponse
rootBox IVwRootBox the sender
ttpDest ITsTextProps properties of destination paragraph
cPara int number of paragraphs to be inserted
ttpSrcArray ITsTextProps Array of props of each para to be inserted
tssParas ITsString Array of TsStrings for each para to be inserted
tssTrailing ITsString Text of an incomplete paragraph to insert at end (with /// the properties of the destination paragraph.
return VwInsertDiffParaResponse

OnKeyPress() protected method

Override to restore prompt selection if relevant (for segmented BT).
protected OnKeyPress ( System e ) : void
e System
return void

OnMouseUp() protected method

Process mouse button up event
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnPaint() protected method

Override of UserControl.OnPaint
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs Info needed to paint
return void

OnProblemDeletion() public method

Override to pass handling of problem deletion on to editing helper.
public OnProblemDeletion ( IVwSelection sel, VwDelProbType dpt ) : VwDelProbResponse
sel IVwSelection The sel.
dpt VwDelProbType The DPT.
return VwDelProbResponse

OnUpdateEditFind() protected method

Determine if Edit Find menu item should be enabled.
protected OnUpdateEditFind ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditFindNext() protected method

Determine if Edit Find Next menu item should be enabled.
protected OnUpdateEditFindNext ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditFindPrev() protected method

Determine if Edit Find Prev menu item should be enabled.
protected OnUpdateEditFindPrev ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditReplace() protected method

Determine if Edit Replace menu item should be enabled.
protected OnUpdateEditReplace ( object args ) : bool
args object The menu item properties
return bool

OnUpdateInformationBar() protected method

protected OnUpdateInformationBar ( object args ) : bool
args object
return bool

RefreshDisplay() protected method

Refreshes the display.
protected RefreshDisplay ( bool fPreserveSelection ) : void
fPreserveSelection bool True to save the selection and restore it afterwards, /// false otherwise
return void

ScripturePublication() public method

Constructs a general-purpose publication for printing Scripture
public ScripturePublication ( FwStyleSheet stylesheet, int filterInstance, IPublication publication, TeViewType viewType, System.DateTime printDateTime, IHelpTopicProvider helpTopicProvider, IApp app, int btWs ) : System
stylesheet FwStyleSheet The stylesheet.
filterInstance int number used to make filters unique per main window
publication IPublication The publication to get the information from (or /// null to keep the defaults)
viewType TeViewType Type of the view.
printDateTime System.DateTime Date/Time of the printing
helpTopicProvider IHelpTopicProvider The help topic provider.
app IApp The app.
btWs int Backtranslation WS
return System

SetBookAndSection() public method

Set both book and section. Don't make a selection; typically the caller will proceed to do that.
This method should change only the book and section levels of the selection, but not any other level.
public SetBookAndSection ( SelectionHelper selHelper, SelectionHelper selLimitType, int iBook, int iSection ) : void
selHelper SIL.FieldWorks.Common.RootSites.SelectionHelper The selection helper.
selLimitType SIL.FieldWorks.Common.RootSites.SelectionHelper Which end of the selection
iBook int The index of the book (in the book filter).
iSection int The index of the section (relative to /// ), or -1 for a selection that is not in a section (e.g. /// title).
return void

ShowContextMenu() public method

Shows the context menu.
public ShowContextMenu ( Point loc ) : void
loc Point The loc.
return void

Property Details

m_BackTranslationWS protected_oe property

The back translation WS
protected int m_BackTranslationWS
return int

m_app protected_oe property

protected IApp m_app
return IApp

m_bookFilter protected_oe property

protected FilteredScrBooks,SIL.FieldWorks.FDO.DomainServices m_bookFilter
return SIL.FieldWorks.FDO.DomainServices.FilteredScrBooks

m_filterInstance protected_oe property

protected int m_filterInstance
return int

m_footnoteVc protected_oe property

protected FootnoteVc,SIL.FieldWorks.TE m_footnoteVc
return SIL.FieldWorks.TE.FootnoteVc

m_viewType protected_oe property

protected TeViewType m_viewType
return TeViewType