Path: blob/trunk/cpp/webdriver-interactions/interactions.h
2867 views
/*1Licensed to the Software Freedom Conservancy (SFC) under one2or more contributor license agreements. See the NOTICE file3distributed with this work for additional information4regarding copyright ownership. The SFC licenses this file5to you under the Apache License, Version 2.0 (the "License");6you may not use this file except in compliance with the License.7You may obtain a copy of the License at89http://www.apache.org/licenses/LICENSE-2.01011Unless required by applicable law or agreed to in writing, software12distributed under the License is distributed on an "AS IS" BASIS,13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14See the License for the specific language governing permissions and15limitations under the License.16*/1718#ifndef interactions_h19#define interactions_h2021#ifdef _MSC_VER22#include "stdafx.h"23#include "interaction_utils.h"24#endif2526#include <wchar.h>2728#ifdef _MSC_VER29#define EXPORT __declspec(dllexport)30#define WD_RESULT LRESULT31#else32#define EXPORT33#define WD_RESULT int34#endif3536#define WINDOW_HANDLE void*3738// definitions for mouse buttons39// NOTE: These values correspond to GDK mouse button values.40// If these values are changed, native events for linux *will* be broken41// *unless* interactions_linux_mouse.cpp is updated.42#define MOUSEBUTTON_LEFT (1)43#define MOUSEBUTTON_MIDDLE (2)44#define MOUSEBUTTON_RIGHT (3)4546#define WD_CLIENT_LEFT_MOUSE_BUTTON 047#define WD_CLIENT_MIDDLE_MOUSE_BUTTON 148#define WD_CLIENT_RIGHT_MOUSE_BUTTON 24950#ifdef __cplusplus51extern "C" {52#endif5354// Keyboard interactions55EXPORT void sendKeys(WINDOW_HANDLE windowHandle, const wchar_t* value, int timePerKey);56EXPORT void releaseModifierKeys(WINDOW_HANDLE windowHandle, int timePerKey);57EXPORT bool pending_input_events();58EXPORT void stopPersistentEventFiring();59EXPORT void setEnablePersistentHover(bool enablePersistentHover);6061// Mouse interactions62EXPORT WD_RESULT clickAt(WINDOW_HANDLE directInputTo, long x, long y, long button);63EXPORT WD_RESULT doubleClickAt(WINDOW_HANDLE directInputTo, long x, long y);64EXPORT WD_RESULT mouseDownAt(WINDOW_HANDLE directInputTo, long x, long y, long button);65EXPORT WD_RESULT mouseUpAt(WINDOW_HANDLE directInputTo, long x, long y, long button);66EXPORT WD_RESULT mouseMoveTo(WINDOW_HANDLE directInputTo, long duration, long fromX, long fromY, long toX, long toY);6768#ifdef __cplusplus69}70#endif71#endif727374