xref: /aosp_15_r20/external/pdfium/xfa/fwl/cfwl_event.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
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_EVENT_H_
8 #define XFA_FWL_CFWL_EVENT_H_
9 
10 #include "core/fxcrt/unowned_ptr.h"
11 #include "v8/include/cppgc/macros.h"
12 
13 class CFWL_Widget;
14 
15 class CFWL_Event {
16   CPPGC_STACK_ALLOCATED();  // Allow Raw/Unowned pointers.
17 
18  public:
19   enum class Type {
20     CheckStateChanged,
21     Click,
22     Close,
23     EditChanged,
24     Mouse,
25     PostDropDown,
26     PreDropDown,
27     Scroll,
28     SelectChanged,
29     TextWillChange,
30     TextFull,
31     Validate
32   };
33 
34   explicit CFWL_Event(Type type);
35   CFWL_Event(Type type, CFWL_Widget* pSrcTarget);
36   CFWL_Event(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
37   virtual ~CFWL_Event();
38 
GetType()39   Type GetType() const { return m_type; }
GetSrcTarget()40   CFWL_Widget* GetSrcTarget() const { return m_pSrcTarget; }
GetDstTarget()41   CFWL_Widget* GetDstTarget() const { return m_pDstTarget; }
42 
43  private:
44   const Type m_type;
45   UnownedPtr<CFWL_Widget> const m_pSrcTarget;
46   UnownedPtr<CFWL_Widget> const m_pDstTarget;
47 };
48 
49 #endif  // XFA_FWL_CFWL_EVENT_H_
50