• 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 "core/fxcrt/unowned_ptr.h"
11 #include "v8/include/cppgc/macros.h"
12 
13 namespace pdfium {
14 
15 class CFWL_Widget;
16 
17 class CFWL_Event {
18   CPPGC_STACK_ALLOCATED();  // Allow Raw/Unowned pointers.
19 
20  public:
21   enum class Type {
22     CheckStateChanged,
23     Click,
24     Close,
25     EditChanged,
26     Mouse,
27     PostDropDown,
28     PreDropDown,
29     Scroll,
30     SelectChanged,
31     TextWillChange,
32     TextFull,
33     Validate
34   };
35 
36   explicit CFWL_Event(Type type);
37   CFWL_Event(Type type, CFWL_Widget* pSrcTarget);
38   CFWL_Event(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
39   virtual ~CFWL_Event();
40 
GetType()41   Type GetType() const { return m_type; }
GetSrcTarget()42   CFWL_Widget* GetSrcTarget() const { return m_pSrcTarget; }
GetDstTarget()43   CFWL_Widget* GetDstTarget() const { return m_pDstTarget; }
44 
45  private:
46   const Type m_type;
47   UnownedPtr<CFWL_Widget> const m_pSrcTarget;
48   UnownedPtr<CFWL_Widget> const m_pDstTarget;
49 };
50 
51 }  // namespace pdfium
52 
53 // TODO(crbug.com/42271761): Remove.
54 using pdfium::CFWL_Event;
55 
56 #endif  // XFA_FWL_CFWL_EVENT_H_
57