Path: blob/trunk/cpp/iedriver/ActionSimulators/SendMessageActionSimulator.h
2868 views
// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the "License");5// you may not use this file except in compliance with the License.6// You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing, software11// distributed under the License is distributed on an "AS IS" BASIS,12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13// See the License for the specific language governing permissions and14// limitations under the License.1516#ifndef WEBDRIVER_IE_SENDMESSAGEACTIONSIMULATOR_H_17#define WEBDRIVER_IE_SENDMESSAGEACTIONSIMULATOR_H_1819// definitions for mouse buttons20// NOTE: These values correspond to GDK mouse button values.21// If these values are changed, native events for linux *will* be broken22// *unless* interactions_linux_mouse.cpp is updated.23#define MOUSEBUTTON_LEFT (1)24#define MOUSEBUTTON_MIDDLE (2)25#define MOUSEBUTTON_RIGHT (3)2627#define WD_CLIENT_LEFT_MOUSE_BUTTON 028#define WD_CLIENT_MIDDLE_MOUSE_BUTTON 129#define WD_CLIENT_RIGHT_MOUSE_BUTTON 23031#include "ActionSimulator.h"3233namespace webdriver {3435class EventFiringData;3637class SendMessageActionSimulator : public ActionSimulator {38public:39SendMessageActionSimulator(void);40virtual ~SendMessageActionSimulator(void);4142int SimulateActions(BrowserHandle browser_wrapper,43std::vector<INPUT> inputs,44InputState* input_state);4546private:47void SendKeyDownMessage(HWND window_handle,48InputState input_state,49int key_code,50int scan_code,51bool extended,52bool unicode,53HKL layout,54std::vector<BYTE>* keyboard_state);55void SendKeyUpMessage(HWND window_handle,56InputState input_state,57int key_code,58int scan_code,59bool extended,60bool unicode,61HKL layout,62std::vector<BYTE>* keyboard_state);6364void SendMouseMoveMessage(HWND window_handle,65InputState input_state,66int x,67int y);68void SendMouseUpMessage(HWND window_handle,69InputState input_state,70int button,71int x,72int y);73void SendMouseDownMessage(HWND window_handle,74InputState input_state,75int button,76int x,77int y,78bool is_double_click);7980bool IsInputDoubleClick(INPUT current_input, InputState input_state);8182std::vector<BYTE> keyboard_state_buffer_;83};8485} // namespace webdriver8687#endif // WEBDRIVER_IE_SENDMESSAGEACTIONSIMULATOR_H_888990