15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef ASH_WM_PROPERTY_UTIL_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define ASH_WM_PROPERTY_UTIL_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ash/ash_export.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace aura {
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class RootWindow;
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Window;
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace gfx {
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Rect;
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ash {
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace internal {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class RootWindowController;
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the restore bounds property on |window| in the virtual screen
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinates.  Deletes existing bounds value if exists.
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void SetRestoreBoundsInScreen(aura::Window* window,
27bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch                                         const gfx::Rect& screen_bounds);
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Same as |SetRestoreBoundsInScreen| except that the bounds is in the
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// parent's coordinates.
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void SetRestoreBoundsInParent(aura::Window* window,
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                         const gfx::Rect& parent_bounds);
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the restore bounds property on |window| in the virtual screen
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinates. The bounds can be NULL if the bounds property does not
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// exist for |window|. |window| owns the bounds object.
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT const gfx::Rect* GetRestoreBoundsInScreen(aura::Window* window);
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Same as |GetRestoreBoundsInScreen| except that it returns the
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// bounds in the parent's coordinates.
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT gfx::Rect GetRestoreBoundsInParent(aura::Window* window);
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Deletes and clears the restore bounds property on |window|.
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void ClearRestoreBounds(aura::Window* window);
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets whether |window| is ignored when determining whether the shelf should
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// be darkened when overlapped.
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void SetIgnoredByShelf(aura::Window* window, bool value);
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT bool GetIgnoredByShelf(const aura::Window* window);
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Sets whether |window| should always be restored to the restore bounds
502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// (sometimes the workspace layout manager restores the window to its original
512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// bounds instead of the restore bounds. Setting this key overrides that
522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// behaviour). The flag is reset to the default value after the window is
532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// restored.
542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)ASH_EXPORT void SetWindowAlwaysRestoresToRestoreBounds(aura::Window* window,
552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                                       bool value);
562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)ASH_EXPORT bool GetWindowAlwaysRestoresToRestoreBounds(
572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const aura::Window* window);
582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets whether the specified window is tracked by workspace code. Default is
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// true. If set to false the workspace does not switch the current workspace,
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// nor does it attempt to impose constraints on the bounds of the window. This
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is intended for tab dragging.
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void SetTrackedByWorkspace(aura::Window* window, bool value);
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT bool GetTrackedByWorkspace(const aura::Window* window);
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the default value for whether windows persist across all workspaces.
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The default is false.
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void SetDefaultPersistsAcrossAllWorkspaces(bool value);
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets/Gets the RootWindowController for |root_window|.
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void SetRootWindowController(
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    aura::RootWindow* root_window,
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    internal::RootWindowController* controller);
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT internal::RootWindowController* GetRootWindowController(
752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const aura::RootWindow* root_window);
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // ASH_WM_PROPERTY_UTIL_H_
80