• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 PDFium Authors. All rights reserved.
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/observed_ptr.h"
11 #include "xfa/fwl/cfwl_widget.h"
12 
13 class CFWL_Event {
14  public:
15   enum class Type {
16     CheckStateChanged,
17     Click,
18     Close,
19     EditChanged,
20     Mouse,
21     PostDropDown,
22     PreDropDown,
23     Scroll,
24     SelectChanged,
25     TextWillChange,
26     TextFull,
27     Validate
28   };
29 
30   explicit CFWL_Event(Type type);
31   CFWL_Event(Type type, CFWL_Widget* pSrcTarget);
32   CFWL_Event(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
33   virtual ~CFWL_Event();
34 
GetType()35   Type GetType() const { return m_type; }
GetSrcTarget()36   CFWL_Widget* GetSrcTarget() const { return m_pSrcTarget.Get(); }
GetDstTarget()37   CFWL_Widget* GetDstTarget() const { return m_pDstTarget.Get(); }
38 
39  private:
40   const Type m_type;
41   ObservedPtr<CFWL_Widget> const m_pSrcTarget;
42   ObservedPtr<CFWL_Widget> const m_pDstTarget;
43 };
44 
45 #endif  // XFA_FWL_CFWL_EVENT_H_
46