Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ash / wm / wm_types.h
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.
4
5 #ifndef ASH_WM_WM_TYPES_H_
6 #define ASH_WM_WM_TYPES_H_
7
8 #include "ash/ash_export.h"
9 #include "ui/base/ui_base_types.h"
10
11 namespace ash {
12 namespace wm {
13
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.
19 enum WindowShowType {
20   // Common state
21   SHOW_TYPE_DEFAULT = 0,
22
23   // Normal represents a state where the position/size has been
24   // specified by a use.
25   SHOW_TYPE_NORMAL,
26   SHOW_TYPE_MINIMIZED,
27   SHOW_TYPE_MAXIMIZED,
28   SHOW_TYPE_INACTIVE,
29   SHOW_TYPE_FULLSCREEN,
30   SHOW_TYPE_DETACHED,
31   SHOW_TYPE_END,  // to avoid using SHOW_STATE_END
32
33   // Ash specific states:
34
35   SHOW_TYPE_LEFT_SNAPPED,
36   SHOW_TYPE_RIGHT_SNAPPED,
37
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,
42 };
43
44 // Set of operations that can change the window's state.
45 enum WMEvent {
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.
49
50   // NORMAL is used as a restore operation with a few exceptions.
51   NORMAL,
52   MAXIMIZE,
53   MINIMIZE,
54   FULLSCREEN,
55   // TODO(oshima): Consolidate these two events.
56   SNAP_LEFT,
57   SNAP_RIGHT,
58
59   // Following events are compond events which may lead to different
60   // states depending on the current state.
61
62   // A user requested to toggle maximized state by double clicking window
63   // header.
64   TOGGLE_MAXIMIZE_CAPTION,
65
66   // A user requested to toggle maximized state using shortcut.
67   TOGGLE_MAXIMIZE,
68
69   // A user requested to toggle vertical maximize by double clicking
70   // top/bottom edge.
71   TOGGLE_VERTICAL_MAXIMIZE,
72
73   // A user requested to toggle horizontal maximize by double clicking
74   // left/right edge.
75   TOGGLE_HORIZONTAL_MAXIMIZE,
76
77   // A user requested to toggle fullscreen state.
78   TOGGLE_FULLSCREEN,
79
80   // TODO(oshima): Investigate if this can be removed from ash.
81   // Widget requested to show in inactive state.
82   SHOW_INACTIVE,
83 };
84
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);
90
91 // Returns true if |type| is SHOW_TYPE_MAXIMIZED or SHOW_TYPE_FULLSCREEN.
92 ASH_EXPORT bool IsMaximizedOrFullscreenWindowShowType(WindowShowType type);
93
94 }  // namespace wm
95 }  // namespace ash
96
97 #endif  // ASH_WM_WM_TYPES_H_