Automatically generated installer lang files
[moodle.git] / files / classes / converter_interface.php
blob52c1a946f3b4f73c469ff28e8579d67bebb26630
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * Class for converting files between different file formats.
20 * @package core_files
21 * @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 namespace core_files;
26 defined('MOODLE_INTERNAL') || die();
28 /**
29 * Class for converting files between different file formats.
31 * @package docconvert_unoconv
32 * @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 interface converter_interface {
37 /**
38 * Whether the plugin is configured and requirements are met.
40 * Note: This function may be called frequently and caching is advisable.
42 * @return bool
44 public static function are_requirements_met();
46 /**
47 * Convert a document to a new format and return a conversion object relating to the conversion in progress.
49 * @param conversion $conversion The file to be converted
50 * @return $this
52 public function start_document_conversion(conversion $conversion);
54 /**
55 * Poll an existing conversion for status update.
57 * @param conversion $conversion The file to be converted
58 * @return $this
60 public function poll_conversion_status(conversion $conversion);
62 /**
63 * Determine whether a conversion between the two supplied formats is achievable.
65 * Note: This function may be called frequently and caching is advisable.
67 * @param string $from The source type
68 * @param string $to The destination type
69 * @return bool
71 public static function supports($from, $to);
73 /**
74 * A list of the supported conversions.
76 * Note: This information is only displayed to administrators.
78 * @return string
80 public function get_supported_conversions();