Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
fileconverter_unoconv\converter Class Reference

Class for converting files between different formats using unoconv. More...

Inheritance diagram for fileconverter_unoconv\converter:
core_files\converter_interface

Public Member Functions

 get_supported_conversions ()
 A list of the supported conversions. More...
 
 poll_conversion_status (conversion $conversion)
 Poll an existing conversion for status update. More...
 
 serve_test_document ()
 Generate and serve the test document. More...
 
 start_document_conversion (\core_files\conversion $conversion)
 Convert a document to a new format and return a conversion object relating to the conversion in progress. More...
 
 start_document_conversion (conversion $conversion)
 Convert a document to a new format and return a conversion object relating to the conversion in progress. More...
 

Static Public Member Functions

static are_requirements_met ()
 Whether the plugin is configured and requirements are met. More...
 
static supports ($from, $to)
 Whether a file conversion can be completed using this converter. More...
 
static test_unoconv_path ()
 Whether the plugin is fully configured. More...
 

Public Attributes

const UNOCONVPATH_DOESNOTEXIST = 'doesnotexist'
 Does not exist.
 
const UNOCONVPATH_EMPTY = 'empty'
 Not set.
 
const UNOCONVPATH_ERROR = 'error'
 Any other error.
 
const UNOCONVPATH_ISDIR = 'isdir'
 Is a dir.
 
const UNOCONVPATH_NOTESTFILE = 'notestfile'
 Test file missing.
 
const UNOCONVPATH_NOTEXECUTABLE = 'notexecutable'
 Not executable.
 
const UNOCONVPATH_OK = 'ok'
 No errors.
 
const UNOCONVPATH_VERSIONNOTSUPPORTED = 'versionnotsupported'
 Version not supported.
 

Static Protected Member Functions

static fetch_supported_formats ()
 Fetch the list of supported file formats. More...
 
static is_format_supported ($format)
 Whether the specified file format is supported. More...
 
static is_minimum_version_met ()
 Whether the minimum version of unoconv has been met. More...
 

Static Protected Attributes

static array $formats
 $formats The list of formats supported by unoconv.
 
static bool $requirementsmet = null
 $requirementsmet Whether requirements have been met.
 

Detailed Description

Class for converting files between different formats using unoconv.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ are_requirements_met()

static fileconverter_unoconv\converter::are_requirements_met ( )
static

Whether the plugin is configured and requirements are met.

Return values
bool

Implements core_files\converter_interface.

◆ fetch_supported_formats()

static fileconverter_unoconv\converter::fetch_supported_formats ( )
staticprotected

Fetch the list of supported file formats.

Return values
array

◆ get_supported_conversions()

fileconverter_unoconv\converter::get_supported_conversions ( )

A list of the supported conversions.

Return values
string

Implements core_files\converter_interface.

◆ is_format_supported()

static fileconverter_unoconv\converter::is_format_supported (   $format)
staticprotected

Whether the specified file format is supported.

Parameters
string$formatWhether conversions between this format and another are supported
Return values
bool

◆ is_minimum_version_met()

static fileconverter_unoconv\converter::is_minimum_version_met ( )
staticprotected

Whether the minimum version of unoconv has been met.

Return values
bool

◆ poll_conversion_status()

fileconverter_unoconv\converter::poll_conversion_status ( conversion  $conversion)

Poll an existing conversion for status update.

Parameters
conversion$conversionThe file to be converted
Return values
$this

Implements core_files\converter_interface.

◆ serve_test_document()

fileconverter_unoconv\converter::serve_test_document ( )

Generate and serve the test document.

Return values
void

◆ start_document_conversion() [1/2]

fileconverter_unoconv\converter::start_document_conversion ( \core_files\conversion  $conversion)

Convert a document to a new format and return a conversion object relating to the conversion in progress.

Parameters
conversion$conversionThe file to be converted
Return values
$this

◆ start_document_conversion() [2/2]

core_files\converter_interface::start_document_conversion ( conversion  $conversion)
inherited

Convert a document to a new format and return a conversion object relating to the conversion in progress.

Parameters
conversion$conversionThe file to be converted
Return values
$this

◆ supports()

static fileconverter_unoconv\converter::supports (   $from,
  $to 
)
static

Whether a file conversion can be completed using this converter.

Parameters
string$fromThe source type
string$toThe destination type
Return values
bool

Implements core_files\converter_interface.

◆ test_unoconv_path()

static fileconverter_unoconv\converter::test_unoconv_path ( )
static

Whether the plugin is fully configured.

Return values
stdClass

The documentation for this class was generated from the following file: