Mercurial > clickerconvert
comparison src/xlsx/xlsxtheme.cpp @ 1:93d3106bb9a4
Add qt xlsx library
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 22 Mar 2016 10:38:08 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:49cd5cc0b072 | 1:93d3106bb9a4 |
---|---|
1 /**************************************************************************** | |
2 ** Copyright (c) 2013-2014 Debao Zhang <hello@debao.me> | |
3 ** All right reserved. | |
4 ** | |
5 ** Permission is hereby granted, free of charge, to any person obtaining | |
6 ** a copy of this software and associated documentation files (the | |
7 ** "Software"), to deal in the Software without restriction, including | |
8 ** without limitation the rights to use, copy, modify, merge, publish, | |
9 ** distribute, sublicense, and/or sell copies of the Software, and to | |
10 ** permit persons to whom the Software is furnished to do so, subject to | |
11 ** the following conditions: | |
12 ** | |
13 ** The above copyright notice and this permission notice shall be | |
14 ** included in all copies or substantial portions of the Software. | |
15 ** | |
16 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
17 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
18 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
19 ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
20 ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |
21 ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
22 ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
23 ** | |
24 ****************************************************************************/ | |
25 #include "xlsxtheme_p.h" | |
26 #include <QIODevice> | |
27 | |
28 namespace QXlsx { | |
29 | |
30 const char *defaultXmlData = | |
31 "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" | |
32 "<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office \xe4\xb8\xbb\xe9\xa2\x98\">" | |
33 "<a:themeElements>" | |
34 "<a:clrScheme name=\"Office\">" | |
35 "<a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1>" | |
36 "<a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1>" | |
37 "<a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2>" | |
38 "<a:lt2><a:srgbClr val=\"EEECE1\"/></a:lt2>" | |
39 "<a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1>" | |
40 "<a:accent2><a:srgbClr val=\"C0504D\"/></a:accent2>" | |
41 "<a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3>" | |
42 "<a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4>" | |
43 "<a:accent5><a:srgbClr val=\"4BACC6\"/></a:accent5>" | |
44 "<a:accent6><a:srgbClr val=\"F79646\"/></a:accent6>" | |
45 "<a:hlink><a:srgbClr val=\"0000FF\"/></a:hlink>" | |
46 "<a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink>" | |
47 "</a:clrScheme>" | |
48 "<a:fontScheme name=\"Office\">" | |
49 "<a:majorFont>" | |
50 "<a:latin typeface=\"Cambria\"/>" | |
51 "<a:ea typeface=\"\"/>" | |
52 "<a:cs typeface=\"\"/>" | |
53 "<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\"/>" | |
54 "<a:font script=\"Hang\" typeface=\"\xeb\xa7\x91\xec\x9d\x80 \xea\xb3\xa0\xeb\x94\x95\"/>" | |
55 "<a:font script=\"Hans\" typeface=\"\xe5\xae\x8b\xe4\xbd\x93\"/>" | |
56 "<a:font script=\"Hant\" typeface=\"\xe6\x96\xb0\xe7\xb4\xb0\xe6\x98\x8e\xe9\xab\x94\"/>" | |
57 "<a:font script=\"Arab\" typeface=\"Times New Roman\"/>" | |
58 "<a:font script=\"Hebr\" typeface=\"Times New Roman\"/>" | |
59 "<a:font script=\"Thai\" typeface=\"Tahoma\"/>" | |
60 "<a:font script=\"Ethi\" typeface=\"Nyala\"/>" | |
61 "<a:font script=\"Beng\" typeface=\"Vrinda\"/>" | |
62 "<a:font script=\"Gujr\" typeface=\"Shruti\"/>" | |
63 "<a:font script=\"Khmr\" typeface=\"MoolBoran\"/>" | |
64 "<a:font script=\"Knda\" typeface=\"Tunga\"/>" | |
65 "<a:font script=\"Guru\" typeface=\"Raavi\"/>" | |
66 "<a:font script=\"Cans\" typeface=\"Euphemia\"/>" | |
67 "<a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>" | |
68 "<a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>" | |
69 "<a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>" | |
70 "<a:font script=\"Thaa\" typeface=\"MV Boli\"/>" | |
71 "<a:font script=\"Deva\" typeface=\"Mangal\"/>" | |
72 "<a:font script=\"Telu\" typeface=\"Gautami\"/>" | |
73 "<a:font script=\"Taml\" typeface=\"Latha\"/>" | |
74 "<a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>" | |
75 "<a:font script=\"Orya\" typeface=\"Kalinga\"/>" | |
76 "<a:font script=\"Mlym\" typeface=\"Kartika\"/>" | |
77 "<a:font script=\"Laoo\" typeface=\"DokChampa\"/>" | |
78 "<a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>" | |
79 "<a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>" | |
80 "<a:font script=\"Viet\" typeface=\"Times New Roman\"/>" | |
81 "<a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>" | |
82 "</a:majorFont>" | |
83 "<a:minorFont>" | |
84 "<a:latin typeface=\"Calibri\"/>" | |
85 "<a:ea typeface=\"\"/>" | |
86 "<a:cs typeface=\"\"/>" | |
87 "<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\"/>" | |
88 "<a:font script=\"Hang\" typeface=\"\xeb\xa7\x91\xec\x9d\x80 \xea\xb3\xa0\xeb\x94\x95\"/>" | |
89 "<a:font script=\"Hans\" typeface=\"\xe5\xae\x8b\xe4\xbd\x93\"/>" | |
90 "<a:font script=\"Hant\" typeface=\"\xe6\x96\xb0\xe7\xb4\xb0\xe6\x98\x8e\xe9\xab\x94\"/>" | |
91 "<a:font script=\"Arab\" typeface=\"Arial\"/>" | |
92 "<a:font script=\"Hebr\" typeface=\"Arial\"/>" | |
93 "<a:font script=\"Thai\" typeface=\"Tahoma\"/>" | |
94 "<a:font script=\"Ethi\" typeface=\"Nyala\"/>" | |
95 "<a:font script=\"Beng\" typeface=\"Vrinda\"/>" | |
96 "<a:font script=\"Gujr\" typeface=\"Shruti\"/>" | |
97 "<a:font script=\"Khmr\" typeface=\"DaunPenh\"/>" | |
98 "<a:font script=\"Knda\" typeface=\"Tunga\"/>" | |
99 "<a:font script=\"Guru\" typeface=\"Raavi\"/>" | |
100 "<a:font script=\"Cans\" typeface=\"Euphemia\"/>" | |
101 "<a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>" | |
102 "<a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>" | |
103 "<a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>" | |
104 "<a:font script=\"Thaa\" typeface=\"MV Boli\"/>" | |
105 "<a:font script=\"Deva\" typeface=\"Mangal\"/>" | |
106 "<a:font script=\"Telu\" typeface=\"Gautami\"/>" | |
107 "<a:font script=\"Taml\" typeface=\"Latha\"/>" | |
108 "<a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>" | |
109 "<a:font script=\"Orya\" typeface=\"Kalinga\"/>" | |
110 "<a:font script=\"Mlym\" typeface=\"Kartika\"/>" | |
111 "<a:font script=\"Laoo\" typeface=\"DokChampa\"/>" | |
112 "<a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>" | |
113 "<a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>" | |
114 "<a:font script=\"Viet\" typeface=\"Arial\"/>" | |
115 "<a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>" | |
116 "</a:minorFont>" | |
117 "</a:fontScheme>" | |
118 "<a:fmtScheme name=\"Office\">" | |
119 "<a:fillStyleLst>" | |
120 "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>" | |
121 "<a:gradFill rotWithShape=\"1\">" | |
122 "<a:gsLst>" | |
123 "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs>" | |
124 "<a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs>" | |
125 "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs>" | |
126 "</a:gsLst>" | |
127 "<a:lin ang=\"16200000\" scaled=\"1\"/>" | |
128 "</a:gradFill>" | |
129 "<a:gradFill rotWithShape=\"1\">" | |
130 "<a:gsLst>" | |
131 "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:shade val=\"51000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs>" | |
132 "<a:gs pos=\"80000\"><a:schemeClr val=\"phClr\"><a:shade val=\"93000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs>" | |
133 "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"94000\"/><a:satMod val=\"135000\"/></a:schemeClr></a:gs>" | |
134 "</a:gsLst>" | |
135 "<a:lin ang=\"16200000\" scaled=\"0\"/>" | |
136 "</a:gradFill>" | |
137 "</a:fillStyleLst>" | |
138 "<a:lnStyleLst>" | |
139 "<a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">" | |
140 "<a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/></a:schemeClr></a:solidFill>" | |
141 "<a:prstDash val=\"solid\"/>" | |
142 "</a:ln>" | |
143 "<a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">" | |
144 "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>" | |
145 "<a:prstDash val=\"solid\"/>" | |
146 "</a:ln>" | |
147 "<a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">" | |
148 "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>" | |
149 "<a:prstDash val=\"solid\"/>" | |
150 "</a:ln>" | |
151 "</a:lnStyleLst>" | |
152 "<a:effectStyleLst>" | |
153 "<a:effectStyle>" | |
154 "<a:effectLst>" | |
155 "<a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\">" | |
156 "<a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr>" | |
157 "</a:outerShdw>" | |
158 "</a:effectLst>" | |
159 "</a:effectStyle>" | |
160 "<a:effectStyle>" | |
161 "<a:effectLst>" | |
162 "<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">" | |
163 "<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>" | |
164 "</a:outerShdw>" | |
165 "</a:effectLst>" | |
166 "</a:effectStyle>" | |
167 "<a:effectStyle>" | |
168 "<a:effectLst>" | |
169 "<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">" | |
170 "<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>" | |
171 "</a:outerShdw>" | |
172 "</a:effectLst>" | |
173 "<a:scene3d>" | |
174 "<a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera>" | |
175 "<a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig>" | |
176 "</a:scene3d>" | |
177 "<a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/></a:sp3d>" | |
178 "</a:effectStyle>" | |
179 "</a:effectStyleLst>" | |
180 "<a:bgFillStyleLst>" | |
181 "<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>" | |
182 "<a:gradFill rotWithShape=\"1\">" | |
183 "<a:gsLst>" | |
184 "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs>" | |
185 "<a:gs pos=\"40000\"><a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs>" | |
186 "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst>" | |
187 "<a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path>" | |
188 "</a:gradFill>" | |
189 "<a:gradFill rotWithShape=\"1\">" | |
190 "<a:gsLst>" | |
191 "<a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs>" | |
192 "<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs>" | |
193 "</a:gsLst>" | |
194 "<a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path>" | |
195 "</a:gradFill>" | |
196 "</a:bgFillStyleLst>" | |
197 "</a:fmtScheme>" | |
198 "</a:themeElements>" | |
199 "<a:objectDefaults/>" | |
200 "<a:extraClrSchemeLst/>" | |
201 "</a:theme>" | |
202 ; | |
203 | |
204 Theme::Theme(CreateFlag flag) | |
205 :AbstractOOXmlFile(flag) | |
206 { | |
207 } | |
208 | |
209 void Theme::saveToXmlFile(QIODevice *device) const | |
210 { | |
211 if (xmlData.isEmpty()) | |
212 device->write(defaultXmlData); | |
213 else | |
214 device->write(xmlData); | |
215 } | |
216 | |
217 QByteArray Theme::saveToXmlData() const | |
218 { | |
219 if (xmlData.isEmpty()) | |
220 return defaultXmlData; | |
221 else | |
222 return xmlData; | |
223 } | |
224 | |
225 bool Theme::loadFromXmlData(const QByteArray &data) | |
226 { | |
227 xmlData = data; | |
228 return true; | |
229 } | |
230 | |
231 bool Theme::loadFromXmlFile(QIODevice *device) | |
232 { | |
233 xmlData = device->readAll(); | |
234 return true; | |
235 } | |
236 | |
237 } |