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 XFA_FWL_CFWL_MESSAGE_H_ 8 #define XFA_FWL_CFWL_MESSAGE_H_ 9 10 #include "core/fxcrt/mask.h" 11 #include "core/fxcrt/unowned_ptr.h" 12 #include "v8/include/cppgc/macros.h" 13 14 namespace pdfium { 15 16 class CFWL_Widget; 17 18 class CFWL_Message { 19 CPPGC_STACK_ALLOCATED(); // Allow Raw/Unowned pointers. 20 21 public: 22 enum class Type { kKey, kKillFocus, kMouse, kMouseWheel, kSetFocus }; 23 24 virtual ~CFWL_Message(); 25 GetType()26 Type GetType() const { return m_type; } GetDstTarget()27 CFWL_Widget* GetDstTarget() const { return m_pDstTarget; } SetDstTarget(CFWL_Widget * pWidget)28 void SetDstTarget(CFWL_Widget* pWidget) { m_pDstTarget = pWidget; } 29 30 protected: 31 CFWL_Message(Type type, CFWL_Widget* pDstTarget); 32 CFWL_Message(const CFWL_Message& that) = delete; 33 CFWL_Message& operator=(const CFWL_Message& that) = delete; 34 35 private: 36 const Type m_type; 37 UnownedPtr<CFWL_Widget> m_pDstTarget; 38 }; 39 40 } // namespace pdfium 41 42 // TODO(crbug.com/42271761): Remove. 43 using pdfium::CFWL_Message; 44 45 #endif // XFA_FWL_CFWL_MESSAGE_H_ 46