OLD | NEW |
1 #ifndef __DEFINED__SkPdfOutlineDictionary | 1 #ifndef __DEFINED__SkPdfOutlineDictionary |
2 #define __DEFINED__SkPdfOutlineDictionary | 2 #define __DEFINED__SkPdfOutlineDictionary |
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 the outline dictionary |
8 class SkPdfOutlineDictionary : public SkPdfDictionary { | 9 class SkPdfOutlineDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kOutlineDictionary_SkPdfObjec
tType;} | 11 virtual SkPdfObjectType getType() const { return kOutlineDictionary_SkPdfObjec
tType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kOutline
Dictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kOutline
Dictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfOutlineDictionary* asOutlineDictionary() {return this;} | 14 virtual SkPdfOutlineDictionary* asOutlineDictionary() {return this;} |
14 virtual const SkPdfOutlineDictionary* asOutlineDictionary() const {return this
;} | 15 virtual const SkPdfOutlineDictionary* asOutlineDictionary() const {return this
;} |
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 SkPdfOutlineDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject
* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfOutlineDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject
* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfOutlineDictionary& operator=(const SkPdfOutlineDictionary& from) {this->f
PodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} | 523 SkPdfOutlineDictionary& operator=(const SkPdfOutlineDictionary& from) {this->f
PodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} |
523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, |
| 526 * must be Outlines for an outline 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 /** (Required; must be an indirect reference) An outline item dictionary represe
nt- |
| 540 * ing the first top-level item in the outline. |
| 541 **/ |
| 542 bool has_First() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "First
", "", NULL)); |
| 544 } |
| 545 |
531 SkPdfDictionary* First() const { | 546 SkPdfDictionary* First() const { |
532 SkPdfDictionary* ret; | 547 SkPdfDictionary* ret; |
533 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "First
", "", &ret)) return ret; | 548 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "First
", "", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 549 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return NULL; | 550 return NULL; |
536 } | 551 } |
537 | 552 |
| 553 /** (Required; must be an indirect reference) An outline item dictionary represe
nt- |
| 554 * ing the last top-level item in the outline. |
| 555 **/ |
| 556 bool has_Last() const { |
| 557 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Last"
, "", NULL)); |
| 558 } |
| 559 |
538 SkPdfDictionary* Last() const { | 560 SkPdfDictionary* Last() const { |
539 SkPdfDictionary* ret; | 561 SkPdfDictionary* ret; |
540 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Last"
, "", &ret)) return ret; | 562 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Last"
, "", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 563 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return NULL; | 564 return NULL; |
543 } | 565 } |
544 | 566 |
| 567 /** (Required if the document has any open outline entries) The total number of |
| 568 * open items at all levels of the outline. This entry should be omitted if the
re |
| 569 * are no open outline items. |
| 570 **/ |
| 571 bool has_Count() const { |
| 572 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Count
", "", NULL)); |
| 573 } |
| 574 |
545 long Count() const { | 575 long Count() const { |
546 long ret; | 576 long ret; |
547 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Count", "",
&ret)) return ret; | 577 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Count", "",
&ret)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 578 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return 0; | 579 return 0; |
550 } | 580 } |
551 | 581 |
552 }; | 582 }; |
553 | 583 |
554 #endif // __DEFINED__SkPdfOutlineDictionary | 584 #endif // __DEFINED__SkPdfOutlineDictionary |
OLD | NEW |