C# Class SIL.FieldWorks.IText.InterlinVc

View constructor for InterlinView. Just to get something working, currently it is just a literal.
Inheritance: SIL.FieldWorks.Common.RootSites.FwBaseVc, IDisposable
Mostrar archivo Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_analRepository IWfiAnalysisRepository
m_coRepository ICmObjectRepository
m_fHaveOpenedParagraph bool
m_fShowDefaultSense bool
m_segRepository ISegmentRepository
m_stylesheet IVwStylesheet
m_wmbRepository IWfiMorphBundleRepository
m_wsAnalysis int
m_wsManager IWritingSystemManager
m_wsUi int
m_wsVernForDisplay int

Private Properties

Property Type Description
AddExtraBundleRows void
AddFreeformComment void
AddLineIndexProperty void
AddSegmentReference void
AddTssDirForVernWs void
AddTssDirForWs void
CanBeAnalyzed bool
CreateParaLoader IParaDataLoader
DisplayLexGlossWithInflType bool
DisplayMorphBundle void
DisplayMorphForm void
DisplaySingleInterlinearAnalysisWithLabels void
EnsureLoader void
EstimateParaHeight int
EstimateSegmentHeight int
EstimateStTextHeight int
GetAnnDefnId ICmAnnotationDefn
GetAnnDefnId int
GetAnnDefnId int
GetGuess int
GetRealWs int
GetRealWsOrBestWsForContext int
IsVernWs bool
IsWsRtl bool
JoinGlossAffixesOfInflVariantTypes void
LoadDataForSegments void
LoadParaData void
RecordGuessIfNotKnown void
SegDefnFromFfFlid ICmAnnotationDefn
SetActiveFreeform void
SetGuessing void
SetGuessing void
SetNoteLabelProps void
SetParaDirectionAndAlignment void
SetupRealVernWsForDisplay void
TryGetLexGlossWithInflTypeTss bool

Public Methods

Method Description
AddLabelPile ( IVwEnv vwenv, ITsStrFactory tsf, SIL.FieldWorks.FDO.FdoCache cache, bool fWantMultipleSenseGloss, bool fShowMorphemes ) : void

Add the pile of labels used to identify the lines in interlinear text.

CheckDisposed ( ) : void

Throw if the IsDisposed property is true

Display ( IVwEnv vwenv, int hvo, int frag ) : void
DisplayEmbeddedObject ( IVwEnv vwenv, int hvo ) : void

Display the specified object (from an ORC embedded in a string). Don't display any embedded objects in interlinear text.

DisplayVariant ( IVwEnv vwenv, int tag, int frag ) : ITsString
DisplayVec ( IVwEnv vwenv, int hvo, int tag, int frag ) : void
Dispose ( ) : void
EstimateHeight ( int hvo, int frag, int dxAvailWidth ) : int

Estimate the height of things we display lazily.

GetGuessForWordform ( IWfiWordform wf, int ws ) : IAnalysis
InterlinVc ( FdoCache cache ) : System

Initializes a new instance of the InterlinVc class.

We use the default analysis writing system as the default, even though this view displays data in multiple writing systems. It's pretty arbitrary in this case, but we need a valid WS because if we get an ORC, we have to create a Ts String using some writing system.

LoadDataFor ( IVwEnv vwenv, int rghvo, int chvo, int hvoParent, int tag, int frag, int ihvoMin ) : void
LoadParaData ( IStTxtPara para ) : void
ResetAnalysisCache ( ) : void

Call this to clear the temporary cache of analyses. Minimally do this when data changes. Ideally no more often than necessary.

UpdatingOccurrence ( IAnalysis oldAnalysis, IAnalysis newAnalysis ) : bool

Protected Methods

Method Description
AddAnalysisPos ( IVwEnv vwenv, int hvoAnalysis, int hvoCurrent, int choiceIndex ) : void

Add a display of the category of hvoAnalysis. If choiceOffset is -1, display the current analysis writing systems, otherwise, display the one indicated (choiceIndex is an index into line choices). When choice index is not -1, hvoAnalysis may not be the current object. In that case, we invoke AddObj with a special flid which results in a recursive call to this, but with the correct current object.

AddColoredString ( IVwEnv vwenv, int color, string str ) : void

Add the specified string in the specified color to the display, using the UI Writing system.

AddFreeformAnnotations ( IVwEnv vwenv, int hvoSeg ) : void
AddFreeformComment ( IVwEnv vwenv, int hvoSeg, int lineChoiceIndex ) : void
AddWordBundleInternal ( int hvo, IVwEnv vwenv ) : void

