Lines Matching refs:this

116         $this->state = new ODTState();
119 $this->htmlStack = new cssdocument();
122 $this->styleset = new ODTDefaultStyles();
123 $this->styleset->import();
126 $this->page = new pageFormat();
127 $this->setStartPageFormat ('A4', 'portrait', 2, 2, 2, 2);
130 $this->units = new ODTUnits();
131 $this->units->setPixelPerEm(16);
132 $this->units->setTwipsPerPixelX(16);
133 $this->units->setTwipsPerPixelY(20);
136 $this->meta = new ODTMeta();
139 $this->manifest = new ODTManifest();
146 $this->ZIP = new \splitbrain\PHPArchive\Zip();
147 $this->ZIP->create();
150 $this->params = new ODTInternalParams();
157 $this->state->setDocument($this);
159 $this->params->document = $this;
160 $this->params->htmlStack = $this->htmlStack;
161 $this->params->units = $this->units;
162 $this->params->content = &$this->content;
163 $this->params->ZIP = $this->ZIP;
164 $this->params->manifest = $this->manifest;
165 $this->params->styleset = $this->styleset;
167 if (!isset($this->ZIP)) {
182 $this->CSSUsage = $usage;
185 $this->CSSUsage = 'off';
191 if (!isset($this->importnew)) {
193 $this->importnew = new cssimportnew();
194 if (!isset($this->importnew)) {
198 $this->params->import = $this->importnew;
207 if (!isset($this->importnew)) {
208 $this->setupImport();
210 $this->importnew->setMedia ($mediaSel);
234 $adjusted = $this->toPoints($value, 'x');
245 $adjusted = $this->toPoints($value, 'y');
258 $adjusted = $this->toPoints($value, 'y');
261 $adjusted = $this->toPoints($value, 'y');
273 $adjusted = $this->toPoints($value, 'y');
283 if (isset($this->importnew)) {
284 $this->importnew->replaceURLPrefixes ($callback);
289 $this->linksEnabled = true;
293 $this->linksEnabled = false;
312 $this->insertPendingPageBookmark();
317 $in_paragraph = $this->state->getInParagraph();
318 if ( ($this->pagebreakIsPending() || $this->pageFormatChangeIsPending()) ||
320 $this->paragraphOpen();
323 $this->content .= $this->replaceXMLEntities($text);
324 if ($this->text_empty && !ctype_space($text)) {
325 $this->text_empty = false;
336 $in_paragraph = $this->state->getInParagraph();
338 $this->paragraphOpen();
340 unset($this->params->elementObj);
341 ODTSpan::spanOpen($this->params, $styleName, $element, $attributes);
350 $in_paragraph = $this->state->getInParagraph();
352 $this->paragraphOpen();
355 $import = $this->importnew;
360 unset($this->params->elementObj);
361 $this->params->import = $import;
362 ODTSpan::spanOpenUseCSS($this->params, $element, $attributes);
363 $this->params->import = $this->importnew;
372 $in_paragraph = $this->state->getInParagraph();
374 $this->paragraphOpen();
376 ODTUtility::adjustValuesForODT($properties, $this->units);
377 unset($this->params->elementObj);
378 ODTSpan::spanOpenUseProperties($this->params, $properties);
388 unset($this->params->elementObj);
389 ODTSpan::spanClose($this->params);
400 ODTSpan::generateSpansfromHTMLCode($this->params, $HTMLCode);
410 unset($this->params->elementObj);
411 ODTParagraph::paragraphOpen($this->params, $styleName, $element, $attributes);
420 unset($this->params->elementObj);
421 ODTParagraph::paragraphClose($this->params);
431 $import = $this->importnew;
436 unset($this->params->elementObj);
437 $this->params->import = $import;
438 ODTParagraph::paragraphOpenUseCSS($this->params, $element, $attributes);
439 $this->params->import = $this->importnew;
448 ODTUtility::adjustValuesForODT($properties, $this->units);
449 unset($this->params->elementObj);
450 ODTParagraph::paragraphOpenUseProperties($this->params, $properties);
457 $this->paragraphClose();
458 $styleName = $this->getStyleName('horizontal line');
459 $this->paragraphOpen($styleName);
460 $this->paragraphClose();
463 $this->preventDeletetionStyles [] = $styleName;
485 $style = $this->getStyleName('preformatted');
488 $text = $this->replaceXMLEntities($text);
506 $text = preg_replace_callback('/( +)/',array($this,'_preserveSpace'),$text);
508 $list_item = $this->state->getCurrentListItem();
511 $this->paragraphClose();
512 $this->paragraphOpen($style);
513 $this->content .= $text;
514 $this->paragraphClose();
516 $this->paragraphOpen();
518 $this->paragraphClose();
519 $this->paragraphOpen($style);
520 $this->content .= $text;
521 $this->paragraphClose();
529 $this->content .= '<text:line-break/>';
540 $this->paragraphClose();
541 $this->pagebreak = true;
550 return $this->pagebreak;
559 if (isset($this->changePageFormat)) {
571 return $this->pagebreak = $value;
580 return in_array($title, $this->headers);
589 $this->headers[] = $title;
598 ODTIndex::insertIndex($this->params, $this->indexesData, $type, $settings);
617 $this->refIDCount++;
622 $ref = '__RefHeading___'.$title.'_'.$this->refIDCount;
636 $this->toc[] = $item;
646 $inParagraph = $this->state->getInParagraph();
648 $this->insertBookmarkInternal($id, true);
650 $this->pageBookmark = $id;
665 $this->insertBookmarkInternal($id);
667 $this->pageBookmark = $id;
678 $this->paragraphOpen();
680 $this->content .= '<text:bookmark text:name="'.$id.'"/>';
681 $this->bookmarks [] = $id;
693 if ( !empty($this->pageBookmark) ) {
694 $this->insertBookmarkInternal($this->pageBookmark, false);
695 $this->pageBookmark = NULL;
708 ODTHeading::heading($this->params, $text, $level, $element, $attributes);
733 $name = $this->cleanupUserFieldName($name);
734 $this->fields [$name] = $value;
745 $name = $this->cleanupUserFieldName($name);
746 if (array_key_exists($name, $this->fields)) {
747 …$this->content .= '<text:user-field-get text:name="'.$name.'">'.$this->fields [$name].'</text:user…
759 foreach ($this->fields as $fname => $fvalue) {
774 $this->paragraphClose();
777 $styleName = $this->getStyleName('local link');
778 $visitedStyleName = $this->getStyleName('visited local link');
779 …ODTUtility::replaceLocalLinkPlaceholders($this->content, $this->toc, $this->bookmarks, $styleName,…
782 ODTIndex::replaceIndexesPlaceholders($this->params, $this->indexesData, $this->toc);
785 ODTUtility::deleteUselessElements($this->content, $this->preventDeletetionStyles);
790 if (!empty($this->trace_dump)) {
791 $this->paragraphOpen();
792 $this->linebreak();
793 $this->content .= 'Tracedump: ';
794 $this->addPreformattedText($this->trace_dump);
795 $this->paragraphClose();
799 $metaContent = $this->meta->getContent();
802 $userFieldDecls = $this->getUserFieldDecls();
805 ODTExport::buildZIPFile($this->params,
808 $this->pageStyles,
813 return $this->ZIP->getArchive();
826 if ($this->CSSUsage == 'basic' || $this->CSSUsage == 'full' || $forceStyles) {
829 …Import::importCSSFromString ($this->params, $cssCode, $mediaSel, array($this, 'adjustLengthCallbac…
842 if ($this->CSSUsage == 'basic' || $this->CSSUsage == 'full') {
845 …Import::importCSSFromFile ($this->params, $CSSTemplate, $mediaSel, array($this, 'adjustLengthCallb…
849 ODTImport::importODTStyles($this->params, $template, $tempDir);
859 $current = $this->state->getCurrent();
861 $this->content .= $current->getClosingTag($this->content);
862 $this->state->leave();
877 if ( !isset($this->changePageFormat) ) {
881 $data = $this->changePageFormat;
882 $this->changePageFormat = NULL;
889 …$format_string = $this->page->formatToString ($data['format'], $data['orientation'], $data['margin…
901 if (($this->CSSUsage == 'basic' || $this->CSSUsage == 'full') && isset($this->importnew)) {
902 ODTImport::set_page_properties($this->params, $style_obj);
907 $this->pageStyles [$master_page_style_name] = $style_name;
908 $this->addAutomaticStyle($style_obj);
909 …$this->page->setFormat($data ['format'], $data ['orientation'], $data['margin-top'], $data['margin…
919 $this->addAutomaticStyle($style_obj);
922 $this->preventDeletetionStyles [] = $style_name;
935 if ( !$this->styleExists($style_name) ) {
937 $this->addAutomaticStyle($style_obj);
940 $this->preventDeletetionStyles [] = $style_name;
963 ODTFootnote::footnoteOpen($this->params);
973 ODTFootnote::footnoteClose($this->params);
978 if ( $this->quote_depth < 5 ) {
979 $this->quote_depth++;
981 unset($this->params->elementObj);
982 …ODTTable::tableOpen($this->params, 1, 1, 'Table_Quotation'.$this->quote_depth, 'blockquote', NULL);
983 $this->tableRowOpen();
984 unset($this->params->elementObj);
985 …ODTTable::tableCellOpen($this->params, 1, 1, 'left', 'Cell_Quotation'.$this->quote_depth, NULL, NU…
989 $this->paragraphClose();
990 $this->tableCellClose();
991 $this->tableRowClose();
992 $this->tableClose();
993 if ( $this->quote_depth > 0 ) {
994 $this->quote_depth--;
1008 if ($styleName == $this->getStyleName('list')) {
1011 if ($styleName == $this->getStyleName('numbering')) {
1015 ODTList::listOpen($this->params, $continue, $styleName, $element, $attributes);
1024 ODTList::listClose($this->params);
1034 ODTList::listItemOpen($this->params, $level, $element, $attributes);
1043 ODTList::listItemClose($this->params);
1053 ODTList::listHeaderOpen($this->params, $level, $element, $attributes);
1062 ODTList::listHeaderClose($this->params);
1071 ODTList::listContentOpen($this->params, $element, $attributes);
1080 ODTList::listContentClose($this->params);
1091 unset($this->params->elementObj);
1092 ODTTable::tableOpen($this->params, $maxcols, $numrows, NULL, $element, $attributes);
1103 unset($this->params->elementObj);
1104 ODTTable::tableClose($this->params);
1113 unset($this->params->elementObj);
1114 ODTTable::tableAddColumn ($this->params);
1123 unset($this->params->elementObj);
1124 ODTTable::tableRowOpen($this->params, NULL, $element, $attributes);
1133 unset($this->params->elementObj);
1134 ODTTable::tableRowClose($this->params);
1143 unset($this->params->elementObj);
1144 …ODTTable::tableHeaderOpen($this->params, $colspan, $rowspan, $align, NULL, NULL, $element, $attrib…
1153 unset($this->params->elementObj);
1154 ODTTable::tableHeaderClose($this->params);
1163 unset($this->params->elementObj);
1164 …ODTTable::tableCellOpen($this->params, $colspan, $rowspan, $align, NULL, NULL, $element, $attribut…
1173 unset($this->params->elementObj);
1174 ODTTable::tableCellClose($this->params);
1184 $import = $this->importnew;
1190 unset($this->params->elementObj);
1191 $this->params->import = $import;
1192 ODTTable::tableOpenUseCSS($this->params, $maxcols, $numrows, $element, $attributes);
1193 $this->params->import = $this->importnew;
1202 unset($this->params->elementObj);
1203 ODTTable::tableOpenUseProperties($this->params, $properties, $maxcols, $numrows);
1212 unset($this->params->elementObj);
1213 ODTTable::tableAddColumnUseProperties($this->params, $properties);
1223 $import = $this->importnew;
1229 unset($this->params->elementObj);
1230 $this->params->import = $import;
1231 ODTTable::tableHeaderOpenUseCSS($this->params, $colspan, $rowspan, $element, $attributes);
1232 $this->params->import = $this->importnew;
1241 unset($this->params->elementObj);
1242 ODTTable::tableHeaderOpenUseProperties($this->params, $properties, $colspan, $rowspan);
1252 $import = $this->importnew;
1258 unset($this->params->elementObj);
1259 $this->params->import = $import;
1260 ODTTable::tableRowOpenUseCSS($this->params, $element, $attributes);
1261 $this->params->import = $this->importnew;
1270 unset($this->params->elementObj);
1271 ODTTable::tableRowOpenUseProperties($this->params, $properties);
1281 $import = $this->importnew;
1287 unset($this->params->elementObj);
1288 $this->params->import = $import;
1289 ODTTable::tableCellOpenUseCSS($this->params, $element, $attributes, $colspan, $rowspan);
1290 $this->params->import = $this->importnew;
1299 unset($this->params->elementObj);
1300 ODTTable::tableCellOpenUseProperties($this->params, $properties, $colspan, $rowspan);
1310 $import = $this->importnew;
1316 unset($this->params->elementObj);
1317 $this->params->import = $import;
1318 ODTFrame::openTextBoxUseCSS($this->params, $element, $attributes);
1319 $this->params->import = $this->importnew;
1328 unset($this->params->elementObj);
1329 ODTFrame::openTextBoxUseProperties($this->params, $properties);
1338 unset($this->params->elementObj);
1339 ODTFrame::closeTextBox($this->params);
1348 unset($this->params->elementObj);
1349 ODTFrame::openFrameUseProperties($this->params, $properties);
1358 unset($this->params->elementObj);
1359 ODTFrame::closeFrame($this->params);
1368 unset($this->params->elementObj);
1369 ODTFrame::openMultiColumnTextBoxUseProperties($this->params, $properties);
1378 unset($this->params->elementObj);
1379 ODTFrame::closeMultiColumnTextBox($this->params);
1390 $outline_style = $this->getStyle('Outline');
1421 $style_obj = ODTTextStyle::createTextStyle($properties, NULL, $this);
1423 $this->addStyle($style_obj);
1425 $this->addAutomaticStyle($style_obj);
1443 $style_obj = ODTParagraphStyle::createParagraphStyle($properties, NULL, $this);
1445 $this->addStyle($style_obj);
1447 $this->addAutomaticStyle($style_obj);
1467 $this->addStyle($style_obj);
1469 $this->addAutomaticStyle($style_obj);
1489 $this->addStyle($style_obj);
1491 $this->addAutomaticStyle($style_obj);
1511 $this->addStyle($style_obj);
1513 $this->addAutomaticStyle($style_obj);
1533 $this->addStyle($style_obj);
1535 $this->addAutomaticStyle($style_obj);
1556 return ODTUtility::getImageSizeString($src, $width, $height, false, $this->params->units);
1574 …return ODTImage::addImage($this->params, $src, $width, $height, $align, $title, $style, $returnonl…
1576 … ODTImage::addImage($this->params, $src, $width, $height, $align, $title, $style, $returnonly);
1591 return ODTImage::addImageUseProperties($this->params, $src, $properties, $returnonly);
1593 ODTImage::addImageUseProperties($this->params, $src, $properties, $returnonly);
1604 return ODTImage::addStringAsSVGImageFile($this, $string);
1613 …return ODTImage::addStringAsSVGImage($this->params, $string, $width, $height, $align, $title, $sty…
1622 ODTUtility::getCSSStylePropertiesForODT($properties, $style, $baseURL, $this->units);
1640 $this->page->setFormat
1644 $first_page = $this->getStyleByAlias('first page');
1646 $first_page->setProperty('width', $this->page->getWidth().'cm');
1647 $first_page->setProperty('height', $this->page->getHeight().'cm');
1648 $first_page->setProperty('margin-top', $this->page->getMarginTop().'cm');
1649 $first_page->setProperty('margin-right', $this->page->getMarginRight().'cm');
1650 $first_page->setProperty('margin-bottom', $this->page->getMarginBottom().'cm');
1651 $first_page->setProperty('margin-left', $this->page->getMarginLeft().'cm');
1672 $format = $this->page->getFormat();
1675 $orientation = $this->page->getOrientation();
1678 $margin_top = $this->page->getMarginTop();
1681 $margin_right = $this->page->getMarginRight();
1684 $margin_bottom = $this->page->getMarginBottom();
1687 $margin_left = $this->page->getMarginLeft();
1691 …$this->page->queryFormat ($data, $format, $orientation, $margin_top, $margin_right, $margin_bottom…
1692 …$format_string = $this->page->formatToString ($data['format'], $data['orientation'], $data['margin…
1694 if ( $format_string == $this->page->toString () ) {
1699 if ($this->text_empty) {
1701 …$this->page->setFormat($data ['format'], $data ['orientation'], $data['margin-top'], $data['margin…
1702 $first_page = $this->getStyleByAlias('first page');
1704 $first_page->setProperty('width', $this->page->getWidth().'cm');
1705 $first_page->setProperty('height', $this->page->getHeight().'cm');
1706 $first_page->setProperty('margin-top', $this->page->getMarginTop().'cm');
1707 $first_page->setProperty('margin-right', $this->page->getMarginRight().'cm');
1708 $first_page->setProperty('margin-bottom', $this->page->getMarginBottom().'cm');
1709 $first_page->setProperty('margin-left', $this->page->getMarginLeft().'cm');
1715 $this->changePageFormat = $data;
1718 $this->paragraphClose();
1729 return $this->page->getWidth();
1739 return $this->page->getHeight();
1748 return $this->page->getMarginLeft();
1757 return $this->page->getMarginRight();
1766 return $this->page->getMarginTop();
1775 return $this->page->getMarginBottom();
1791 return $this->page->getRelWidthMindMargins($percentage);
1803 return $this->page->getAbsWidthMindMargins($percentage);
1819 return $this->page->getRelHeightMindMargins($percentage);
1832 return $this->page->getAbsHeightMindMargins($percentage);
1841 $this->units->setTwipsPerPixelX ($value);
1850 $this->units->setTwipsPerPixelY ($value);
1859 $this->units->setPixelPerEm ($value);
1871 return $this->units->toPoints ($value, $axis);
1883 return $this->units->toPixel ($value, $axis);
1888 $this->meta->setTitle($title);
1900 $index = count($this->toc);
1902 $item = $this->toc[$index];
1924 $this->content .= '<locallink name="'.$text.'">'.$destination.'</locallink>';
1929 if ($this->linksEnabled) {
1936 $this->content .= $encoded;
1941 if ($this->linksEnabled) {
1947 $this->content .= $encoded;
1952 if ($url && $this->linksEnabled) {
1954 $styleName = $this->getStyleName('internet link');
1957 $visitedStyleName = $this->getStyleName('visited internet link');
1968 $this->content .= $encoded;
1973 if ($this->linksEnabled) {
1979 $this->content .= $encoded;
1984 if ($url && $this->linksEnabled) {
1986 $styleName = $this->getStyleName('internet link');
1989 $visitedStyleName = $this->getStyleName('visited internet link');
1999 if ($url && $this->linksEnabled) {
2005 $this->content .= $encoded;
2019 if (!isset($this->importnew)) {
2023 $save = $this->importnew->getMedia();
2024 $this->importnew->setMedia($media_sel);
2026 $maxWidth = $this->getAbsWidthMindMargins().'cm';
2027 …ODTUtility::getHTMLElementProperties($this->params, $dest, $element, $attributes, $maxWidth, $inhe…
2029 $this->importnew->setMedia($save);
2033 if (!isset($this->importnew)) {
2037 $save = $this->importnew->getMedia();
2038 $this->importnew->setMedia($media_sel);
2041 $this->importnew->getPropertiesForElement($dest, $element, $this->units, $inherit);
2044 $maxWidth = $this->getAbsWidthMindMargins().'cm';
2045 ODTUtility::adjustValuesForODT($dest, $this->units, $maxWidth);
2047 $this->importnew->setMedia($save);
2051 ODTUtility::adjustValuesForODT($properties, $this->units);
2055 return ODTUtility::adjustValueForODT($property, $value, $this->units);
2069 $this->htmlStack->open($element, $attributes);
2070 $this->htmlStack->saveRootIndex ();
2074 return $this->htmlStack;
2078 $this->trace_dump .= $this->htmlStack->getDump();
2089 return $this->manifest->exists($name);
2101 if(!$this->manifest->exists($fileName)){
2102 $this->manifest->add($fileName, $mime);
2103 $this->ZIP->addData($fileName, $content);
2124 $this->addFile($name, $mime, io_readfile($fileName,false));
2135 return $this->styleset->addStyle($new);
2144 return $this->styleset->addAutomaticStyle($new);
2154 return $this->styleset->styleExists($name);
2164 return $this->styleset->getStyle($styleName);
2168 return $this->styleset->getDefaultStyle($family);
2178 return $this->styleset->getStyleName($alias);
2188 return $this->styleset->getStyleAtIndex($element, $index);
2198 return $this->styleset->getStyle($this->styleset->getStyleName($alias));
2202 $this->registrations [$style_type]['element'] = $element;
2203 $this->registrations [$style_type]['attributes'] = $attributes;
2207 $valueInPt = $this->units->toPoints($value, 'y');
2208 $valueInPt = $this->units->getDigits($valueInPt);
2209 $addInPt = $this->units->toPoints($add, 'y');
2210 $addInPt = $this->units->getDigits($addInPt);
2215 $valueInPt = $this->units->toPoints($value, 'y');
2216 $valueInPt = $this->units->getDigits($valueInPt);
2217 $subInPt = $this->units->toPoints($sub, 'y');
2218 $subInPt = $this->units->getDigits($subInPt);
2231 $default = $this->styleset->getDefaultStyle('paragraph');
2240 $oldBaseSizeInPt = trim($this->units->toPoints($oldBaseSize, 'y'), 'pt');
2243 $newBaseSizeInPt = trim($this->units->toPoints($newBaseSize, 'y'), 'pt');
2246 $styles_list [] = $this->styleset->getStyles();
2247 $styles_list [] = $this->styleset->getAutomaticStyles();
2248 $styles_list [] = $this->styleset->getMasterStyles();
2256 $fontSizeInPt = trim($this->units->toPoints($fontSize, 'y'), 'pt');
2264 $this->trace_dump .= 'newBaseSize: '.$newBaseSize."\n";
2265 $this->trace_dump .= 'newBaseSizeInPt: '.$newBaseSizeInPt."\n";
2284 $name = $this->styleset->getStyleName('numbering');
2285 $style = $this->styleset->getStyle($name);
2357 $name = $this->styleset->getStyleName('list');
2358 $style = $this->styleset->getStyle($name);
2423 ODTUtility::generateODTfromHTMLCode($this->params, $HTMLCode, $options);