public interface IFilter
Modifier and Type | Method and Description |
---|---|
void |
alignFile(java.io.File inFile,
java.io.File outFile,
java.util.Map<java.lang.String,java.lang.String> config,
FilterContext context,
IAlignCallback callback)
Align source and translated files.
|
java.util.Map<java.lang.String,java.lang.String> |
changeOptions(java.awt.Dialog parent,
java.util.Map<java.lang.String,java.lang.String> config)
Deprecated.
|
default java.util.Map<java.lang.String,java.lang.String> |
changeOptions(java.awt.Window parent,
java.util.Map<java.lang.String,java.lang.String> config)
Show change options dialog for able to change options.
|
Instance[] |
getDefaultInstances()
The default list of filter instances that this filter class has.
|
java.lang.String |
getFileFormatName()
Human-readable name of the File Format this filter supports.
|
java.lang.String |
getFuzzyMark()
Define fuzzy mark prefix for source which will be stored in TM.
|
java.lang.String |
getHint()
Returns the hint displayed while the user edits the filter, and when she adds/edits the instance of
this filter.
|
java.lang.String |
getInEncodingLastParsedFile()
Returns the encoding of the last parsed source file.
|
boolean |
hasOptions() |
default boolean |
isBilingual()
Indicates whether the filter is bilingual, and thus can be used as external TM
(i.e.
|
boolean |
isFileSupported(java.io.File inFile,
java.util.Map<java.lang.String,java.lang.String> config,
FilterContext context)
Returns whether the file is supported by the filter, given the file and possible file's encoding (
null encoding means autodetect). |
boolean |
isSourceEncodingVariable()
Whether source encoding can be varied by the user.
|
boolean |
isTargetEncodingVariable()
Whether target encoding can be varied by the user.
|
void |
parseFile(java.io.File inFile,
java.util.Map<java.lang.String,java.lang.String> config,
FilterContext context,
IParseCallback callback)
Parse single file.
|
void |
translateFile(java.io.File inFile,
java.io.File outFile,
java.util.Map<java.lang.String,java.lang.String> config,
FilterContext context,
ITranslateCallback callback)
Create translated file.
|
java.lang.String getFileFormatName()
java.lang.String getHint()
Instance[] getDefaultInstances()
Note that the user may change the instances freely.
boolean isSourceEncodingVariable()
True means that OmegaT should handle all the encoding mess.
Return false to state that your filter doesn't need encoding management provided by OmegaT, because it either autodetects the encoding based on file contents (like HTML filter does) or the encoding is fixed (like in OpenOffice files).
boolean isTargetEncodingVariable()
True means that OmegaT should handle all the encoding mess.
Return false to state that your filter doesn't need encoding management provided by OmegaT, because the encoding is fixed (like in OpenOffice files), or for some other reason.
java.lang.String getFuzzyMark()
boolean isFileSupported(java.io.File inFile, java.util.Map<java.lang.String,java.lang.String> config, FilterContext context)
null
encoding means autodetect).
For example, DocBook files have .xml extension, as possibly many other XML files, so the filter should check a DTD of the document.
inFile
- Source file.config
- filter's configuration optionscontext
- processing contextvoid parseFile(java.io.File inFile, java.util.Map<java.lang.String,java.lang.String> config, FilterContext context, IParseCallback callback) throws java.lang.Exception
inFile
- file to parseconfig
- filter's configuration optionscontext
- processing contextcallback
- callback for parsed datajava.lang.Exception
void translateFile(java.io.File inFile, java.io.File outFile, java.util.Map<java.lang.String,java.lang.String> config, FilterContext context, ITranslateCallback callback) throws java.lang.Exception
inFile
- source fileoutFile
- output fileconfig
- filter's configuration optionscontext
- processing contextcallback
- callback for get translationjava.lang.Exception
void alignFile(java.io.File inFile, java.io.File outFile, java.util.Map<java.lang.String,java.lang.String> config, FilterContext context, IAlignCallback callback) throws java.lang.Exception
inFile
- source fileoutFile
- translated fileconfig
- filter's configuration optionscontext
- processing contextcallback
- callback for store aligned datajava.lang.Exception
boolean hasOptions()
@Deprecated java.util.Map<java.lang.String,java.lang.String> changeOptions(java.awt.Dialog parent, java.util.Map<java.lang.String,java.lang.String> config)
Deprecated; please use changeOptions(Window, Map)
instead.
parent
- parent windowconfig
- old optionsdefault java.util.Map<java.lang.String,java.lang.String> changeOptions(java.awt.Window parent, java.util.Map<java.lang.String,java.lang.String> config)
parent
- parent windowconfig
- old optionsjava.lang.String getInEncodingLastParsedFile()
default boolean isBilingual()
IParseCallback
.addEntry().true
if the filter is bilingual