DisplayAnalysisAndCloseInnerPile ( IVwEnv vwenv, AnalysisOccurrence analysisOccurrence, bool showMultipleAnalyses ) : void

Displays Analysis using DisplayWordBundleMethod and closes the views Inner Pile.

Dispose ( bool fDisposing ) : void
FormatGloss ( IVwEnv vwenv, int ws ) : void

Format the gloss line for the specified ws in an interlinear text

GetSegmentLevelTags ( FdoCache cache ) : void

Normally gets some virtual property tags we need for stuff above the bundle level. Code that is only using fragments at or below bundle may override this to do nothing, and then need not set up the virtual property handlers. See ConstChartVc.

LabelRGBFor ( InterlinLineSpec spec ) : int
LabelRGBFor ( int choiceIndex ) : int
SetColor ( IVwEnv vwenv, int color ) : void

Called right before adding a string or opening a flow object, sets its color.

SetupAndOpenInnerPile ( IVwEnv vwenv ) : void

Setup a box with 10 points behind and 5 under and open the inner pile

Private Methods

Method Description
AddExtraBundleRows ( IVwEnv vwenv, SIL.FieldWorks.FDO.DomainServices.AnalysisOccurrence point ) : void

Add any extra material after the main bundles. See override on InterlinTaggingVc.

AddFreeformComment ( IVwEnv vwenv, int hvo, int ws, int flidTarget ) : void
AddLineIndexProperty ( ITsStrBldr bldr, int i ) : void
AddSegmentReference ( IVwEnv vwenv, int hvo ) : void

Add a segment number appropriate to the current segment being displayed. (See LT-1236.)

AddTssDirForVernWs ( IVwEnv vwenv ) : void
AddTssDirForWs ( IVwEnv vwenv, int ws ) : void

If the analysis writing system has the opposite directionality to the vernacular writing system, we need to add a directionality code to the data stream for the bidirectional algorithm not to jerk the insertion point around at every space. See LT-7738.

CanBeAnalyzed ( AnalysisOccurrence occurrence ) : bool

Answer true if the specified word can be analyzed. This is a further check after ensuring it has an InstanceOf. It is equivalent to the check made in case kfragBundle of Display(), but that already has access to the writing system of the Wordform. GJM - Jan 19,'10 Added check to see if this occurrence is actually Punctuation. Punctuation cannot be analyzed.

CreateParaLoader ( ) : IParaDataLoader
DisplayLexGlossWithInflType ( IVwEnv vwenv, ILexEntry possibleVariant, ILexSense sense, InterlinLineSpec spec, ILexEntryInflType inflType ) : bool

