3 * Renders a diff for a single slot.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup DifferenceEngine
25 * Renders a diff for a single slot (that is, a diff between two content objects).
27 * Callers should obtain this class by invoking ContentHandler::getSlotDiffRendererClass
28 * on the content handler of the new content object (ie. the one shown on the right side
29 * of the diff), or of the old one if the new one does not exist.
31 * The default implementation just does a text diff on the native text representation.
32 * Content handler extensions can subclass this to provide a more appropriate diff method by
33 * overriding ContentHandler::getSlotDiffRendererClass. Other extensions that want to interfere
34 * with diff generation in some way can use the GetSlotDiffRenderer hook.
36 * @ingroup DifferenceEngine
38 abstract class SlotDiffRenderer
{
41 * Get a diff between two content objects. One of them might be null (meaning a slot was
42 * created or removed), but both cannot be. $newContent (or if it's null then $oldContent)
43 * must have the same content model that was used to obtain this diff renderer.
44 * @param Content|null $oldContent
45 * @param Content|null $newContent
48 abstract public function getDiff( Content
$oldContent = null, Content
$newContent = null );
51 * Add modules needed for correct styling/behavior of the diff.
52 * @param OutputPage $output
54 public function addModules( OutputPage
$output ) {
58 * Return any extra keys to split the diff cache by.
61 public function getExtraCacheKeys() {