Class TeXImportFilter

java.lang.Object
com.sun.star.lib.uno.helper.WeakBase
org.openoffice.da.comp.writer4latex.TeXImportFilter
All Implemented Interfaces:
com.sun.star.container.XNamed, com.sun.star.document.XFilter, com.sun.star.document.XImporter, com.sun.star.lang.XInitialization, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XTypeProvider, com.sun.star.uno.XInterface, com.sun.star.uno.XWeak

public class TeXImportFilter extends com.sun.star.lib.uno.helper.WeakBase implements com.sun.star.lang.XInitialization, com.sun.star.container.XNamed, com.sun.star.document.XImporter, com.sun.star.document.XFilter, com.sun.star.lang.XServiceInfo
This class implements an import filter for TeX documents using TeX4ht It is thus an implementation of the service com.sun.star.document.ImportFilter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.sun.star.lib.uno.helper.WeakBase

    _mapTypes

    Fields inherited from interface com.sun.star.document.XFilter

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.document.XImporter

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.lang.XInitialization

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.container.XNamed

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.lang.XServiceInfo

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.lang.XTypeProvider

    UNOTYPEINFO

    Fields inherited from interface com.sun.star.uno.XWeak

    UNOTYPEINFO
  • Constructor Summary

    Constructors
    Constructor
    Description
    TeXImportFilter(com.sun.star.uno.XComponentContext xContext)
    Construct a new TeXImportFilter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancel the filtering process.
    boolean
    filter(com.sun.star.beans.PropertyValue[] mediaDescriptor)
    Filter (import only) the document given by the media descriptor According to the service contract, we should understand either of the properties URL or InputStream, but currently we only use the former.
     
     
     
    boolean
    importTeX(com.sun.star.text.XTextDocument xText, String sURL, com.sun.star.task.XStatusIndicator xStatus)
    Import a TeX document with TeX4ht
    void
    initialize(Object[] arguments)
     
    void
    setName(String sName)
     
    void
    setTargetDocument(com.sun.star.lang.XComponent xDocument)
     
    boolean
     

    Methods inherited from class com.sun.star.lib.uno.helper.WeakBase

    finalize, getImplementationId, getTypes, queryAdapter

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • TeXImportFilter

      public TeXImportFilter(com.sun.star.uno.XComponentContext xContext)
      Construct a new TeXImportFilter
      Parameters:
      xContext - The Component Context
  • Method Details

    • getImplementationName

      public String getImplementationName()
      Specified by:
      getImplementationName in interface com.sun.star.lang.XServiceInfo
    • supportsService

      public boolean supportsService(String sService)
      Specified by:
      supportsService in interface com.sun.star.lang.XServiceInfo
    • getSupportedServiceNames

      public String[] getSupportedServiceNames()
      Specified by:
      getSupportedServiceNames in interface com.sun.star.lang.XServiceInfo
    • initialize

      public void initialize(Object[] arguments) throws com.sun.star.uno.Exception
      Specified by:
      initialize in interface com.sun.star.lang.XInitialization
      Throws:
      com.sun.star.uno.Exception
    • getName

      public String getName()
      Specified by:
      getName in interface com.sun.star.container.XNamed
    • setName

      public void setName(String sName)
      Specified by:
      setName in interface com.sun.star.container.XNamed
    • setTargetDocument

      public void setTargetDocument(com.sun.star.lang.XComponent xDocument) throws com.sun.star.lang.IllegalArgumentException
      Specified by:
      setTargetDocument in interface com.sun.star.document.XImporter
      Throws:
      com.sun.star.lang.IllegalArgumentException
    • filter

      public boolean filter(com.sun.star.beans.PropertyValue[] mediaDescriptor)
      Filter (import only) the document given by the media descriptor According to the service contract, we should understand either of the properties URL or InputStream, but currently we only use the former. We also use the property StatusIndicator: OOo internally uses this to pass around an XStatusIndicator instance, and if it's available we use it to display a progress bar
      Specified by:
      filter in interface com.sun.star.document.XFilter
      Parameters:
      mediaDescriptor - the Media Descriptor
    • cancel

      public void cancel()
      Cancel the filtering process. This will not only trigger cancellation, but also wait until it's finished
      Specified by:
      cancel in interface com.sun.star.document.XFilter
    • importTeX

      public boolean importTeX(com.sun.star.text.XTextDocument xText, String sURL, com.sun.star.task.XStatusIndicator xStatus)
      Import a TeX document with TeX4ht
      Parameters:
      xText - into this document
      sURL - from the TeX document given by this URL