Home | History | Annotate | Download | only in wm
      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 ASH_WM_PROPERTY_UTIL_H_
      6 #define ASH_WM_PROPERTY_UTIL_H_
      7 
      8 #include "ash/ash_export.h"
      9 
     10 namespace aura {
     11 class RootWindow;
     12 class Window;
     13 }
     14 
     15 namespace gfx {
     16 class Rect;
     17 }
     18 
     19 namespace ash {
     20 namespace internal {
     21 class RootWindowController;
     22 }
     23 
     24 // Sets the restore bounds property on |window| in the virtual screen
     25 // coordinates.  Deletes existing bounds value if exists.
     26 ASH_EXPORT void SetRestoreBoundsInScreen(aura::Window* window,
     27                                          const gfx::Rect& screen_bounds);
     28 // Same as |SetRestoreBoundsInScreen| except that the bounds is in the
     29 // parent's coordinates.
     30 ASH_EXPORT void SetRestoreBoundsInParent(aura::Window* window,
     31                                          const gfx::Rect& parent_bounds);
     32 
     33 // Returns the restore bounds property on |window| in the virtual screen
     34 // coordinates. The bounds can be NULL if the bounds property does not
     35 // exist for |window|. |window| owns the bounds object.
     36 ASH_EXPORT const gfx::Rect* GetRestoreBoundsInScreen(aura::Window* window);
     37 // Same as |GetRestoreBoundsInScreen| except that it returns the
     38 // bounds in the parent's coordinates.
     39 ASH_EXPORT gfx::Rect GetRestoreBoundsInParent(aura::Window* window);
     40 
     41 // Deletes and clears the restore bounds property on |window|.
     42 ASH_EXPORT void ClearRestoreBounds(aura::Window* window);
     43 
     44 // Sets whether |window| is ignored when determining whether the shelf should
     45 // be darkened when overlapped.
     46 ASH_EXPORT void SetIgnoredByShelf(aura::Window* window, bool value);
     47 ASH_EXPORT bool GetIgnoredByShelf(const aura::Window* window);
     48 
     49 // Sets whether |window| should always be restored to the restore bounds
     50 // (sometimes the workspace layout manager restores the window to its original
     51 // bounds instead of the restore bounds. Setting this key overrides that
     52 // behaviour). The flag is reset to the default value after the window is
     53 // restored.
     54 ASH_EXPORT void SetWindowAlwaysRestoresToRestoreBounds(aura::Window* window,
     55                                                        bool value);
     56 ASH_EXPORT bool GetWindowAlwaysRestoresToRestoreBounds(
     57     const aura::Window* window);
     58 
     59 // Sets whether the specified window is tracked by workspace code. Default is
     60 // true. If set to false the workspace does not switch the current workspace,
     61 // nor does it attempt to impose constraints on the bounds of the window. This
     62 // is intended for tab dragging.
     63 ASH_EXPORT void SetTrackedByWorkspace(aura::Window* window, bool value);
     64 ASH_EXPORT bool GetTrackedByWorkspace(const aura::Window* window);
     65 
     66 // Sets the default value for whether windows persist across all workspaces.
     67 // The default is false.
     68 ASH_EXPORT void SetDefaultPersistsAcrossAllWorkspaces(bool value);
     69 
     70 // Sets/Gets the RootWindowController for |root_window|.
     71 ASH_EXPORT void SetRootWindowController(
     72     aura::RootWindow* root_window,
     73     internal::RootWindowController* controller);
     74 ASH_EXPORT internal::RootWindowController* GetRootWindowController(
     75     const aura::RootWindow* root_window);
     76 
     77 }
     78 
     79 #endif  // ASH_WM_PROPERTY_UTIL_H_
     80