1<?php
2
3class InlineContentBuilderFactory {
4  function &get($whitespace) {
5    switch ($whitespace) {
6    case WHITESPACE_NORMAL:
7      require_once(HTML2PS_DIR.'inline.content.builder.normal.php');
8      $builder =& new InlineContentBuilderNormal();
9      break;
10    case WHITESPACE_PRE:
11      require_once(HTML2PS_DIR.'inline.content.builder.pre.php');
12      $builder =& new InlineContentBuilderPre();
13      break;
14    case WHITESPACE_NOWRAP:
15      require_once(HTML2PS_DIR.'inline.content.builder.nowrap.php');
16      $builder =& new InlineContentBuilderNowrap();
17      break;
18    case WHITESPACE_PRE_WRAP:
19      require_once(HTML2PS_DIR.'inline.content.builder.pre.wrap.php');
20      $builder =& new InlineContentBuilderPreWrap();
21      break;
22    case WHITESPACE_PRE_LINE:
23      require_once(HTML2PS_DIR.'inline.content.builder.pre.line.php');
24      $builder =& new InlineContentBuilderPreLine();
25      break;
26    default:
27      trigger_error('Internal error: unknown whitespace enumeration value', E_USER_ERROR);
28    };
29
30    return $builder;
31  }
32}
33
34?>