• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_WINDOW_SCENE_SESSION_WINDOW_EVENT_CHANNEL_INTERFACE_H
17 #define OHOS_WINDOW_SCENE_SESSION_WINDOW_EVENT_CHANNEL_INTERFACE_H
18 
19 #include <iremote_broker.h>
20 
21 #include "interfaces/include/ws_common.h"
22 
23 namespace OHOS::MMI {
24     class PointerEvent;
25     class KeyEvent;
26     class AxisEvent;
27 } // namespace OHOS::MMI
28 
29 namespace OHOS::Rosen {
30 class IWindowEventChannel : public IRemoteBroker {
31 public:
32     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IWindowEventChannel");
33 
34     enum class WindowEventChannelMessage : uint32_t {
35         TRANS_ID_TRANSFER_KEY_EVENT,
36         TRANS_ID_TRANSFER_POINTER_EVENT,
37         TRANS_ID_TRANSFER_FOCUS_ACTIVE_EVENT,
38         TRANS_ID_TRANSFER_FOCUS_WINDOW_ID_EVENT,
39         TRANS_ID_TRANSFER_FOCUS_STATE_EVENT,
40     };
41 
42     virtual WSError TransferKeyEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent) = 0;
43     virtual WSError TransferPointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) = 0;
44 
45     // transfer sync key event for weather consumed
46     virtual WSError TransferKeyEventForConsumed(const std::shared_ptr<MMI::KeyEvent>& keyEvent, bool& isConsumed) = 0;
47     virtual WSError TransferFocusActiveEvent(bool isFocusActive) = 0;
48     virtual WSError TransferFocusState(bool focusState) = 0;
49 };
50 } // namespace OHOS::Rosen
51 #endif // OHOS_WINDOW_SCENE_SESSION_WINDOW_EVENT_CHANNEL_INTERFACE_H
52