X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FContent.php;h=75ac5f2993a2c4b3524f9c14e586f4153ff4d2b4;hb=2f5b0c4d2664ca339d2cb14a85439813c88961c7;hp=3c776941bcff0934ba56dbb366e61d7681033888;hpb=664884900d18bb608aaa5748edeb4ac1a9a6a957;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/Content.php b/includes/content/Content.php index 3c776941bc..75ac5f2993 100644 --- a/includes/content/Content.php +++ b/includes/content/Content.php @@ -25,6 +25,12 @@ * * @author Daniel Kinzler */ + +/** + * Base interface for content objects. + * + * @ingroup Content + */ interface Content { /** @@ -42,7 +48,7 @@ interface Content { /** * @since 1.21 * - * @return string The wikitext to include when another page includes this + * @return string|false The wikitext to include when another page includes this * content, or false if the content is not includable in a wikitext page. * * @todo allow native handling, bypassing wikitext representation, like @@ -481,7 +487,20 @@ interface Content { */ public function matchMagicWord( MagicWord $word ); - // TODO: ImagePage and CategoryPage interfere with per-content action handlers + /** + * Converts this content object into another content object with the given content model, + * if that is possible. + * + * @param String $toModel the desired content model, use the CONTENT_MODEL_XXX flags. + * @param String $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is + * not allowed, full round-trip conversion is expected to work without losing information. + * + * @return Content|bool A content object with the content model $toModel, or false if + * that conversion is not supported. + */ + public function convert( $toModel, $lossy = '' ); + + // TODO: ImagePage and CategoryPage interfere with per-content action handlers // TODO: nice&sane integration of GeSHi syntax highlighting // [11:59] Hooks are ugly; make CodeHighlighter interface and a // config to set the class which handles syntax highlighting