ShopPart::get_images um Parameter binary anstatt base64 erweitert
[kivitendo-erp.git] / SL / Template / OpenDocument / Styles.pm
1 package SL::Template::OpenDocument::Styles;
2
3 use strict;
4 use utf8;
5
6 use Carp;
7
8 my %styles = (
9   text_basic => qq|
10     <style:style style:name="TKIVITENDOBOLD" style:family="text">
11       <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
12     </style:style>
13     <style:style style:name="TKIVITENDOITALIC" style:family="text">
14       <style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
15     </style:style>
16     <style:style style:name="TKIVITENDOUNDERLINE" style:family="text">
17       <style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color"/>
18     </style:style>
19     <style:style style:name="TKIVITENDOSTRIKETHROUGH" style:family="text">
20       <style:text-properties style:text-line-through-style="solid"/>
21     </style:style>
22     <style:style style:name="TKIVITENDOSUPER" style:family="text">
23       <style:text-properties style:text-position="super 58%"/>
24     </style:style>
25     <style:style style:name="TKIVITENDOSUB" style:family="text">
26       <style:text-properties style:text-position="sub 58%"/>
27     </style:style>
28     <style:style style:name="TKIVITENDOBULLETS" style:family="text">
29       <style:text-properties style:font-name="OpenSymbol" fo:font-family="OpenSymbol" style:font-charset="x-symbol" style:font-name-asian="OpenSymbol" style:font-family-asian="OpenSymbol" style:font-charset-asian="x-symbol" style:font-name-complex="OpenSymbol" style:font-family-complex="OpenSymbol" style:font-charset-complex="x-symbol"/>
30     </style:style>
31     <style:style style:name="TKIVITENDONUMBERING" style:family="text"/>
32 |,
33
34   text_list_item => qq|
35     <style:style style:name="PKIVITENDO__TYPE____PARENT__" style:family="paragraph" style:parent-style-name="__PARENT__" style:list-style-name="LKIVITENDO__TYPE____PARENT__">
36       <style:text-properties officeooo:rsid="002df67b" officeooo:paragraph-rsid="002df67b"/>
37     </style:style>
38 |,
39
40   list_itemize => qq|
41     <text:list-style style:name="LKIVITENDO__TYPE____PARENT__">
42       <text:list-level-style-bullet text:level="1" text:style-name="TKIVITENDOBULLETS" text:bullet-char="•">
43         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
44           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.80cm" fo:text-indent="-0.435cm" fo:margin-left="0.80cm"/>
45         </style:list-level-properties>
46       </text:list-level-style-bullet>
47       <text:list-level-style-bullet text:level="2" text:style-name="TKIVITENDOBULLETS" text:bullet-char="◦">
48         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
49           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.2cm" fo:text-indent="-0.435cm" fo:margin-left="1.2cm"/>
50         </style:list-level-properties>
51       </text:list-level-style-bullet>
52       <text:list-level-style-bullet text:level="3" text:style-name="TKIVITENDOBULLETS" text:bullet-char="▪">
53         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
54           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.6cm" fo:text-indent="-0.435cm" fo:margin-left="1.6cm"/>
55         </style:list-level-properties>
56       </text:list-level-style-bullet>
57       <text:list-level-style-bullet text:level="4" text:style-name="TKIVITENDOBULLETS" text:bullet-char="•">
58         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
59           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.0cm" fo:text-indent="-0.435cm" fo:margin-left="2.0cm"/>
60         </style:list-level-properties>
61       </text:list-level-style-bullet>
62       <text:list-level-style-bullet text:level="5" text:style-name="TKIVITENDOBULLETS" text:bullet-char="◦">
63         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
64           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.4cm" fo:text-indent="-0.435cm" fo:margin-left="2.4cm"/>
65         </style:list-level-properties>
66       </text:list-level-style-bullet>
67       <text:list-level-style-bullet text:level="6" text:style-name="TKIVITENDOBULLETS" text:bullet-char="▪">
68         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
69           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.80cm" fo:text-indent="-0.435cm" fo:margin-left="2.80cm"/>
70         </style:list-level-properties>
71       </text:list-level-style-bullet>
72       <text:list-level-style-bullet text:level="7" text:style-name="TKIVITENDOBULLETS" text:bullet-char="•">
73         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
74           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.20cm" fo:text-indent="-0.435cm" fo:margin-left="3.20cm"/>
75         </style:list-level-properties>
76       </text:list-level-style-bullet>
77       <text:list-level-style-bullet text:level="8" text:style-name="TKIVITENDOBULLETS" text:bullet-char="◦">
78         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
79           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.60cm" fo:text-indent="-0.435cm" fo:margin-left="3.60cm"/>
80         </style:list-level-properties>
81       </text:list-level-style-bullet>
82       <text:list-level-style-bullet text:level="9" text:style-name="TKIVITENDOBULLETS" text:bullet-char="▪">
83         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
84           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.00cm" fo:text-indent="-0.435cm" fo:margin-left="4.00cm"/>
85         </style:list-level-properties>
86       </text:list-level-style-bullet>
87       <text:list-level-style-bullet text:level="10" text:style-name="TKIVITENDOBULLETS" text:bullet-char="•">
88         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
89           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.40cm" fo:text-indent="-0.435cm" fo:margin-left="4.40cm"/>
90         </style:list-level-properties>
91       </text:list-level-style-bullet>
92     </text:list-style>|,
93
94   list_enumerate => qq|
95     <text:list-style style:name="LKIVITENDO__TYPE____PARENT__">
96       <text:list-level-style-number text:level="1" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
97         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
98           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.80cm" fo:text-indent="-0.435cm" fo:margin-left="0.80cm"/>
99         </style:list-level-properties>
100       </text:list-level-style-number>
101       <text:list-level-style-number text:level="2" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
102         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
103           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.2cm" fo:text-indent="-0.435cm" fo:margin-left="1.2cm"/>
104         </style:list-level-properties>
105       </text:list-level-style-number>
106       <text:list-level-style-number text:level="3" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
107         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
108           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.6cm" fo:text-indent="-0.435cm" fo:margin-left="1.6cm"/>
109         </style:list-level-properties>
110       </text:list-level-style-number>
111       <text:list-level-style-number text:level="4" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
112         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
113           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.0cm" fo:text-indent="-0.435cm" fo:margin-left="2.0cm"/>
114         </style:list-level-properties>
115       </text:list-level-style-number>
116       <text:list-level-style-number text:level="5" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
117         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
118           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.4cm" fo:text-indent="-0.435cm" fo:margin-left="2.4cm"/>
119         </style:list-level-properties>
120       </text:list-level-style-number>
121       <text:list-level-style-number text:level="6" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
122         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
123           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.80cm" fo:text-indent="-0.435cm" fo:margin-left="2.80cm"/>
124         </style:list-level-properties>
125       </text:list-level-style-number>
126       <text:list-level-style-number text:level="7" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
127         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
128           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.20cm" fo:text-indent="-0.435cm" fo:margin-left="3.20cm"/>
129         </style:list-level-properties>
130       </text:list-level-style-number>
131       <text:list-level-style-number text:level="8" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
132         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
133           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.60cm" fo:text-indent="-0.435cm" fo:margin-left="3.60cm"/>
134         </style:list-level-properties>
135       </text:list-level-style-number>
136       <text:list-level-style-number text:level="9" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
137         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
138           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.00cm" fo:text-indent="-0.435cm" fo:margin-left="4.00cm"/>
139         </style:list-level-properties>
140       </text:list-level-style-number>
141       <text:list-level-style-number text:level="10" text:style-name="TKIVITENDONUMBERING" style:num-suffix="." style:num-format="1">
142         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
143           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.40cm" fo:text-indent="-0.435cm" fo:margin-left="4.40cm"/>
144         </style:list-level-properties>
145       </text:list-level-style-number>
146     </text:list-style>|,
147 );
148
149 sub get_style {
150   my ($class, $style_name, %replacements) = @_;
151
152   my $copy = "". $styles{$style_name} || croak("Unknown style $style_name");
153
154   $copy =~ s{^ +}{}gm;
155   $copy =~ s{[\r\n]+}{}gm;
156   $copy =~ s{__${_}__}{ $replacements{$_} }ge for keys %replacements;
157
158   return $copy;
159 }
160
161 1;