Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: core/fpdfdoc/include/fpdf_doc.h

Issue 2049003003: Add some consts and remove more casts in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/doc_formfield.cpp ('k') | core/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 #define FORMFIELD_REQUIRED 0x02 563 #define FORMFIELD_REQUIRED 0x02
564 #define FORMFIELD_NOEXPORT 0x04 564 #define FORMFIELD_NOEXPORT 0x04
565 #define FORMRADIO_NOTOGGLEOFF 0x100 565 #define FORMRADIO_NOTOGGLEOFF 0x100
566 #define FORMRADIO_UNISON 0x200 566 #define FORMRADIO_UNISON 0x200
567 #define FORMTEXT_MULTILINE 0x100 567 #define FORMTEXT_MULTILINE 0x100
568 #define FORMTEXT_PASSWORD 0x200 568 #define FORMTEXT_PASSWORD 0x200
569 #define FORMTEXT_NOSCROLL 0x400 569 #define FORMTEXT_NOSCROLL 0x400
570 #define FORMTEXT_COMB 0x800 570 #define FORMTEXT_COMB 0x800
571 #define FORMCOMBO_EDIT 0x100 571 #define FORMCOMBO_EDIT 0x100
572 #define FORMLIST_MULTISELECT 0x100 572 #define FORMLIST_MULTISELECT 0x100
573
573 class CPDF_FormField { 574 class CPDF_FormField {
574 public: 575 public:
575 enum Type { 576 enum Type {
576 Unknown, 577 Unknown,
577 PushButton, 578 PushButton,
578 RadioButton, 579 RadioButton,
579 CheckBox, 580 CheckBox,
580 Text, 581 Text,
581 RichText, 582 RichText,
582 File, 583 File,
583 ListBox, 584 ListBox,
584 ComboBox, 585 ComboBox,
585 Sign 586 Sign
586 }; 587 };
587 588
588 CFX_WideString GetFullName(); 589 CFX_WideString GetFullName() const;
589 590
590 Type GetType() const { return m_Type; } 591 Type GetType() const { return m_Type; }
591 uint32_t GetFlags() const { return m_Flags; } 592 uint32_t GetFlags() const { return m_Flags; }
592 593
593 CPDF_Dictionary* GetFieldDict() const { return m_pDict; } 594 CPDF_Dictionary* GetFieldDict() const { return m_pDict; }
594 void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } 595 void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; }
595 596
596 FX_BOOL ResetField(FX_BOOL bNotify = FALSE); 597 FX_BOOL ResetField(FX_BOOL bNotify = FALSE);
597 598
598 int CountControls() const { return m_ControlList.GetSize(); } 599 int CountControls() const { return m_ControlList.GetSize(); }
599 600
600 CPDF_FormControl* GetControl(int index) const { 601 CPDF_FormControl* GetControl(int index) const {
601 return m_ControlList.GetAt(index); 602 return m_ControlList.GetAt(index);
602 } 603 }
603 604
604 int GetControlIndex(const CPDF_FormControl* pControl); 605 int GetControlIndex(const CPDF_FormControl* pControl) const;
606 int GetFieldType() const;
605 607
606 int GetFieldType(); 608 CPDF_AAction GetAdditionalAction() const;
609 CFX_WideString GetAlternateName() const;
610 CFX_WideString GetMappingName() const;
607 611
608 CPDF_AAction GetAdditionalAction(); 612 uint32_t GetFieldFlags() const;
613 CFX_ByteString GetDefaultStyle() const;
614 CFX_WideString GetRichTextString() const;
609 615
610 CFX_WideString GetAlternateName(); 616 CFX_WideString GetValue() const;
611 617 CFX_WideString GetDefaultValue() const;
612 CFX_WideString GetMappingName();
613
614 uint32_t GetFieldFlags();
615
616 CFX_ByteString GetDefaultStyle();
617
618 CFX_WideString GetRichTextString();
619
620 CFX_WideString GetValue();
621
622 CFX_WideString GetDefaultValue();
623
624 FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE); 618 FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE);
625 619
626 int GetMaxLen(); 620 int GetMaxLen() const;
627 621 int CountSelectedItems() const;
628 int CountSelectedItems(); 622 int GetSelectedIndex(int index) const;
629
630 int GetSelectedIndex(int index);
631 623
632 FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE); 624 FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE);
633 625 FX_BOOL IsItemSelected(int index) const;
634 FX_BOOL IsItemSelected(int index);
635
636 FX_BOOL SetItemSelection(int index, 626 FX_BOOL SetItemSelection(int index,
637 FX_BOOL bSelected, 627 FX_BOOL bSelected,
638 FX_BOOL bNotify = FALSE); 628 FX_BOOL bNotify = FALSE);
639 629
640 FX_BOOL IsItemDefaultSelected(int index); 630 FX_BOOL IsItemDefaultSelected(int index) const;
641 631
642 int GetDefaultSelectedItem(); 632 int GetDefaultSelectedItem() const;
633 int CountOptions() const;
643 634
644 int CountOptions(); 635 CFX_WideString GetOptionLabel(int index) const;
636 CFX_WideString GetOptionValue(int index) const;
645 637
646 CFX_WideString GetOptionLabel(int index); 638 int FindOption(CFX_WideString csOptLabel) const;
647 639 int FindOptionValue(const CFX_WideString& csOptValue) const;
648 CFX_WideString GetOptionValue(int index);
649
650 int FindOption(CFX_WideString csOptLabel);
651
652 int FindOptionValue(const CFX_WideString& csOptValue);
653 640
654 FX_BOOL CheckControl(int iControlIndex, bool bChecked, bool bNotify = false); 641 FX_BOOL CheckControl(int iControlIndex, bool bChecked, bool bNotify = false);
655 642
656 int GetTopVisibleIndex(); 643 int GetTopVisibleIndex() const;
644 int CountSelectedOptions() const;
657 645
658 int CountSelectedOptions(); 646 int GetSelectedOptionIndex(int index) const;
659 647 FX_BOOL IsOptionSelected(int iOptIndex) const;
660 int GetSelectedOptionIndex(int index);
661
662 FX_BOOL IsOptionSelected(int iOptIndex);
663 648
664 FX_BOOL SelectOption(int iOptIndex, 649 FX_BOOL SelectOption(int iOptIndex,
665 FX_BOOL bSelected, 650 FX_BOOL bSelected,
666 FX_BOOL bNotify = FALSE); 651 FX_BOOL bNotify = FALSE);
667 652
668 FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); 653 FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE);
669 654
670 #ifdef PDF_ENABLE_XFA 655 #ifdef PDF_ENABLE_XFA
671 FX_BOOL ClearOptions(FX_BOOL bNotify = FALSE); 656 FX_BOOL ClearOptions(FX_BOOL bNotify = FALSE);
672 657
673 int InsertOption(CFX_WideString csOptLabel, 658 int InsertOption(CFX_WideString csOptLabel,
674 int index = -1, 659 int index = -1,
675 FX_BOOL bNotify = FALSE); 660 FX_BOOL bNotify = FALSE);
676 #endif // PDF_ENABLE_XFA 661 #endif // PDF_ENABLE_XFA
677 662
678 FX_FLOAT GetFontSize() { return m_FontSize; } 663 FX_FLOAT GetFontSize() const { return m_FontSize; }
679 664 CPDF_Font* GetFont() const { return m_pFont; }
680 CPDF_Font* GetFont() { return m_pFont; }
681 665
682 protected: 666 protected:
683 CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); 667 CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict);
684 ~CPDF_FormField(); 668 ~CPDF_FormField();
685 669
686 CFX_WideString GetValue(FX_BOOL bDefault); 670 CFX_WideString GetValue(FX_BOOL bDefault) const;
687
688 FX_BOOL SetValue(const CFX_WideString& value, 671 FX_BOOL SetValue(const CFX_WideString& value,
689 FX_BOOL bDefault, 672 FX_BOOL bDefault,
690 FX_BOOL bNotify); 673 FX_BOOL bNotify);
691 674
692 void SyncFieldFlags(); 675 void SyncFieldFlags();
693
694 int FindListSel(CPDF_String* str); 676 int FindListSel(CPDF_String* str);
695 677 CFX_WideString GetOptionText(int index, int sub_index) const;
696 CFX_WideString GetOptionText(int index, int sub_index);
697 678
698 void LoadDA(); 679 void LoadDA();
699 680 CFX_WideString GetCheckValue(FX_BOOL bDefault) const;
700 CFX_WideString GetCheckValue(FX_BOOL bDefault);
701
702 FX_BOOL SetCheckValue(const CFX_WideString& value, 681 FX_BOOL SetCheckValue(const CFX_WideString& value,
703 FX_BOOL bDefault, 682 FX_BOOL bDefault,
704 FX_BOOL bNotify); 683 FX_BOOL bNotify);
705 684
706 bool NotifyBeforeSelectionChange(const CFX_WideString& value); 685 bool NotifyBeforeSelectionChange(const CFX_WideString& value);
707 void NotifyAfterSelectionChange(); 686 void NotifyAfterSelectionChange();
708 687
709 bool NotifyBeforeValueChange(const CFX_WideString& value); 688 bool NotifyBeforeValueChange(const CFX_WideString& value);
710 void NotifyAfterValueChange(); 689 void NotifyAfterValueChange();
711 690
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const; 934 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const;
956 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const; 935 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const;
957 936
958 CPDF_Dictionary* const m_pDict; 937 CPDF_Dictionary* const m_pDict;
959 }; 938 };
960 939
961 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, 940 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
962 CPDF_Annot::AppearanceMode mode); 941 CPDF_Annot::AppearanceMode mode);
963 942
964 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 943 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/doc_formfield.cpp ('k') | core/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698