1 // Copyright 2013 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.
5 #ifndef ASH_WM_WM_TYPES_H_
6 #define ASH_WM_WM_TYPES_H_
8 #include "ash/ash_export.h"
9 #include "ui/base/ui_base_types.h"
14 // This enum defines both common show state copied from
15 // ui::WindowShowState as well as new states intoruduced in ash.
16 // The separate enum is defined here because we don't want to leak
17 // these type to ui/base until they're stable and we know for sure
18 // that they'll persist over time.
21 SHOW_TYPE_DEFAULT = 0,
23 // Normal represents a state where the position/size has been
24 // specified by a use.
31 SHOW_TYPE_END, // to avoid using SHOW_STATE_END
33 // Ash specific states:
35 SHOW_TYPE_LEFT_SNAPPED,
36 SHOW_TYPE_RIGHT_SNAPPED,
38 // A window is in this state when it is automatically placed and
39 // sized by the window manager. (it's newly opened, or pushed to the side
40 // due to new window, for example).
41 SHOW_TYPE_AUTO_POSITIONED,
44 // Set of operations that can change the window's state.
46 // Following events are the request to become corresponding state.
47 // Note that this does not mean the window will be in corresponding
48 // state and the request may not be fullfilled.
50 // NORMAL is used as a restore operation with a few exceptions.
55 // TODO(oshima): Consolidate these two events.
59 // Following events are compond events which may lead to different
60 // states depending on the current state.
62 // A user requested to toggle maximized state by double clicking window
64 TOGGLE_MAXIMIZE_CAPTION,
66 // A user requested to toggle maximized state using shortcut.
69 // A user requested to toggle vertical maximize by double clicking
71 TOGGLE_VERTICAL_MAXIMIZE,
73 // A user requested to toggle horizontal maximize by double clicking
75 TOGGLE_HORIZONTAL_MAXIMIZE,
77 // A user requested to toggle fullscreen state.
80 // TODO(oshima): Investigate if this can be removed from ash.
81 // Widget requested to show in inactive state.
85 // Utility functions to convert WindowShowType <-> ui::WindowShowState.
86 // Note: LEFT/RIGHT MAXIMIZED, AUTO_POSITIONED type will be lost when
87 // converting to ui::WindowShowState.
88 ASH_EXPORT WindowShowType ToWindowShowType(ui::WindowShowState state);
89 ASH_EXPORT ui::WindowShowState ToWindowShowState(WindowShowType type);
91 // Returns true if |type| is SHOW_TYPE_MAXIMIZED or SHOW_TYPE_FULLSCREEN.
92 ASH_EXPORT bool IsMaximizedOrFullscreenWindowShowType(WindowShowType type);
97 #endif // ASH_WM_WM_TYPES_H_