Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/cpp/iedriver/ActionSimulators/SendMessageActionSimulator.h
2868 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
17
#ifndef WEBDRIVER_IE_SENDMESSAGEACTIONSIMULATOR_H_
18
#define WEBDRIVER_IE_SENDMESSAGEACTIONSIMULATOR_H_
19
20
// definitions for mouse buttons
21
// NOTE: These values correspond to GDK mouse button values.
22
// If these values are changed, native events for linux *will* be broken
23
// *unless* interactions_linux_mouse.cpp is updated.
24
#define MOUSEBUTTON_LEFT (1)
25
#define MOUSEBUTTON_MIDDLE (2)
26
#define MOUSEBUTTON_RIGHT (3)
27
28
#define WD_CLIENT_LEFT_MOUSE_BUTTON 0
29
#define WD_CLIENT_MIDDLE_MOUSE_BUTTON 1
30
#define WD_CLIENT_RIGHT_MOUSE_BUTTON 2
31
32
#include "ActionSimulator.h"
33
34
namespace webdriver {
35
36
class EventFiringData;
37
38
class SendMessageActionSimulator : public ActionSimulator {
39
public:
40
SendMessageActionSimulator(void);
41
virtual ~SendMessageActionSimulator(void);
42
43
int SimulateActions(BrowserHandle browser_wrapper,
44
std::vector<INPUT> inputs,
45
InputState* input_state);
46
47
private:
48
void SendKeyDownMessage(HWND window_handle,
49
InputState input_state,
50
int key_code,
51
int scan_code,
52
bool extended,
53
bool unicode,
54
HKL layout,
55
std::vector<BYTE>* keyboard_state);
56
void SendKeyUpMessage(HWND window_handle,
57
InputState input_state,
58
int key_code,
59
int scan_code,
60
bool extended,
61
bool unicode,
62
HKL layout,
63
std::vector<BYTE>* keyboard_state);
64
65
void SendMouseMoveMessage(HWND window_handle,
66
InputState input_state,
67
int x,
68
int y);
69
void SendMouseUpMessage(HWND window_handle,
70
InputState input_state,
71
int button,
72
int x,
73
int y);
74
void SendMouseDownMessage(HWND window_handle,
75
InputState input_state,
76
int button,
77
int x,
78
int y,
79
bool is_double_click);
80
81
bool IsInputDoubleClick(INPUT current_input, InputState input_state);
82
83
std::vector<BYTE> keyboard_state_buffer_;
84
};
85
86
} // namespace webdriver
87
88
#endif // WEBDRIVER_IE_SENDMESSAGEACTIONSIMULATOR_H_
89
90