Class 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 java.lang.String __implementationName  
      static java.lang.String __serviceName  
      static int FILTERPROC_BREAKING  
      static int FILTERPROC_RUNNING  
      static int FILTERPROC_STOPPED  
      • 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()
      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.
      java.lang.String getImplementationName()  
      java.lang.String getName()  
      java.lang.String[] getSupportedServiceNames()  
      boolean importTeX​(com.sun.star.text.XTextDocument xText, java.lang.String sURL, com.sun.star.task.XStatusIndicator xStatus)
      Import a TeX document with TeX4ht
      void initialize​(java.lang.Object[] arguments)  
      void setName​(java.lang.String sName)  
      void setTargetDocument​(com.sun.star.lang.XComponent xDocument)  
      boolean supportsService​(java.lang.String sService)  
      • 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 Detail

      • __implementationName

        public static final java.lang.String __implementationName
    • Constructor Detail

      • TeXImportFilter

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

      • getImplementationName

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

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

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

        public void initialize​(java.lang.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 java.lang.String getName()
        Specified by:
        getName in interface com.sun.star.container.XNamed
      • setName

        public void setName​(java.lang.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,
                                 java.lang.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