ODFPY  1.2.0
 All Classes Namespaces Files Functions Variables
elementtypes.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # Copyright (C) 2008 Søren Roug, European Environment Agency
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library 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 GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #
19 # Contributor(s):
20 #
21 
22 from namespaces import *
23 
24 # Inline element don't cause a box
25 # They are analogous to the HTML elements SPAN, B, I etc.
26 inline_elements = (
27  (TEXTNS,u'a'),
28  (TEXTNS,u'author-initials'),
29  (TEXTNS,u'author-name'),
30  (TEXTNS,u'bibliography-mark'),
31  (TEXTNS,u'bookmark-ref'),
32  (TEXTNS,u'chapter'),
33  (TEXTNS,u'character-count'),
34  (TEXTNS,u'conditional-text'),
35  (TEXTNS,u'creation-date'),
36  (TEXTNS,u'creation-time'),
37  (TEXTNS,u'creator'),
38  (TEXTNS,u'database-display'),
39  (TEXTNS,u'database-name'),
40  (TEXTNS,u'database-next'),
41  (TEXTNS,u'database-row-number'),
42  (TEXTNS,u'database-row-select'),
43  (TEXTNS,u'date'),
44  (TEXTNS,u'dde-connection'),
45  (TEXTNS,u'description'),
46  (TEXTNS,u'editing-cycles'),
47  (TEXTNS,u'editing-duration'),
48  (TEXTNS,u'execute-macro'),
49  (TEXTNS,u'expression'),
50  (TEXTNS,u'file-name'),
51  (TEXTNS,u'hidden-paragraph'),
52  (TEXTNS,u'hidden-text'),
53  (TEXTNS,u'image-count'),
54  (TEXTNS,u'initial-creator'),
55  (TEXTNS,u'keywords'),
56  (TEXTNS,u'measure'),
57  (TEXTNS,u'modification-date'),
58  (TEXTNS,u'modification-time'),
59  (TEXTNS,u'note-ref'),
60  (TEXTNS,u'object-count'),
61  (TEXTNS,u'page-continuation'),
62  (TEXTNS,u'page-count'),
63  (TEXTNS,u'page-number'),
64  (TEXTNS,u'page-variable-get'),
65  (TEXTNS,u'page-variable-set'),
66  (TEXTNS,u'paragraph-count'),
67  (TEXTNS,u'placeholder'),
68  (TEXTNS,u'print-date'),
69  (TEXTNS,u'printed-by'),
70  (TEXTNS,u'print-time'),
71  (TEXTNS,u'reference-ref'),
72  (TEXTNS,u'ruby'),
73  (TEXTNS,u'ruby-base'),
74  (TEXTNS,u'ruby-text'),
75  (TEXTNS,u'script'),
76  (TEXTNS,u'sender-city'),
77  (TEXTNS,u'sender-company'),
78  (TEXTNS,u'sender-country'),
79  (TEXTNS,u'sender-email'),
80  (TEXTNS,u'sender-fax'),
81  (TEXTNS,u'sender-firstname'),
82  (TEXTNS,u'sender-initials'),
83  (TEXTNS,u'sender-lastname'),
84  (TEXTNS,u'sender-phone-private'),
85  (TEXTNS,u'sender-phone-work'),
86  (TEXTNS,u'sender-position'),
87  (TEXTNS,u'sender-postal-code'),
88  (TEXTNS,u'sender-state-or-province'),
89  (TEXTNS,u'sender-street'),
90  (TEXTNS,u'sender-title'),
91  (TEXTNS,u'sequence'),
92  (TEXTNS,u'sequence-ref'),
93  (TEXTNS,u'sheet-name'),
94  (TEXTNS,u'span'),
95  (TEXTNS,u'subject'),
96  (TEXTNS,u'table-count'),
97  (TEXTNS,u'table-formula'),
98  (TEXTNS,u'template-name'),
99  (TEXTNS,u'text-input'),
100  (TEXTNS,u'time'),
101  (TEXTNS,u'title'),
102  (TEXTNS,u'user-defined'),
103  (TEXTNS,u'user-field-get'),
104  (TEXTNS,u'user-field-input'),
105  (TEXTNS,u'variable-get'),
106  (TEXTNS,u'variable-input'),
107  (TEXTNS,u'variable-set'),
108  (TEXTNS,u'word-count'),
109 )
110 
111 
112 # It is almost impossible to determine what elements are block elements.
113 # There are so many that don't fit the form
114 block_elements = (
115  (TEXTNS,u'h'),
116  (TEXTNS,u'p'),
117  (TEXTNS,u'list'),
118  (TEXTNS,u'list-item'),
119  (TEXTNS,u'section'),
120 )
121 
122 declarative_elements = (
123  (OFFICENS,u'font-face-decls'),
124  (PRESENTATIONNS,u'date-time-decl'),
125  (PRESENTATIONNS,u'footer-decl'),
126  (PRESENTATIONNS,u'header-decl'),
127  (TABLENS,u'table-template'),
128  (TEXTNS,u'alphabetical-index-entry-template'),
129  (TEXTNS,u'alphabetical-index-source'),
130  (TEXTNS,u'bibliography-entry-template'),
131  (TEXTNS,u'bibliography-source'),
132  (TEXTNS,u'dde-connection-decls'),
133  (TEXTNS,u'illustration-index-entry-template'),
134  (TEXTNS,u'illustration-index-source'),
135  (TEXTNS,u'index-source-styles'),
136  (TEXTNS,u'index-title-template'),
137  (TEXTNS,u'note-continuation-notice-backward'),
138  (TEXTNS,u'note-continuation-notice-forward'),
139  (TEXTNS,u'notes-configuration'),
140  (TEXTNS,u'object-index-entry-template'),
141  (TEXTNS,u'object-index-source'),
142  (TEXTNS,u'sequence-decls'),
143  (TEXTNS,u'table-index-entry-template'),
144  (TEXTNS,u'table-index-source'),
145  (TEXTNS,u'table-of-content-entry-template'),
146  (TEXTNS,u'table-of-content-source'),
147  (TEXTNS,u'user-field-decls'),
148  (TEXTNS,u'user-index-entry-template'),
149  (TEXTNS,u'user-index-source'),
150  (TEXTNS,u'variable-decls'),
151 )
152 
153 empty_elements = (
154  (ANIMNS,u'animate'),
155  (ANIMNS,u'animateColor'),
156  (ANIMNS,u'animateMotion'),
157  (ANIMNS,u'animateTransform'),
158  (ANIMNS,u'audio'),
159  (ANIMNS,u'param'),
160  (ANIMNS,u'set'),
161  (ANIMNS,u'transitionFilter'),
162  (CHARTNS,u'categories'),
163  (CHARTNS,u'data-point'),
164  (CHARTNS,u'domain'),
165  (CHARTNS,u'error-indicator'),
166  (CHARTNS,u'floor'),
167  (CHARTNS,u'grid'),
168  (CHARTNS,u'legend'),
169  (CHARTNS,u'mean-value'),
170  (CHARTNS,u'regression-curve'),
171  (CHARTNS,u'stock-gain-marker'),
172  (CHARTNS,u'stock-loss-marker'),
173  (CHARTNS,u'stock-range-line'),
174  (CHARTNS,u'symbol-image'),
175  (CHARTNS,u'wall'),
176  (DR3DNS,u'cube'),
177  (DR3DNS,u'extrude'),
178  (DR3DNS,u'light'),
179  (DR3DNS,u'rotate'),
180  (DR3DNS,u'sphere'),
181  (DRAWNS,u'contour-path'),
182  (DRAWNS,u'contour-polygon'),
183  (DRAWNS,u'equation'),
184  (DRAWNS,u'fill-image'),
185  (DRAWNS,u'floating-frame'),
186  (DRAWNS,u'glue-point'),
187  (DRAWNS,u'gradient'),
188  (DRAWNS,u'handle'),
189  (DRAWNS,u'hatch'),
190  (DRAWNS,u'layer'),
191  (DRAWNS,u'marker'),
192  (DRAWNS,u'opacity'),
193  (DRAWNS,u'page-thumbnail'),
194  (DRAWNS,u'param'),
195  (DRAWNS,u'stroke-dash'),
196  (FORMNS,u'connection-resource'),
197  (FORMNS,u'list-value'),
198  (FORMNS,u'property'),
199  (MANIFESTNS,u'algorithm'),
200  (MANIFESTNS,u'key-derivation'),
201  (METANS,u'auto-reload'),
202  (METANS,u'document-statistic'),
203  (METANS,u'hyperlink-behaviour'),
204  (METANS,u'template'),
205  (NUMBERNS,u'am-pm'),
206  (NUMBERNS,u'boolean'),
207  (NUMBERNS,u'day'),
208  (NUMBERNS,u'day-of-week'),
209  (NUMBERNS,u'era'),
210  (NUMBERNS,u'fraction'),
211  (NUMBERNS,u'hours'),
212  (NUMBERNS,u'minutes'),
213  (NUMBERNS,u'month'),
214  (NUMBERNS,u'quarter'),
215  (NUMBERNS,u'scientific-number'),
216  (NUMBERNS,u'seconds'),
217  (NUMBERNS,u'text-content'),
218  (NUMBERNS,u'week-of-year'),
219  (NUMBERNS,u'year'),
220  (OFFICENS,u'dde-source'),
221  (PRESENTATIONNS,u'date-time'),
222  (PRESENTATIONNS,u'footer'),
223  (PRESENTATIONNS,u'header'),
224  (PRESENTATIONNS,u'placeholder'),
225  (PRESENTATIONNS,u'play'),
226  (PRESENTATIONNS,u'show'),
227  (PRESENTATIONNS,u'sound'),
228  (SCRIPTNS,u'event-listener'),
229  (STYLENS,u'column'),
230  (STYLENS,u'column-sep'),
231  (STYLENS,u'drop-cap'),
232  (STYLENS,u'footnote-sep'),
233  (STYLENS,u'list-level-properties'),
234  (STYLENS,u'map'),
235  (STYLENS,u'ruby-properties'),
236  (STYLENS,u'table-column-properties'),
237  (STYLENS,u'tab-stop'),
238  (STYLENS,u'text-properties'),
239  (SVGNS,u'definition-src'),
240  (SVGNS,u'font-face-format'),
241  (SVGNS,u'font-face-name'),
242  (SVGNS,u'stop'),
243  (TABLENS,u'body'),
244  (TABLENS,u'cell-address'),
245  (TABLENS,u'cell-range-source'),
246  (TABLENS,u'change-deletion'),
247  (TABLENS,u'consolidation'),
248  (TABLENS,u'database-source-query'),
249  (TABLENS,u'database-source-sql'),
250  (TABLENS,u'database-source-table'),
251  (TABLENS,u'data-pilot-display-info'),
252  (TABLENS,u'data-pilot-field-reference'),
253  (TABLENS,u'data-pilot-group-member'),
254  (TABLENS,u'data-pilot-layout-info'),
255  (TABLENS,u'data-pilot-member'),
256  (TABLENS,u'data-pilot-sort-info'),
257  (TABLENS,u'data-pilot-subtotal'),
258  (TABLENS,u'dependency'),
259  (TABLENS,u'error-macro'),
260  (TABLENS,u'even-columns'),
261  (TABLENS,u'even-rows'),
262  (TABLENS,u'filter-condition'),
263  (TABLENS,u'first-column'),
264  (TABLENS,u'first-row'),
265  (TABLENS,u'highlighted-range'),
266  (TABLENS,u'insertion-cut-off'),
267  (TABLENS,u'iteration'),
268  (TABLENS,u'label-range'),
269  (TABLENS,u'last-column'),
270  (TABLENS,u'last-row'),
271  (TABLENS,u'movement-cut-off'),
272  (TABLENS,u'named-expression'),
273  (TABLENS,u'named-range'),
274  (TABLENS,u'null-date'),
275  (TABLENS,u'odd-columns'),
276  (TABLENS,u'odd-rows'),
277  (TABLENS,u'operation'),
278  (TABLENS,u'scenario'),
279  (TABLENS,u'sort-by'),
280  (TABLENS,u'sort-groups'),
281  (TABLENS,u'source-range-address'),
282  (TABLENS,u'source-service'),
283  (TABLENS,u'subtotal-field'),
284  (TABLENS,u'table-column'),
285  (TABLENS,u'table-source'),
286  (TABLENS,u'target-range-address'),
287  (TEXTNS,u'alphabetical-index-auto-mark-file'),
288  (TEXTNS,u'alphabetical-index-mark'),
289  (TEXTNS,u'alphabetical-index-mark-end'),
290  (TEXTNS,u'alphabetical-index-mark-start'),
291  (TEXTNS,u'bookmark'),
292  (TEXTNS,u'bookmark-end'),
293  (TEXTNS,u'bookmark-start'),
294  (TEXTNS,u'change'),
295  (TEXTNS,u'change-end'),
296  (TEXTNS,u'change-start'),
297  (TEXTNS,u'dde-connection-decl'),
298  (TEXTNS,u'index-entry-bibliography'),
299  (TEXTNS,u'index-entry-chapter'),
300  (TEXTNS,u'index-entry-link-end'),
301  (TEXTNS,u'index-entry-link-start'),
302  (TEXTNS,u'index-entry-page-number'),
303  (TEXTNS,u'index-entry-tab-stop'),
304  (TEXTNS,u'index-entry-text'),
305  (TEXTNS,u'index-source-style'),
306  (TEXTNS,u'line-break'),
307  (TEXTNS,u'page'),
308  (TEXTNS,u'reference-mark'),
309  (TEXTNS,u'reference-mark-end'),
310  (TEXTNS,u'reference-mark-start'),
311  (TEXTNS,u's'),
312  (TEXTNS,u'section-source'),
313  (TEXTNS,u'sequence-decl'),
314  (TEXTNS,u'soft-page-break'),
315  (TEXTNS,u'sort-key'),
316  (TEXTNS,u'tab'),
317  (TEXTNS,u'toc-mark'),
318  (TEXTNS,u'toc-mark-end'),
319  (TEXTNS,u'toc-mark-start'),
320  (TEXTNS,u'user-field-decl'),
321  (TEXTNS,u'user-index-mark'),
322  (TEXTNS,u'user-index-mark-end'),
323  (TEXTNS,u'user-index-mark-start'),
324  (TEXTNS,u'variable-decl')
325 )