OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkDocument_DEFINED | 8 #ifndef SkDocument_DEFINED |
9 #define SkDocument_DEFINED | 9 #define SkDocument_DEFINED |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 */ | 146 */ |
147 struct Attribute { | 147 struct Attribute { |
148 SkString fKey, fValue; | 148 SkString fKey, fValue; |
149 Attribute(const SkString& k, const SkString& v) : fKey(k), fValue(v) {} | 149 Attribute(const SkString& k, const SkString& v) : fKey(k), fValue(v) {} |
150 }; | 150 }; |
151 virtual void setMetadata(const SkDocument::Attribute[], | 151 virtual void setMetadata(const SkDocument::Attribute[], |
152 int /* attributeCount */, | 152 int /* attributeCount */, |
153 const SkTime::DateTime* /* creationDate */, | 153 const SkTime::DateTime* /* creationDate */, |
154 const SkTime::DateTime* /* modifiedDate */) {} | 154 const SkTime::DateTime* /* modifiedDate */) {} |
155 | 155 |
156 // This version is deprecated. | |
157 void setMetadata(const SkTArray<SkDocument::Attribute>& att, | |
158 const SkTime::DateTime* creation, | |
159 const SkTime::DateTime* modified) { | |
160 this->setMetadata(&att[0], att.count(), creation, modified); | |
161 } | |
162 | |
163 protected: | 156 protected: |
164 SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted)); | 157 SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted)); |
165 | 158 |
166 // note: subclasses must call close() in their destructor, as the base class | 159 // note: subclasses must call close() in their destructor, as the base class |
167 // cannot do this for them. | 160 // cannot do this for them. |
168 virtual ~SkDocument(); | 161 virtual ~SkDocument(); |
169 | 162 |
170 virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height, | 163 virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height, |
171 const SkRect& content) = 0; | 164 const SkRect& content) = 0; |
172 virtual void onEndPage() = 0; | 165 virtual void onEndPage() = 0; |
(...skipping 12 matching lines...) Expand all Loading... |
185 | 178 |
186 private: | 179 private: |
187 SkWStream* fStream; | 180 SkWStream* fStream; |
188 void (*fDoneProc)(SkWStream*, bool aborted); | 181 void (*fDoneProc)(SkWStream*, bool aborted); |
189 State fState; | 182 State fState; |
190 | 183 |
191 typedef SkRefCnt INHERITED; | 184 typedef SkRefCnt INHERITED; |
192 }; | 185 }; |
193 | 186 |
194 #endif | 187 #endif |
OLD | NEW |