| Index: ui/views/events/event.h
|
| ===================================================================
|
| --- ui/views/events/event.h (revision 151481)
|
| +++ ui/views/events/event.h (working copy)
|
| @@ -1,207 +0,0 @@
|
| -
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#ifndef UI_VIEWS_EVENTS_EVENT_H_
|
| -#define UI_VIEWS_EVENTS_EVENT_H_
|
| -
|
| -#include "base/basictypes.h"
|
| -#include "base/compiler_specific.h"
|
| -#include "base/logging.h"
|
| -#include "base/time.h"
|
| -#include "ui/base/event.h"
|
| -#include "ui/base/events.h"
|
| -#include "ui/base/gestures/gesture_types.h"
|
| -#include "ui/base/keycodes/keyboard_codes.h"
|
| -#include "ui/gfx/point.h"
|
| -#include "ui/views/views_export.h"
|
| -
|
| -namespace ui {
|
| -class Event;
|
| -class OSExchangeData;
|
| -}
|
| -
|
| -
|
| -namespace views {
|
| -
|
| -class View;
|
| -
|
| -namespace internal {
|
| -class RootView;
|
| -}
|
| -
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -//
|
| -// TouchEvent class
|
| -//
|
| -// A touch event is generated by touch screen and advanced track
|
| -// pad devices. There is a deliberate direct correspondence between
|
| -// TouchEvent and PlatformTouchPoint.
|
| -//
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -class VIEWS_EXPORT TouchEvent : public ui::LocatedEvent {
|
| - public:
|
| - explicit TouchEvent(const ui::NativeEvent& native_event);
|
| -
|
| - // Create a new touch event.
|
| - TouchEvent(ui::EventType type,
|
| - int x,
|
| - int y,
|
| - int flags,
|
| - int touch_id,
|
| - float radius_x,
|
| - float radius_y,
|
| - float angle,
|
| - float force);
|
| -
|
| - // Create a new TouchEvent which is identical to the provided model.
|
| - // If source / target views are provided, the model location will be converted
|
| - // from |source| coordinate system to |target| coordinate system.
|
| - TouchEvent(const TouchEvent& model, View* source, View* target);
|
| -
|
| - virtual ~TouchEvent();
|
| -
|
| - int identity() const { return touch_id_; }
|
| -
|
| - float radius_x() const { return radius_x_; }
|
| - float radius_y() const { return radius_y_; }
|
| - float rotation_angle() const { return rotation_angle_; }
|
| - float force() const { return force_; }
|
| -
|
| - private:
|
| - // The identity (typically finger) of the touch starting at 0 and incrementing
|
| - // for each separable additional touch that the hardware can detect.
|
| - const int touch_id_;
|
| -
|
| - // Radius of the X (major) axis of the touch ellipse. 1.0 if unknown.
|
| - const float radius_x_;
|
| -
|
| - // Radius of the Y (minor) axis of the touch ellipse. 1.0 if unknown.
|
| - const float radius_y_;
|
| -
|
| - // Angle of the major axis away from the X axis. Default 0.0.
|
| - const float rotation_angle_;
|
| -
|
| - // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
|
| - const float force_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(TouchEvent);
|
| -};
|
| -
|
| -class ScrollEvent;
|
| -
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -//
|
| -// MouseWheelEvent class
|
| -//
|
| -// A MouseWheelEvent is used to propagate mouse wheel user events.
|
| -// Note: e.GetOffset() > 0 means scroll up / left.
|
| -//
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -class VIEWS_EXPORT MouseWheelEvent : public ui::MouseEvent {
|
| - public:
|
| - // See |offset| for details.
|
| - static const int kWheelDelta;
|
| -
|
| - explicit MouseWheelEvent(const ui::NativeEvent& native_event);
|
| - explicit MouseWheelEvent(const ScrollEvent& scroll_event);
|
| -
|
| - // The amount to scroll. This is in multiples of kWheelDelta.
|
| - int offset() const { return offset_; }
|
| -
|
| - private:
|
| - int offset_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(MouseWheelEvent);
|
| -};
|
| -
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -//
|
| -// DropTargetEvent class
|
| -//
|
| -// A DropTargetEvent is sent to the view the mouse is over during a drag and
|
| -// drop operation.
|
| -//
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -class VIEWS_EXPORT DropTargetEvent : public ui::LocatedEvent {
|
| - public:
|
| - DropTargetEvent(const ui::OSExchangeData& data,
|
| - int x,
|
| - int y,
|
| - int source_operations)
|
| - : LocatedEvent(
|
| - ui::ET_DROP_TARGET_EVENT, gfx::Point(x, y), gfx::Point(x, y), 0),
|
| - data_(data),
|
| - source_operations_(source_operations) {
|
| - // TODO(msw): Hook up key state flags for CTRL + drag and drop, etc.
|
| - }
|
| -
|
| - const ui::OSExchangeData& data() const { return data_; }
|
| - int source_operations() const { return source_operations_; }
|
| -
|
| - private:
|
| - // Data associated with the drag/drop session.
|
| - const ui::OSExchangeData& data_;
|
| -
|
| - // Bitmask of supported ui::DragDropTypes::DragOperation by the source.
|
| - int source_operations_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(DropTargetEvent);
|
| -};
|
| -
|
| -class VIEWS_EXPORT ScrollEvent : public ui::MouseEvent {
|
| - public:
|
| - explicit ScrollEvent(const ui::NativeEvent& native_event);
|
| -
|
| - float x_offset() const { return x_offset_; }
|
| - float y_offset() const { return y_offset_; }
|
| -
|
| - private:
|
| - float x_offset_;
|
| - float y_offset_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(ScrollEvent);
|
| -};
|
| -
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -// GestureEvent class
|
| -//
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -class VIEWS_EXPORT GestureEvent : public ui::LocatedEvent {
|
| - public:
|
| - explicit GestureEvent(const ui::NativeEvent& native_event);
|
| -
|
| - // Create a new GestureEvent which is identical to the provided model.
|
| - // If source / target views are provided, the model location will be converted
|
| - // from |source| coordinate system to |target| coordinate system.
|
| - GestureEvent(const GestureEvent& model, View* source, View* target);
|
| -
|
| - virtual ~GestureEvent();
|
| -
|
| - const ui::GestureEventDetails& details() const { return details_; }
|
| -
|
| - protected:
|
| - GestureEvent(ui::EventType type, int x, int y, int flags);
|
| -
|
| - private:
|
| - ui::GestureEventDetails details_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(GestureEvent);
|
| -};
|
| -
|
| -class VIEWS_EXPORT GestureEventForTest : public GestureEvent {
|
| - public:
|
| - GestureEventForTest(ui::EventType type, int x, int y, int flags);
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(GestureEventForTest);
|
| -};
|
| -
|
| -#if defined(OS_WIN)
|
| -int GetModifiersFromKeyState();
|
| -#endif
|
| -
|
| -} // namespace views
|
| -
|
| -#endif // UI_VIEWS_EVENTS_EVENT_H_
|
|
|