xlsxtheme.cpp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. // xlsxtheme.cpp
  2. #include "xlsxtheme_p.h"
  3. #include <QIODevice>
  4. QT_BEGIN_NAMESPACE_XLSX
  5. const char *defaultXmlData =
  6. "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
  7. "<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office \xe4\xb8\xbb\xe9\xa2\x98\">"
  8. "<a:themeElements>"
  9. "<a:clrScheme name=\"Office\">"
  10. "<a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1>"
  11. "<a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1>"
  12. "<a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2>"
  13. "<a:lt2><a:srgbClr val=\"EEECE1\"/></a:lt2>"
  14. "<a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1>"
  15. "<a:accent2><a:srgbClr val=\"C0504D\"/></a:accent2>"
  16. "<a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3>"
  17. "<a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4>"
  18. "<a:accent5><a:srgbClr val=\"4BACC6\"/></a:accent5>"
  19. "<a:accent6><a:srgbClr val=\"F79646\"/></a:accent6>"
  20. "<a:hlink><a:srgbClr val=\"0000FF\"/></a:hlink>"
  21. "<a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink>"
  22. "</a:clrScheme>"
  23. "<a:fontScheme name=\"Office\">"
  24. "<a:majorFont>"
  25. "<a:latin typeface=\"Cambria\"/>"
  26. "<a:ea typeface=\"\"/>"
  27. "<a:cs typeface=\"\"/>"
  28. "<a:font script=\"Jpan\" typeface=\"\xef\xbc\xad\xef\xbc\xb3 \xef\xbc\xb0\xe3\x82\xb4\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf\"/>"
  29. "<a:font script=\"Hang\" typeface=\"\xeb\xa7\x91\xec\x9d\x80 \xea\xb3\xa0\xeb\x94\x95\"/>"
  30. "<a:font script=\"Hans\" typeface=\"\xe5\xae\x8b\xe4\xbd\x93\"/>"
  31. "<a:font script=\"Hant\" typeface=\"\xe6\x96\xb0\xe7\xb4\xb0\xe6\x98\x8e\xe9\xab\x94\"/>"
  32. "<a:font script=\"Arab\" typeface=\"Times New Roman\"/>"
  33. "<a:font script=\"Hebr\" typeface=\"Times New Roman\"/>"
  34. "<a:font script=\"Thai\" typeface=\"Tahoma\"/>"
  35. "<a:font script=\"Ethi\" typeface=\"Nyala\"/>"
  36. "<a:font script=\"Beng\" typeface=\"Vrinda\"/>"
  37. "<a:font script=\"Gujr\" typeface=\"Shruti\"/>"
  38. "<a:font script=\"Khmr\" typeface=\"MoolBoran\"/>"
  39. "<a:font script=\"Knda\" typeface=\"Tunga\"/>"
  40. "<a:font script=\"Guru\" typeface=\"Raavi\"/>"
  41. "<a:font script=\"Cans\" typeface=\"Euphemia\"/>"
  42. "<a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>"
  43. "<a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>"
  44. "<a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>"
  45. "<a:font script=\"Thaa\" typeface=\"MV Boli\"/>"
  46. "<a:font script=\"Deva\" typeface=\"Mangal\"/>"
  47. "<a:font script=\"Telu\" typeface=\"Gautami\"/>"
  48. "<a:font script=\"Taml\" typeface=\"Latha\"/>"
  49. "<a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>"
  50. "<a:font script=\"Orya\" typeface=\"Kalinga\"/>"
  51. "<a:font script=\"Mlym\" typeface=\"Kartika\"/>"
  52. "<a:font script=\"Laoo\" typeface=\"DokChampa\"/>"
  53. "<a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>"
  54. "<a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>"
  55. "<a:font script=\"Viet\" typeface=\"Times New Roman\"/>"
  56. "<a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>"
  57. "</a:majorFont>"
  58. "<a:minorFont>"
  59. "<a:latin typeface=\"Calibri\"/>"
  60. "<a:ea typeface=\"\"/>"
  61. "<a:cs typeface=\"\"/>"
  62. "<a:font script=\"Jpan\" typeface=\"\xef\xbc\xad\xef\xbc\xb3 \xef\xbc\xb0\xe3\x82\xb4\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf\"/>"
  63. "<a:font script=\"Hang\" typeface=\"\xeb\xa7\x91\xec\x9d\x80 \xea\xb3\xa0\xeb\x94\x95\"/>"
  64. "<a:font script=\"Hans\" typeface=\"\xe5\xae\x8b\xe4\xbd\x93\"/>"
  65. "<a:font script=\"Hant\" typeface=\"\xe6\x96\xb0\xe7\xb4\xb0\xe6\x98\x8e\xe9\xab\x94\"/>"
  66. "<a:font script=\"Arab\" typeface=\"Arial\"/>"
  67. "<a:font script=\"Hebr\" typeface=\"Arial\"/>"
  68. "<a:font script=\"Thai\" typeface=\"Tahoma\"/>"
  69. "<a:font script=\"Ethi\" typeface=\"Nyala\"/>"
  70. "<a:font script=\"Beng\" typeface=\"Vrinda\"/>"
  71. "<a:font script=\"Gujr\" typeface=\"Shruti\"/>"
  72. "<a:font script=\"Khmr\" typeface=\"DaunPenh\"/>"
  73. "<a:font script=\"Knda\" typeface=\"Tunga\"/>"
  74. "<a:font script=\"Guru\" typeface=\"Raavi\"/>"
  75. "<a:font script=\"Cans\" typeface=\"Euphemia\"/>"
  76. "<a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>"
  77. "<a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>"
  78. "<a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>"
  79. "<a:font script=\"Thaa\" typeface=\"MV Boli\"/>"
  80. "<a:font script=\"Deva\" typeface=\"Mangal\"/>"
  81. "<a:font script=\"Telu\" typeface=\"Gautami\"/>"
  82. "<a:font script=\"Taml\" typeface=\"Latha\"/>"
  83. "<a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>"
  84. "<a:font script=\"Orya\" typeface=\"Kalinga\"/>"
  85. "<a:font script=\"Mlym\" typeface=\"Kartika\"/>"
  86. "<a:font script=\"Laoo\" typeface=\"DokChampa\"/>"
  87. "<a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>"
  88. "<a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>"
  89. "<a:font script=\"Viet\" typeface=\"Arial\"/>"
  90. "<a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>"
  91. "</a:minorFont>"
  92. "</a:fontScheme>"
  93. "<a:fmtScheme name=\"Office\">"
  94. "<a:fillStyleLst>"
  95. "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>"
  96. "<a:gradFill rotWithShape=\"1\">"
  97. "<a:gsLst>"
  98. "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs>"
  99. "<a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs>"
  100. "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs>"
  101. "</a:gsLst>"
  102. "<a:lin ang=\"16200000\" scaled=\"1\"/>"
  103. "</a:gradFill>"
  104. "<a:gradFill rotWithShape=\"1\">"
  105. "<a:gsLst>"
  106. "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:shade val=\"51000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs>"
  107. "<a:gs pos=\"80000\"><a:schemeClr val=\"phClr\"><a:shade val=\"93000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs>"
  108. "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"94000\"/><a:satMod val=\"135000\"/></a:schemeClr></a:gs>"
  109. "</a:gsLst>"
  110. "<a:lin ang=\"16200000\" scaled=\"0\"/>"
  111. "</a:gradFill>"
  112. "</a:fillStyleLst>"
  113. "<a:lnStyleLst>"
  114. "<a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">"
  115. "<a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/></a:schemeClr></a:solidFill>"
  116. "<a:prstDash val=\"solid\"/>"
  117. "</a:ln>"
  118. "<a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">"
  119. "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>"
  120. "<a:prstDash val=\"solid\"/>"
  121. "</a:ln>"
  122. "<a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">"
  123. "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>"
  124. "<a:prstDash val=\"solid\"/>"
  125. "</a:ln>"
  126. "</a:lnStyleLst>"
  127. "<a:effectStyleLst>"
  128. "<a:effectStyle>"
  129. "<a:effectLst>"
  130. "<a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\">"
  131. "<a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr>"
  132. "</a:outerShdw>"
  133. "</a:effectLst>"
  134. "</a:effectStyle>"
  135. "<a:effectStyle>"
  136. "<a:effectLst>"
  137. "<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">"
  138. "<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>"
  139. "</a:outerShdw>"
  140. "</a:effectLst>"
  141. "</a:effectStyle>"
  142. "<a:effectStyle>"
  143. "<a:effectLst>"
  144. "<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">"
  145. "<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>"
  146. "</a:outerShdw>"
  147. "</a:effectLst>"
  148. "<a:scene3d>"
  149. "<a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera>"
  150. "<a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig>"
  151. "</a:scene3d>"
  152. "<a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/></a:sp3d>"
  153. "</a:effectStyle>"
  154. "</a:effectStyleLst>"
  155. "<a:bgFillStyleLst>"
  156. "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>"
  157. "<a:gradFill rotWithShape=\"1\">"
  158. "<a:gsLst>"
  159. "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs>"
  160. "<a:gs pos=\"40000\"><a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs>"
  161. "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst>"
  162. "<a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path>"
  163. "</a:gradFill>"
  164. "<a:gradFill rotWithShape=\"1\">"
  165. "<a:gsLst>"
  166. "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs>"
  167. "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs>"
  168. "</a:gsLst>"
  169. "<a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path>"
  170. "</a:gradFill>"
  171. "</a:bgFillStyleLst>"
  172. "</a:fmtScheme>"
  173. "</a:themeElements>"
  174. "<a:objectDefaults/>"
  175. "<a:extraClrSchemeLst/>"
  176. "</a:theme>"
  177. ;
  178. Theme::Theme(CreateFlag flag)
  179. :AbstractOOXmlFile(flag)
  180. {
  181. }
  182. void Theme::saveToXmlFile(QIODevice *device) const
  183. {
  184. if (xmlData.isEmpty())
  185. device->write(defaultXmlData);
  186. else
  187. device->write(xmlData);
  188. }
  189. QByteArray Theme::saveToXmlData() const
  190. {
  191. if (xmlData.isEmpty())
  192. return defaultXmlData;
  193. else
  194. return xmlData;
  195. }
  196. bool Theme::loadFromXmlData(const QByteArray &data)
  197. {
  198. xmlData = data;
  199. return true;
  200. }
  201. bool Theme::loadFromXmlFile(QIODevice *device)
  202. {
  203. xmlData = device->readAll();
  204. return true;
  205. }
  206. QT_END_NAMESPACE_XLSX