1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef UI_AURA_ROOT_WINDOW_HOST_DELEGATE_H_ 6#define UI_AURA_ROOT_WINDOW_HOST_DELEGATE_H_ 7 8#include "ui/aura/aura_export.h" 9 10namespace gfx { 11class Point; 12class Rect; 13class Size; 14} 15 16namespace ui { 17class Event; 18class EventProcessor; 19class KeyEvent; 20class MouseEvent; 21class ScrollEvent; 22class TouchEvent; 23} 24 25namespace aura { 26 27class RootWindow; 28 29// A private interface used by RootWindowHost implementations to communicate 30// with their owning RootWindow. 31class AURA_EXPORT RootWindowHostDelegate { 32 public: 33 virtual bool OnHostKeyEvent(ui::KeyEvent* event) = 0; 34 virtual bool OnHostMouseEvent(ui::MouseEvent* event) = 0; 35 virtual bool OnHostScrollEvent(ui::ScrollEvent* event) = 0; 36 virtual bool OnHostTouchEvent(ui::TouchEvent* event) = 0; 37 virtual void OnHostCancelMode() = 0; 38 39 // Called when the windowing system activates the window. 40 virtual void OnHostActivated() = 0; 41 42 // Called when system focus is changed to another window. 43 virtual void OnHostLostWindowCapture() = 0; 44 45 // Called when the windowing system has mouse grab because it's performing a 46 // window move on our behalf, but we should still paint as if we're active. 47 virtual void OnHostLostMouseGrab() = 0; 48 49 virtual void OnHostPaint(const gfx::Rect& damage_rect) = 0; 50 51 virtual void OnHostMoved(const gfx::Point& origin) = 0; 52 virtual void OnHostResized(const gfx::Size& size) = 0; 53 54 virtual float GetDeviceScaleFactor() = 0; 55 56 virtual RootWindow* AsRootWindow() = 0; 57 virtual const RootWindow* AsRootWindow() const = 0; 58 59 virtual ui::EventProcessor* GetEventProcessor() = 0; 60 61 protected: 62 virtual ~RootWindowHostDelegate() {} 63}; 64 65} // namespace aura 66 67#endif // UI_AURA_ROOT_WINDOW_HOST_DELEGATE_H_ 68