NOTE: this routine is ignorant of calling context, so caller must provide NoteDependency to the possibleVariant and the sense (e.g. vwenv.NoteDependency(new[] { wfiMorphBundle.Hvo }, new[] { WfiMorphBundleTags.kflidSense }, 1); vwenv.NoteDependency(new[] { wfiMorphBundle.Hvo }, new[] { WfiMorphBundleTags.kflidInflType }, 1);

DisplayMorphBundle ( IVwEnv vwenv, int hvo ) : void

Displays a MorphBundle, setting the colors of its parts.

DisplayMorphForm ( IVwEnv vwenv, int hvo, int ws ) : void
DisplaySingleInterlinearAnalysisWithLabels ( IVwEnv vwenv, int hvo ) : void
EnsureLoader ( ) : void
EstimateParaHeight ( IStTxtPara para, int dxAvailWidth ) : int
EstimateSegmentHeight ( ISegment seg, int dxAvailWidth ) : int
EstimateStTextHeight ( IStText text, int dxAvailWidth ) : int
GetAnnDefnId ( FdoCache cache, Guid guid ) : ICmAnnotationDefn
GetAnnDefnId ( FdoCache cache, Guid guid, int &cachedVal ) : int
GetAnnDefnId ( FdoCache cache, string guid, int &cachedVal ) : int

Get an AnnotationDefn with the (English) name specified, and cache it in cachedVal...unless it is already cached, in which case, just return it.

GetGuess ( IAnalysis analysis ) : int

Get a guess for the given word or analysis.

GetRealWs ( FdoCache cache, int hvo, InterlinLineSpec spec, int wsPreferred ) : int
GetRealWsOrBestWsForContext ( int hvo, InterlinLineSpec spec ) : int

try to get the ws specified by spec.WritingSystem, otherwise get the default vernacular ws for the display (e.g. ws of paragraph).

IsVernWs ( int ws, int wsSpec ) : bool

Check whether we're looking at vernacular data.

IsWsRtl ( int wsAnalysis ) : bool
JoinGlossAffixesOfInflVariantTypes ( ILexEntryRef entryRef1, int wsPreferred, ITsIncStrBldr &sbPrepend1, ITsIncStrBldr &sbAppend1 ) : void
LoadDataForSegments ( int rghvo, int hvoPara ) : void

Load data for a group of segments

LoadParaData ( int hvoPara ) : void
RecordGuessIfNotKnown ( AnalysisOccurrence selected ) : void
SegDefnFromFfFlid ( int flid ) : ICmAnnotationDefn
SetActiveFreeform ( int hvo, int flid, int ws, int cpropPrevious ) : void
SetGuessing ( IVwEnv vwenv ) : void
SetGuessing ( IVwEnv vwenv, int bgColor ) : void

Set the background color that we use to indicate a guess.

SetNoteLabelProps ( IVwEnv vwenv ) : void
SetParaDirectionAndAlignment ( IVwEnv vwenv, int wsAnalysis ) : void

Set the paragraph direction to match wsAnalysis and the paragraph alignment to match the overall direction of the text.

SetupRealVernWsForDisplay ( int wsVern ) : void

setups up the display to work with the given wsVern.

TryGetLexGlossWithInflTypeTss ( ILexEntry possibleVariant, ILexSense sense, InterlinLineSpec spec, InterlinLineChoices lineChoices, int vernWsContext, ILexEntryInflType inflType, ITsString &result ) : bool

Method Details

AddAnalysisPos() protected method

Add a display of the category of hvoAnalysis. If choiceOffset is -1, display the current analysis writing systems, otherwise, display the one indicated (choiceIndex is an index into line choices). When choice index is not -1, hvoAnalysis may not be the current object. In that case, we invoke AddObj with a special flid which results in a recursive call to this, but with the correct current object.
protected AddAnalysisPos ( IVwEnv vwenv, int hvoAnalysis, int hvoCurrent, int choiceIndex ) : void
vwenv IVwEnv
hvoAnalysis int
hvoCurrent int
choiceIndex int
return void

AddColoredString() protected method

Add the specified string in the specified color to the display, using the UI Writing system.
protected AddColoredString ( IVwEnv vwenv, int color, string str ) : void
vwenv IVwEnv
color int
str string
return void

AddFreeformAnnotations() protected method

protected AddFreeformAnnotations ( IVwEnv vwenv, int hvoSeg ) : void
vwenv IVwEnv
hvoSeg int
return void

AddFreeformComment() protected method

protected AddFreeformComment ( IVwEnv vwenv, int hvoSeg, int lineChoiceIndex ) : void
vwenv IVwEnv
hvoSeg int
lineChoiceIndex int
return void

AddLabelPile() public method

Add the pile of labels used to identify the lines in interlinear text.
public AddLabelPile ( IVwEnv vwenv, ITsStrFactory tsf, SIL.FieldWorks.FDO.FdoCache cache, bool fWantMultipleSenseGloss, bool fShowMorphemes ) : void
vwenv IVwEnv
tsf ITsStrFactory
cache SIL.FieldWorks.FDO.FdoCache
fWantMultipleSenseGloss bool
fShowMorphemes bool
return void

AddWordBundleInternal() protected method

protected AddWordBundleInternal ( int hvo, IVwEnv vwenv ) : void
hvo int the IAnalysis object
vwenv IVwEnv
return void

CheckDisposed() public method

Throw if the IsDisposed property is true
public CheckDisposed ( ) : void
return void

Display() public method

public Display ( IVwEnv vwenv, int hvo, int frag ) : void
vwenv IVwEnv
hvo int
frag int
return void

DisplayAnalysisAndCloseInnerPile() protected method

Displays Analysis using DisplayWordBundleMethod and closes the views Inner Pile.
protected DisplayAnalysisAndCloseInnerPile ( IVwEnv vwenv, AnalysisOccurrence analysisOccurrence, bool showMultipleAnalyses ) : void
vwenv IVwEnv
analysisOccurrence AnalysisOccurrence
showMultipleAnalyses bool Tells DisplayWordBundleMethod whether or not to show /// the colored highlighting if a word has multiple analyses
return void

DisplayEmbeddedObject() public method

Display the specified object (from an ORC embedded in a string). Don't display any embedded objects in interlinear text.
public DisplayEmbeddedObject ( IVwEnv vwenv, int hvo ) : void
vwenv IVwEnv
hvo int
return void

DisplayVariant() public method

public DisplayVariant ( IVwEnv vwenv, int tag, int frag ) : ITsString
vwenv IVwEnv
tag int
frag int
return ITsString

DisplayVec() public method

public DisplayVec ( IVwEnv vwenv, int hvo, int tag, int frag ) : void
vwenv IVwEnv
hvo int
tag int
frag int
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool fDisposing ) : void
fDisposing bool
return void

