Home | History | Annotate | Download | only in client
      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_CLIENT_CAPTURE_CLIENT_H_
      6 #define UI_AURA_CLIENT_CAPTURE_CLIENT_H_
      7 
      8 #include "ui/aura/aura_export.h"
      9 
     10 namespace aura {
     11 class RootWindow;
     12 class Window;
     13 
     14 namespace client {
     15 
     16 // An interface implemented by an object that manages input capture.
     17 class AURA_EXPORT CaptureClient {
     18  public:
     19   // Does a capture on the |window|.
     20   virtual void SetCapture(Window* window) = 0;
     21 
     22   // Releases a capture from the |window|.
     23   virtual void ReleaseCapture(Window* window) = 0;
     24 
     25   // Returns the current capture window.
     26   virtual Window* GetCaptureWindow() = 0;
     27 
     28  protected:
     29   virtual ~CaptureClient() {}
     30 };
     31 
     32 // Sets/Gets the capture client on the RootWindow.
     33 AURA_EXPORT void SetCaptureClient(RootWindow* root_window,
     34                                   CaptureClient* client);
     35 AURA_EXPORT CaptureClient* GetCaptureClient(RootWindow* root_window);
     36 
     37 // A utility function to get the current capture window. Returns NULL
     38 // if the window doesn't have a root window, or there is no capture window.
     39 AURA_EXPORT Window* GetCaptureWindow(Window* window);
     40 
     41 }  // namespace clients
     42 }  // namespace aura
     43 
     44 #endif  // UI_AURA_CLIENT_CAPTURE_CLIENT_H_
     45