• 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_EVENTTARGET_H_
8 #define XFA_FWL_CFWL_EVENTTARGET_H_
9 
10 #include <set>
11 
12 #include "xfa/fwl/cfwl_event.h"
13 
14 class CFWL_Event;
15 class CFWL_Widget;
16 
17 class CFWL_EventTarget {
18  public:
19   explicit CFWL_EventTarget(CFWL_Widget* pListener);
20   ~CFWL_EventTarget();
21 
22   void SetEventSource(CFWL_Widget* pSource);
23   bool ProcessEvent(CFWL_Event* pEvent);
24 
IsValid()25   bool IsValid() const { return m_bValid; }
FlagInvalid()26   void FlagInvalid() { m_bValid = false; }
27 
28  private:
29   bool m_bValid = true;
30   CFWL_Widget* const m_pListener;
31   std::set<CFWL_Widget*> m_widgets;
32 };
33 
34 #endif  // XFA_FWL_CFWL_EVENTTARGET_H_
35