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 class CFWL_Widget; 15 16 class CFWL_Message { 17 CPPGC_STACK_ALLOCATED(); // Allow Raw/Unowned pointers. 18 19 public: 20 enum class Type { kKey, kKillFocus, kMouse, kMouseWheel, kSetFocus }; 21 22 virtual ~CFWL_Message(); 23 GetType()24 Type GetType() const { return m_type; } GetDstTarget()25 CFWL_Widget* GetDstTarget() const { return m_pDstTarget; } SetDstTarget(CFWL_Widget * pWidget)26 void SetDstTarget(CFWL_Widget* pWidget) { m_pDstTarget = pWidget; } 27 28 protected: 29 CFWL_Message(Type type, CFWL_Widget* pDstTarget); 30 CFWL_Message(const CFWL_Message& that) = delete; 31 CFWL_Message& operator=(const CFWL_Message& that) = delete; 32 33 private: 34 const Type m_type; 35 UnownedPtr<CFWL_Widget> m_pDstTarget; 36 }; 37 38 #endif // XFA_FWL_CFWL_MESSAGE_H_ 39