OLD | NEW |
1 #ifndef __DEFINED__SkPdfEncodingDictionary | 1 #ifndef __DEFINED__SkPdfEncodingDictionary |
2 #define __DEFINED__SkPdfEncodingDictionary | 2 #define __DEFINED__SkPdfEncodingDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfDictionary_autogen.h" | 6 #include "SkPdfDictionary_autogen.h" |
7 | 7 |
| 8 // Entries in an encoding dictionary |
8 class SkPdfEncodingDictionary : public SkPdfDictionary { | 9 class SkPdfEncodingDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kEncodingDictionary_SkPdfObje
ctType;} | 11 virtual SkPdfObjectType getType() const { return kEncodingDictionary_SkPdfObje
ctType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kEncodin
gDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kEncodin
gDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfEncodingDictionary* asEncodingDictionary() {return this;} | 14 virtual SkPdfEncodingDictionary* asEncodingDictionary() {return this;} |
14 virtual const SkPdfEncodingDictionary* asEncodingDictionary() const {return th
is;} | 15 virtual const SkPdfEncodingDictionary* asEncodingDictionary() const {return th
is;} |
15 | 16 |
16 private: | 17 private: |
17 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} | 18 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 515 |
515 public: | 516 public: |
516 private: | 517 private: |
517 public: | 518 public: |
518 SkPdfEncodingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObjec
t* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfEncodingDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObjec
t* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfEncodingDictionary& operator=(const SkPdfEncodingDictionary& from) {this-
>fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;
} | 523 SkPdfEncodingDictionary& operator=(const SkPdfEncodingDictionary& from) {this-
>fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;
} |
523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, must |
| 526 * be Encoding for an encoding dictionary. |
| 527 **/ |
| 528 bool has_Type() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 530 } |
| 531 |
524 std::string Type() const { | 532 std::string Type() const { |
525 std::string ret; | 533 std::string ret; |
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; |
527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 535 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
528 return ""; | 536 return ""; |
529 } | 537 } |
530 | 538 |
| 539 /** (Optional) The base encoding-that is, the encoding from which the Difference
s |
| 540 * entry (if present) describes differences-specified as the name of a predefin
ed |
| 541 * encoding MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding (see |
| 542 * Appendix D). |
| 543 * If this entry is absent, the Differences entry describes differences from an
im- |
| 544 * plicit base encoding. For a font program that is embedded in the PDF file, t
he |
| 545 * implicit base encoding is the font program's built-in encoding, as described |
| 546 * above and further elaborated in the sections on specific font types below. O
ther- |
| 547 * wise, for a nonsymbolic font, it is StandardEncoding, and for a symbolic fon
t, it |
| 548 * is the font's built-in encoding. |
| 549 **/ |
| 550 bool has_BaseEncoding() const { |
| 551 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BaseE
ncoding", "", NULL)); |
| 552 } |
| 553 |
531 std::string BaseEncoding() const { | 554 std::string BaseEncoding() const { |
532 std::string ret; | 555 std::string ret; |
533 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BaseEncodin
g", "", &ret)) return ret; | 556 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BaseEncodin
g", "", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 557 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return ""; | 558 return ""; |
536 } | 559 } |
537 | 560 |
| 561 /** (Optional; not recommended with TrueType fonts) An array describing the diff
er- |
| 562 * ences from the encoding specified by BaseEncoding or, if BaseEncoding is ab- |
| 563 * sent, from an implicit base encoding. The Differences array is described abo
ve. |
| 564 **/ |
| 565 bool has_Differences() const { |
| 566 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Diffe
rences", "", NULL)); |
| 567 } |
| 568 |
538 SkPdfArray Differences() const { | 569 SkPdfArray Differences() const { |
539 SkPdfArray ret; | 570 SkPdfArray ret; |
540 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Difference
s", "", &ret)) return ret; | 571 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Difference
s", "", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 572 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return SkPdfArray(); | 573 return SkPdfArray(); |
543 } | 574 } |
544 | 575 |
545 }; | 576 }; |
546 | 577 |
547 #endif // __DEFINED__SkPdfEncodingDictionary | 578 #endif // __DEFINED__SkPdfEncodingDictionary |
OLD | NEW |