blob: 3a8d53d4cb8ae16ef33482faa6d5d73b08dcc8dd [file] [log] [blame]
kumarashishg826308d2023-06-23 13:21:22 +00001// Copyright 2016 The PDFium Authors
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -07002// 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_MESSAGE_H_
8#define XFA_FWL_CFWL_MESSAGE_H_
9
kumarashishg826308d2023-06-23 13:21:22 +000010#include "core/fxcrt/mask.h"
11#include "core/fxcrt/unowned_ptr.h"
12#include "v8/include/cppgc/macros.h"
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070013
kumarashishg826308d2023-06-23 13:21:22 +000014class CFWL_Widget;
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070015
16class CFWL_Message {
kumarashishg826308d2023-06-23 13:21:22 +000017 CPPGC_STACK_ALLOCATED(); // Allow Raw/Unowned pointers.
18
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070019 public:
kumarashishg826308d2023-06-23 13:21:22 +000020 enum class Type { kKey, kKillFocus, kMouse, kMouseWheel, kSetFocus };
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070021
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070022 virtual ~CFWL_Message();
23
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070024 Type GetType() const { return m_type; }
kumarashishg826308d2023-06-23 13:21:22 +000025 CFWL_Widget* GetDstTarget() const { return m_pDstTarget; }
26 void SetDstTarget(CFWL_Widget* pWidget) { m_pDstTarget = pWidget; }
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070027
Haibo Huang49cc9302020-04-27 16:14:24 -070028 protected:
kumarashishg826308d2023-06-23 13:21:22 +000029 CFWL_Message(Type type, CFWL_Widget* pDstTarget);
Haibo Huang49cc9302020-04-27 16:14:24 -070030 CFWL_Message(const CFWL_Message& that) = delete;
31 CFWL_Message& operator=(const CFWL_Message& that) = delete;
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070032
33 private:
Haibo Huang49cc9302020-04-27 16:14:24 -070034 const Type m_type;
kumarashishg826308d2023-06-23 13:21:22 +000035 UnownedPtr<CFWL_Widget> m_pDstTarget;
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070036};
37
38#endif // XFA_FWL_CFWL_MESSAGE_H_