style.py 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # -*- coding: utf-8 -*-
  2. # Copyright (C) 2006-2013 Søren Roug, European Environment Agency
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation; either
  7. # version 2.1 of the License, or (at your option) any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with this library; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. #
  18. # Contributor(s):
  19. #
  20. from odf.namespaces import STYLENS
  21. from odf.element import Element
  22. def StyleElement(**args):
  23. e = Element(**args)
  24. if args.get('check_grammar', True) == True:
  25. if 'displayname' not in args:
  26. e.setAttrNS(STYLENS,'display-name', args.get('name'))
  27. return e
  28. # Autogenerated
  29. def BackgroundImage(**args):
  30. return Element(qname = (STYLENS,'background-image'), **args)
  31. def ChartProperties(**args):
  32. return Element(qname = (STYLENS,'chart-properties'), **args)
  33. def Column(**args):
  34. return Element(qname = (STYLENS,'column'), **args)
  35. def ColumnSep(**args):
  36. return Element(qname = (STYLENS,'column-sep'), **args)
  37. def Columns(**args):
  38. return Element(qname = (STYLENS,'columns'), **args)
  39. def DefaultPageLayout(**args):
  40. return Element(qname = (STYLENS,'default-page-layout'), **args)
  41. def DefaultStyle(**args):
  42. return Element(qname = (STYLENS,'default-style'), **args)
  43. def DrawingPageProperties(**args):
  44. return Element(qname = (STYLENS,'drawing-page-properties'), **args)
  45. def DropCap(**args):
  46. return Element(qname = (STYLENS,'drop-cap'), **args)
  47. def FontFace(**args):
  48. return Element(qname = (STYLENS,'font-face'), **args)
  49. def Footer(**args):
  50. return Element(qname = (STYLENS,'footer'), **args)
  51. def FooterLeft(**args):
  52. return Element(qname = (STYLENS,'footer-left'), **args)
  53. def FooterStyle(**args):
  54. return Element(qname = (STYLENS,'footer-style'), **args)
  55. def FootnoteSep(**args):
  56. return Element(qname = (STYLENS,'footnote-sep'), **args)
  57. def GraphicProperties(**args):
  58. return Element(qname = (STYLENS,'graphic-properties'), **args)
  59. def HandoutMaster(**args):
  60. return Element(qname = (STYLENS,'handout-master'), **args)
  61. def Header(**args):
  62. return Element(qname = (STYLENS,'header'), **args)
  63. def HeaderFooterProperties(**args):
  64. return Element(qname = (STYLENS,'header-footer-properties'), **args)
  65. def HeaderLeft(**args):
  66. return Element(qname = (STYLENS,'header-left'), **args)
  67. def HeaderStyle(**args):
  68. return Element(qname = (STYLENS,'header-style'), **args)
  69. def ListLevelLabelAlignment(**args):
  70. return Element(qname = (STYLENS,'list-level-label-alignment'), **args)
  71. def ListLevelProperties(**args):
  72. return Element(qname = (STYLENS,'list-level-properties'), **args)
  73. def Map(**args):
  74. return Element(qname = (STYLENS,'map'), **args)
  75. def MasterPage(**args):
  76. return StyleElement(qname = (STYLENS,'master-page'), **args)
  77. def PageLayout(**args):
  78. return Element(qname = (STYLENS,'page-layout'), **args)
  79. def PageLayoutProperties(**args):
  80. return Element(qname = (STYLENS,'page-layout-properties'), **args)
  81. def ParagraphProperties(**args):
  82. return Element(qname = (STYLENS,'paragraph-properties'), **args)
  83. def PresentationPageLayout(**args):
  84. return StyleElement(qname = (STYLENS,'presentation-page-layout'), **args)
  85. def RegionCenter(**args):
  86. return Element(qname = (STYLENS,'region-center'), **args)
  87. def RegionLeft(**args):
  88. return Element(qname = (STYLENS,'region-left'), **args)
  89. def RegionRight(**args):
  90. return Element(qname = (STYLENS,'region-right'), **args)
  91. def RubyProperties(**args):
  92. return Element(qname = (STYLENS,'ruby-properties'), **args)
  93. def SectionProperties(**args):
  94. return Element(qname = (STYLENS,'section-properties'), **args)
  95. def Style(**args):
  96. return StyleElement(qname = (STYLENS,'style'), **args)
  97. def TabStop(**args):
  98. return Element(qname = (STYLENS,'tab-stop'), **args)
  99. def TabStops(**args):
  100. return Element(qname = (STYLENS,'tab-stops'), **args)
  101. def TableCellProperties(**args):
  102. return Element(qname = (STYLENS,'table-cell-properties'), **args)
  103. def TableColumnProperties(**args):
  104. return Element(qname = (STYLENS,'table-column-properties'), **args)
  105. def TableProperties(**args):
  106. return Element(qname = (STYLENS,'table-properties'), **args)
  107. def TableRowProperties(**args):
  108. return Element(qname = (STYLENS,'table-row-properties'), **args)
  109. def TextProperties(**args):
  110. return Element(qname = (STYLENS,'text-properties'), **args)