- add sources.
[platform/framework/web/crosswalk.git] / src / ui / aura / client / capture_client.h
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 Window;
12
13 namespace client {
14
15 // An interface implemented by an object that manages input capture.
16 class AURA_EXPORT CaptureClient {
17  public:
18   // Does a capture on the |window|.
19   virtual void SetCapture(Window* window) = 0;
20
21   // Releases a capture from the |window|.
22   virtual void ReleaseCapture(Window* window) = 0;
23
24   // Returns the current capture window.
25   virtual Window* GetCaptureWindow() = 0;
26
27  protected:
28   virtual ~CaptureClient() {}
29 };
30
31 // Sets/Gets the capture client on the root Window.
32 AURA_EXPORT void SetCaptureClient(Window* root_window,
33                                   CaptureClient* client);
34 AURA_EXPORT CaptureClient* GetCaptureClient(Window* root_window);
35
36 // A utility function to get the current capture window. Returns NULL
37 // if the window doesn't have a root window, or there is no capture window.
38 AURA_EXPORT Window* GetCaptureWindow(Window* window);
39
40 }  // namespace clients
41 }  // namespace aura
42
43 #endif  // UI_AURA_CLIENT_CAPTURE_CLIENT_H_