1 // Copyright 2016 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FPDFDOC_CPDF_AACTION_H_ 8 #define CORE_FPDFDOC_CPDF_AACTION_H_ 9 10 #include "core/fpdfapi/parser/cpdf_dictionary.h" 11 #include "core/fpdfdoc/cpdf_action.h" 12 #include "core/fxcrt/retain_ptr.h" 13 14 class CPDF_AAction { 15 public: 16 enum AActionType { 17 kCursorEnter = 0, 18 kCursorExit, 19 kButtonDown, 20 kButtonUp, 21 kGetFocus, 22 kLoseFocus, 23 kPageOpen, 24 kPageClose, 25 kPageVisible, 26 kPageInvisible, 27 kOpenPage, 28 kClosePage, 29 kKeyStroke, 30 kFormat, 31 kValidate, 32 kCalculate, 33 kCloseDocument, 34 kSaveDocument, 35 kDocumentSaved, 36 kPrintDocument, 37 kDocumentPrinted, 38 kDocumentOpen, 39 kNumberOfActions // Must be last. 40 }; 41 42 explicit CPDF_AAction(RetainPtr<const CPDF_Dictionary> pDict); 43 CPDF_AAction(const CPDF_AAction& that); 44 ~CPDF_AAction(); 45 46 bool ActionExist(AActionType eType) const; 47 CPDF_Action GetAction(AActionType eType) const; HasDict()48 bool HasDict() const { return !!m_pDict; } 49 50 static bool IsUserInput(AActionType type); 51 52 private: 53 RetainPtr<const CPDF_Dictionary> const m_pDict; 54 }; 55 56 #endif // CORE_FPDFDOC_CPDF_AACTION_H_ 57