15f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// found in the LICENSE file.
490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
56e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_DELEGATE_H_
66e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_DELEGATE_H_
790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include <X11/Xlib.h>
990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace views {
1190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Receives mouse events while the X11MoveLoop is tracking a drag.
136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)class X11MoveLoopDelegate {
1490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) public:
1590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // Called when we receive a motion event.
1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  virtual void OnMouseMovement(XMotionEvent* event) = 0;
1790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
18eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // Called when the mouse button is released.
19eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  virtual void OnMouseReleased() = 0;
20eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
2190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // Called when the user has released the mouse button. The move loop will
2290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // release the grab after this has been called.
2390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  virtual void OnMoveLoopEnded() = 0;
2490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)};
2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
2690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}  // namespace views
2790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_DELEGATE_H_
29