EstimateHeight() public method

Estimate the height of things we display lazily.
public EstimateHeight ( int hvo, int frag, int dxAvailWidth ) : int
hvo int
frag int
dxAvailWidth int
return int

FormatGloss() protected method

Format the gloss line for the specified ws in an interlinear text
protected FormatGloss ( IVwEnv vwenv, int ws ) : void
vwenv IVwEnv
ws int
return void

GetGuessForWordform() public method

public GetGuessForWordform ( IWfiWordform wf, int ws ) : IAnalysis
wf IWfiWordform
ws int
return IAnalysis

GetSegmentLevelTags() protected method

Normally gets some virtual property tags we need for stuff above the bundle level. Code that is only using fragments at or below bundle may override this to do nothing, and then need not set up the virtual property handlers. See ConstChartVc.
protected GetSegmentLevelTags ( FdoCache cache ) : void
cache FdoCache
return void

InterlinVc() public method

Initializes a new instance of the InterlinVc class.
We use the default analysis writing system as the default, even though this view displays data in multiple writing systems. It's pretty arbitrary in this case, but we need a valid WS because if we get an ORC, we have to create a Ts String using some writing system.
public InterlinVc ( FdoCache cache ) : System
cache FdoCache The cache.
return System

LabelRGBFor() protected method

protected LabelRGBFor ( InterlinLineSpec spec ) : int
spec InterlinLineSpec
return int

LabelRGBFor() protected method

protected LabelRGBFor ( int choiceIndex ) : int
choiceIndex int
return int

LoadDataFor() public method

public LoadDataFor ( IVwEnv vwenv, int rghvo, int chvo, int hvoParent, int tag, int frag, int ihvoMin ) : void
vwenv IVwEnv
rghvo int
chvo int
hvoParent int
tag int
frag int
ihvoMin int
return void

LoadParaData() public method

public LoadParaData ( IStTxtPara para ) : void
para IStTxtPara
return void

ResetAnalysisCache() public method

Call this to clear the temporary cache of analyses. Minimally do this when data changes. Ideally no more often than necessary.
public ResetAnalysisCache ( ) : void
return void

SetColor() protected method

Called right before adding a string or opening a flow object, sets its color.
protected SetColor ( IVwEnv vwenv, int color ) : void
vwenv IVwEnv
color int
return void

SetupAndOpenInnerPile() protected method

Setup a box with 10 points behind and 5 under and open the inner pile
protected SetupAndOpenInnerPile ( IVwEnv vwenv ) : void
vwenv IVwEnv
return void

UpdatingOccurrence() public method

public UpdatingOccurrence ( IAnalysis oldAnalysis, IAnalysis newAnalysis ) : bool
oldAnalysis IAnalysis
newAnalysis IAnalysis
return bool

Property Details

m_analRepository protected_oe property

protected IWfiAnalysisRepository m_analRepository
return IWfiAnalysisRepository

m_coRepository protected_oe property

protected ICmObjectRepository m_coRepository
return ICmObjectRepository

m_fHaveOpenedParagraph protected_oe property

protected bool m_fHaveOpenedParagraph
return bool

m_fShowDefaultSense protected_oe property

protected bool m_fShowDefaultSense
return bool

m_segRepository protected_oe property

protected ISegmentRepository m_segRepository
return ISegmentRepository

m_stylesheet protected_oe property

protected IVwStylesheet m_stylesheet
return IVwStylesheet

m_wmbRepository protected_oe property

protected IWfiMorphBundleRepository m_wmbRepository
return IWfiMorphBundleRepository

m_wsAnalysis protected_oe property

protected int m_wsAnalysis
return int

m_wsManager protected_oe property

protected IWritingSystemManager m_wsManager
return IWritingSystemManager

m_wsUi protected_oe property

protected int m_wsUi
return int

m_wsVernForDisplay protected_oe property

protected int m_wsVernForDisplay
return int