1# encoding: utf-8
2
3"""
4Constant values related to the Open Packaging Convention, in particular,
5content types and relationship types.
6"""
7
8
9class CONTENT_TYPE(object):
10    """
11    Content type URIs (like MIME-types) that specify a part's format
12    """
13    BMP = (
14        'image/bmp'
15    )
16    DML_CHART = (
17        'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'
18    )
19    DML_CHARTSHAPES = (
20        'application/vnd.openxmlformats-officedocument.drawingml.chartshapes'
21        '+xml'
22    )
23    DML_DIAGRAM_COLORS = (
24        'application/vnd.openxmlformats-officedocument.drawingml.diagramColo'
25        'rs+xml'
26    )
27    DML_DIAGRAM_DATA = (
28        'application/vnd.openxmlformats-officedocument.drawingml.diagramData'
29        '+xml'
30    )
31    DML_DIAGRAM_LAYOUT = (
32        'application/vnd.openxmlformats-officedocument.drawingml.diagramLayo'
33        'ut+xml'
34    )
35    DML_DIAGRAM_STYLE = (
36        'application/vnd.openxmlformats-officedocument.drawingml.diagramStyl'
37        'e+xml'
38    )
39    GIF = (
40        'image/gif'
41    )
42    JPEG = (
43        'image/jpeg'
44    )
45    MS_PHOTO = (
46        'image/vnd.ms-photo'
47    )
48    OFC_CUSTOM_PROPERTIES = (
49        'application/vnd.openxmlformats-officedocument.custom-properties+xml'
50    )
51    OFC_CUSTOM_XML_PROPERTIES = (
52        'application/vnd.openxmlformats-officedocument.customXmlProperties+x'
53        'ml'
54    )
55    OFC_DRAWING = (
56        'application/vnd.openxmlformats-officedocument.drawing+xml'
57    )
58    OFC_EXTENDED_PROPERTIES = (
59        'application/vnd.openxmlformats-officedocument.extended-properties+x'
60        'ml'
61    )
62    OFC_OLE_OBJECT = (
63        'application/vnd.openxmlformats-officedocument.oleObject'
64    )
65    OFC_PACKAGE = (
66        'application/vnd.openxmlformats-officedocument.package'
67    )
68    OFC_THEME = (
69        'application/vnd.openxmlformats-officedocument.theme+xml'
70    )
71    OFC_THEME_OVERRIDE = (
72        'application/vnd.openxmlformats-officedocument.themeOverride+xml'
73    )
74    OFC_VML_DRAWING = (
75        'application/vnd.openxmlformats-officedocument.vmlDrawing'
76    )
77    OPC_CORE_PROPERTIES = (
78        'application/vnd.openxmlformats-package.core-properties+xml'
79    )
80    OPC_DIGITAL_SIGNATURE_CERTIFICATE = (
81        'application/vnd.openxmlformats-package.digital-signature-certificat'
82        'e'
83    )
84    OPC_DIGITAL_SIGNATURE_ORIGIN = (
85        'application/vnd.openxmlformats-package.digital-signature-origin'
86    )
87    OPC_DIGITAL_SIGNATURE_XMLSIGNATURE = (
88        'application/vnd.openxmlformats-package.digital-signature-xmlsignatu'
89        're+xml'
90    )
91    OPC_RELATIONSHIPS = (
92        'application/vnd.openxmlformats-package.relationships+xml'
93    )
94    PML_COMMENTS = (
95        'application/vnd.openxmlformats-officedocument.presentationml.commen'
96        'ts+xml'
97    )
98    PML_COMMENT_AUTHORS = (
99        'application/vnd.openxmlformats-officedocument.presentationml.commen'
100        'tAuthors+xml'
101    )
102    PML_HANDOUT_MASTER = (
103        'application/vnd.openxmlformats-officedocument.presentationml.handou'
104        'tMaster+xml'
105    )
106    PML_NOTES_MASTER = (
107        'application/vnd.openxmlformats-officedocument.presentationml.notesM'
108        'aster+xml'
109    )
110    PML_NOTES_SLIDE = (
111        'application/vnd.openxmlformats-officedocument.presentationml.notesS'
112        'lide+xml'
113    )
114    PML_PRESENTATION_MAIN = (
115        'application/vnd.openxmlformats-officedocument.presentationml.presen'
116        'tation.main+xml'
117    )
118    PML_PRES_PROPS = (
119        'application/vnd.openxmlformats-officedocument.presentationml.presPr'
120        'ops+xml'
121    )
122    PML_PRINTER_SETTINGS = (
123        'application/vnd.openxmlformats-officedocument.presentationml.printe'
124        'rSettings'
125    )
126    PML_SLIDE = (
127        'application/vnd.openxmlformats-officedocument.presentationml.slide+'
128        'xml'
129    )
130    PML_SLIDESHOW_MAIN = (
131        'application/vnd.openxmlformats-officedocument.presentationml.slides'
132        'how.main+xml'
133    )
134    PML_SLIDE_LAYOUT = (
135        'application/vnd.openxmlformats-officedocument.presentationml.slideL'
136        'ayout+xml'
137    )
138    PML_SLIDE_MASTER = (
139        'application/vnd.openxmlformats-officedocument.presentationml.slideM'
140        'aster+xml'
141    )
142    PML_SLIDE_UPDATE_INFO = (
143        'application/vnd.openxmlformats-officedocument.presentationml.slideU'
144        'pdateInfo+xml'
145    )
146    PML_TABLE_STYLES = (
147        'application/vnd.openxmlformats-officedocument.presentationml.tableS'
148        'tyles+xml'
149    )
150    PML_TAGS = (
151        'application/vnd.openxmlformats-officedocument.presentationml.tags+x'
152        'ml'
153    )
154    PML_TEMPLATE_MAIN = (
155        'application/vnd.openxmlformats-officedocument.presentationml.templa'
156        'te.main+xml'
157    )
158    PML_VIEW_PROPS = (
159        'application/vnd.openxmlformats-officedocument.presentationml.viewPr'
160        'ops+xml'
161    )
162    PNG = (
163        'image/png'
164    )
165    SML_CALC_CHAIN = (
166        'application/vnd.openxmlformats-officedocument.spreadsheetml.calcCha'
167        'in+xml'
168    )
169    SML_CHARTSHEET = (
170        'application/vnd.openxmlformats-officedocument.spreadsheetml.chartsh'
171        'eet+xml'
172    )
173    SML_COMMENTS = (
174        'application/vnd.openxmlformats-officedocument.spreadsheetml.comment'
175        's+xml'
176    )
177    SML_CONNECTIONS = (
178        'application/vnd.openxmlformats-officedocument.spreadsheetml.connect'
179        'ions+xml'
180    )
181    SML_CUSTOM_PROPERTY = (
182        'application/vnd.openxmlformats-officedocument.spreadsheetml.customP'
183        'roperty'
184    )
185    SML_DIALOGSHEET = (
186        'application/vnd.openxmlformats-officedocument.spreadsheetml.dialogs'
187        'heet+xml'
188    )
189    SML_EXTERNAL_LINK = (
190        'application/vnd.openxmlformats-officedocument.spreadsheetml.externa'
191        'lLink+xml'
192    )
193    SML_PIVOT_CACHE_DEFINITION = (
194        'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCa'
195        'cheDefinition+xml'
196    )
197    SML_PIVOT_CACHE_RECORDS = (
198        'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCa'
199        'cheRecords+xml'
200    )
201    SML_PIVOT_TABLE = (
202        'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTa'
203        'ble+xml'
204    )
205    SML_PRINTER_SETTINGS = (
206        'application/vnd.openxmlformats-officedocument.spreadsheetml.printer'
207        'Settings'
208    )
209    SML_QUERY_TABLE = (
210        'application/vnd.openxmlformats-officedocument.spreadsheetml.queryTa'
211        'ble+xml'
212    )
213    SML_REVISION_HEADERS = (
214        'application/vnd.openxmlformats-officedocument.spreadsheetml.revisio'
215        'nHeaders+xml'
216    )
217    SML_REVISION_LOG = (
218        'application/vnd.openxmlformats-officedocument.spreadsheetml.revisio'
219        'nLog+xml'
220    )
221    SML_SHARED_STRINGS = (
222        'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedS'
223        'trings+xml'
224    )
225    SML_SHEET = (
226        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
227    )
228    SML_SHEET_MAIN = (
229        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.m'
230        'ain+xml'
231    )
232    SML_SHEET_METADATA = (
233        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMe'
234        'tadata+xml'
235    )
236    SML_STYLES = (
237        'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+'
238        'xml'
239    )
240    SML_TABLE = (
241        'application/vnd.openxmlformats-officedocument.spreadsheetml.table+x'
242        'ml'
243    )
244    SML_TABLE_SINGLE_CELLS = (
245        'application/vnd.openxmlformats-officedocument.spreadsheetml.tableSi'
246        'ngleCells+xml'
247    )
248    SML_TEMPLATE_MAIN = (
249        'application/vnd.openxmlformats-officedocument.spreadsheetml.templat'
250        'e.main+xml'
251    )
252    SML_USER_NAMES = (
253        'application/vnd.openxmlformats-officedocument.spreadsheetml.userNam'
254        'es+xml'
255    )
256    SML_VOLATILE_DEPENDENCIES = (
257        'application/vnd.openxmlformats-officedocument.spreadsheetml.volatil'
258        'eDependencies+xml'
259    )
260    SML_WORKSHEET = (
261        'application/vnd.openxmlformats-officedocument.spreadsheetml.workshe'
262        'et+xml'
263    )
264    TIFF = (
265        'image/tiff'
266    )
267    WML_COMMENTS = (
268        'application/vnd.openxmlformats-officedocument.wordprocessingml.comm'
269        'ents+xml'
270    )
271    WML_DOCUMENT = (
272        'application/vnd.openxmlformats-officedocument.wordprocessingml.docu'
273        'ment'
274    )
275    WML_DOCUMENT_GLOSSARY = (
276        'application/vnd.openxmlformats-officedocument.wordprocessingml.docu'
277        'ment.glossary+xml'
278    )
279    WML_DOCUMENT_MAIN = (
280        'application/vnd.openxmlformats-officedocument.wordprocessingml.docu'
281        'ment.main+xml'
282    )
283    WML_ENDNOTES = (
284        'application/vnd.openxmlformats-officedocument.wordprocessingml.endn'
285        'otes+xml'
286    )
287    WML_FONT_TABLE = (
288        'application/vnd.openxmlformats-officedocument.wordprocessingml.font'
289        'Table+xml'
290    )
291    WML_FOOTER = (
292        'application/vnd.openxmlformats-officedocument.wordprocessingml.foot'
293        'er+xml'
294    )
295    WML_FOOTNOTES = (
296        'application/vnd.openxmlformats-officedocument.wordprocessingml.foot'
297        'notes+xml'
298    )
299    WML_HEADER = (
300        'application/vnd.openxmlformats-officedocument.wordprocessingml.head'
301        'er+xml'
302    )
303    WML_NUMBERING = (
304        'application/vnd.openxmlformats-officedocument.wordprocessingml.numb'
305        'ering+xml'
306    )
307    WML_PRINTER_SETTINGS = (
308        'application/vnd.openxmlformats-officedocument.wordprocessingml.prin'
309        'terSettings'
310    )
311    WML_SETTINGS = (
312        'application/vnd.openxmlformats-officedocument.wordprocessingml.sett'
313        'ings+xml'
314    )
315    WML_STYLES = (
316        'application/vnd.openxmlformats-officedocument.wordprocessingml.styl'
317        'es+xml'
318    )
319    WML_WEB_SETTINGS = (
320        'application/vnd.openxmlformats-officedocument.wordprocessingml.webS'
321        'ettings+xml'
322    )
323    XML = (
324        'application/xml'
325    )
326    X_EMF = (
327        'image/x-emf'
328    )
329    X_FONTDATA = (
330        'application/x-fontdata'
331    )
332    X_FONT_TTF = (
333        'application/x-font-ttf'
334    )
335    X_WMF = (
336        'image/x-wmf'
337    )
338
339
340class NAMESPACE(object):
341    """Constant values for OPC XML namespaces"""
342    DML_WORDPROCESSING_DRAWING = (
343        'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDraw'
344        'ing'
345    )
346    OFC_RELATIONSHIPS = (
347        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
348    )
349    OPC_RELATIONSHIPS = (
350        'http://schemas.openxmlformats.org/package/2006/relationships'
351    )
352    OPC_CONTENT_TYPES = (
353        'http://schemas.openxmlformats.org/package/2006/content-types'
354    )
355    WML_MAIN = (
356        'http://schemas.openxmlformats.org/wordprocessingml/2006/main'
357    )
358
359
360class RELATIONSHIP_TARGET_MODE(object):
361    """Open XML relationship target modes"""
362    EXTERNAL = 'External'
363    INTERNAL = 'Internal'
364
365
366class RELATIONSHIP_TYPE(object):
367    AUDIO = (
368        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
369        '/audio'
370    )
371    A_F_CHUNK = (
372        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
373        '/aFChunk'
374    )
375    CALC_CHAIN = (
376        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
377        '/calcChain'
378    )
379    CERTIFICATE = (
380        'http://schemas.openxmlformats.org/package/2006/relationships/digita'
381        'l-signature/certificate'
382    )
383    CHART = (
384        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
385        '/chart'
386    )
387    CHARTSHEET = (
388        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
389        '/chartsheet'
390    )
391    CHART_USER_SHAPES = (
392        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
393        '/chartUserShapes'
394    )
395    COMMENTS = (
396        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
397        '/comments'
398    )
399    COMMENT_AUTHORS = (
400        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
401        '/commentAuthors'
402    )
403    CONNECTIONS = (
404        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
405        '/connections'
406    )
407    CONTROL = (
408        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
409        '/control'
410    )
411    CORE_PROPERTIES = (
412        'http://schemas.openxmlformats.org/package/2006/relationships/metada'
413        'ta/core-properties'
414    )
415    CUSTOM_PROPERTIES = (
416        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
417        '/custom-properties'
418    )
419    CUSTOM_PROPERTY = (
420        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
421        '/customProperty'
422    )
423    CUSTOM_XML = (
424        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
425        '/customXml'
426    )
427    CUSTOM_XML_PROPS = (
428        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
429        '/customXmlProps'
430    )
431    DIAGRAM_COLORS = (
432        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
433        '/diagramColors'
434    )
435    DIAGRAM_DATA = (
436        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
437        '/diagramData'
438    )
439    DIAGRAM_LAYOUT = (
440        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
441        '/diagramLayout'
442    )
443    DIAGRAM_QUICK_STYLE = (
444        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
445        '/diagramQuickStyle'
446    )
447    DIALOGSHEET = (
448        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
449        '/dialogsheet'
450    )
451    DRAWING = (
452        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
453        '/drawing'
454    )
455    ENDNOTES = (
456        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
457        '/endnotes'
458    )
459    EXTENDED_PROPERTIES = (
460        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
461        '/extended-properties'
462    )
463    EXTERNAL_LINK = (
464        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
465        '/externalLink'
466    )
467    FONT = (
468        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
469        '/font'
470    )
471    FONT_TABLE = (
472        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
473        '/fontTable'
474    )
475    FOOTER = (
476        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
477        '/footer'
478    )
479    FOOTNOTES = (
480        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
481        '/footnotes'
482    )
483    GLOSSARY_DOCUMENT = (
484        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
485        '/glossaryDocument'
486    )
487    HANDOUT_MASTER = (
488        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
489        '/handoutMaster'
490    )
491    HEADER = (
492        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
493        '/header'
494    )
495    HYPERLINK = (
496        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
497        '/hyperlink'
498    )
499    IMAGE = (
500        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
501        '/image'
502    )
503    NOTES_MASTER = (
504        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
505        '/notesMaster'
506    )
507    NOTES_SLIDE = (
508        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
509        '/notesSlide'
510    )
511    NUMBERING = (
512        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
513        '/numbering'
514    )
515    OFFICE_DOCUMENT = (
516        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
517        '/officeDocument'
518    )
519    OLE_OBJECT = (
520        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
521        '/oleObject'
522    )
523    ORIGIN = (
524        'http://schemas.openxmlformats.org/package/2006/relationships/digita'
525        'l-signature/origin'
526    )
527    PACKAGE = (
528        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
529        '/package'
530    )
531    PIVOT_CACHE_DEFINITION = (
532        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
533        '/pivotCacheDefinition'
534    )
535    PIVOT_CACHE_RECORDS = (
536        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
537        '/spreadsheetml/pivotCacheRecords'
538    )
539    PIVOT_TABLE = (
540        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
541        '/pivotTable'
542    )
543    PRES_PROPS = (
544        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
545        '/presProps'
546    )
547    PRINTER_SETTINGS = (
548        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
549        '/printerSettings'
550    )
551    QUERY_TABLE = (
552        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
553        '/queryTable'
554    )
555    REVISION_HEADERS = (
556        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
557        '/revisionHeaders'
558    )
559    REVISION_LOG = (
560        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
561        '/revisionLog'
562    )
563    SETTINGS = (
564        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
565        '/settings'
566    )
567    SHARED_STRINGS = (
568        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
569        '/sharedStrings'
570    )
571    SHEET_METADATA = (
572        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
573        '/sheetMetadata'
574    )
575    SIGNATURE = (
576        'http://schemas.openxmlformats.org/package/2006/relationships/digita'
577        'l-signature/signature'
578    )
579    SLIDE = (
580        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
581        '/slide'
582    )
583    SLIDE_LAYOUT = (
584        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
585        '/slideLayout'
586    )
587    SLIDE_MASTER = (
588        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
589        '/slideMaster'
590    )
591    SLIDE_UPDATE_INFO = (
592        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
593        '/slideUpdateInfo'
594    )
595    STYLES = (
596        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
597        '/styles'
598    )
599    TABLE = (
600        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
601        '/table'
602    )
603    TABLE_SINGLE_CELLS = (
604        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
605        '/tableSingleCells'
606    )
607    TABLE_STYLES = (
608        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
609        '/tableStyles'
610    )
611    TAGS = (
612        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
613        '/tags'
614    )
615    THEME = (
616        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
617        '/theme'
618    )
619    THEME_OVERRIDE = (
620        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
621        '/themeOverride'
622    )
623    THUMBNAIL = (
624        'http://schemas.openxmlformats.org/package/2006/relationships/metada'
625        'ta/thumbnail'
626    )
627    USERNAMES = (
628        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
629        '/usernames'
630    )
631    VIDEO = (
632        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
633        '/video'
634    )
635    VIEW_PROPS = (
636        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
637        '/viewProps'
638    )
639    VML_DRAWING = (
640        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
641        '/vmlDrawing'
642    )
643    VOLATILE_DEPENDENCIES = (
644        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
645        '/volatileDependencies'
646    )
647    WEB_SETTINGS = (
648        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
649        '/webSettings'
650    )
651    WORKSHEET_SOURCE = (
652        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
653        '/worksheetSource'
654    )
655    XML_MAPS = (
656        'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
657        '/xmlMaps'
658    )
659