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

Unified Diff: core/fpdfdoc/include/cpdf_annot.h

Issue 2295953002: Use enum class for subtypes of CPDF_Annot. (Closed)
Patch Set: Use enum class for subtypes of CPDF_Annot. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_annotlist.cpp ('k') | fpdfsdk/cba_annotiterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/include/cpdf_annot.h
diff --git a/core/fpdfdoc/include/cpdf_annot.h b/core/fpdfdoc/include/cpdf_annot.h
index 416c540cc3b7ba5ef571476671190ff84aedc05e..82b3d3ca3132db318c73e85995d969162eb1e329 100644
--- a/core/fpdfdoc/include/cpdf_annot.h
+++ b/core/fpdfdoc/include/cpdf_annot.h
@@ -36,13 +36,46 @@ class CPDF_Stream;
class CPDF_Annot {
public:
enum AppearanceMode { Normal, Rollover, Down };
+ enum class Subtype {
+ UNKNOWN = 0,
+ TEXT,
+ LINK,
+ FREETEXT,
+ LINE,
+ SQUARE,
+ CIRCLE,
+ POLYGON,
+ POLYLINE,
+ HIGHLIGHT,
+ UNDERLINE,
+ SQUIGGLY,
+ STRIKEOUT,
+ STAMP,
+ CARET,
+ INK,
+ POPUP,
+ FILEATTACHMENT,
+ SOUND,
+ MOVIE,
+ WIDGET,
+ SCREEN,
+ PRINTERMARK,
+ TRAPNET,
+ WATERMARK,
+ THREED,
+ RICHMEDIA,
+ XFAWIDGET
+ };
static bool IsAnnotationHidden(CPDF_Dictionary* pAnnotDict);
+ static CPDF_Annot::Subtype StringToAnnotSubtype(
+ const CFX_ByteString& sSubtype);
+ static CFX_ByteString AnnotSubtypeToString(CPDF_Annot::Subtype nSubtype);
CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument);
~CPDF_Annot();
- CFX_ByteString GetSubtype() const;
+ CPDF_Annot::Subtype GetSubtype() const;
uint32_t GetFlags() const;
CFX_FloatRect GetRect() const;
const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; }
@@ -70,7 +103,7 @@ class CPDF_Annot {
CPDF_Dictionary* const m_pAnnotDict;
CPDF_Document* const m_pDocument;
- const CFX_ByteString m_sSubtype;
+ CPDF_Annot::Subtype m_nSubtype;
std::map<CPDF_Stream*, std::unique_ptr<CPDF_Form>> m_APMap;
// |m_bOpenState| is only set for popup annotations.
bool m_bOpenState;
« no previous file with comments | « core/fpdfdoc/cpdf_annotlist.cpp ('k') | fpdfsdk/cba_annotiterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698