• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "v8/include/cppgc/macros.h"
11 
12 class CFWL_Widget;
13 
14 class CFWL_Event {
15   CPPGC_STACK_ALLOCATED();  // Allow Raw/Unowned pointers.
16 
17  public:
18   enum class Type {
19     CheckStateChanged,
20     Click,
21     Close,
22     EditChanged,
23     Mouse,
24     PostDropDown,
25     PreDropDown,
26     Scroll,
27     SelectChanged,
28     TextWillChange,
29     TextFull,
30     Validate
31   };
32 
33   explicit CFWL_Event(Type type);
34   CFWL_Event(Type type, CFWL_Widget* pSrcTarget);
35   CFWL_Event(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
36   virtual ~CFWL_Event();
37 
GetType()38   Type GetType() const { return m_type; }
GetSrcTarget()39   CFWL_Widget* GetSrcTarget() const { return m_pSrcTarget; }
GetDstTarget()40   CFWL_Widget* GetDstTarget() const { return m_pDstTarget; }
41 
42  private:
43   const Type m_type;
44   CFWL_Widget* const m_pSrcTarget = nullptr;
45   CFWL_Widget* const m_pDstTarget = nullptr;
46 };
47 
48 #endif  // XFA_FWL_CFWL_EVENT_H_
49