Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / wm / wm_event.h
blob6fcc96463fef5b7c1e36cd1f91ea5b7cba7d41aa
1 // Copyright 2014 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_EVENT_H_
6 #define ASH_WM_WM_EVENT_H_
8 #include "ash/ash_export.h"
9 #include "ash/wm/wm_types.h"
10 #include "ui/gfx/rect.h"
12 namespace ash {
13 namespace wm {
15 // WMEventType defines a set of operations that can change the
16 // window's state type and bounds.
17 enum WMEventType {
18 // Following events are the request to become corresponding state.
19 // Note that this does not mean the window will be in corresponding
20 // state and the request may not be fullfilled.
22 // NORMAL is used as a restore operation with a few exceptions.
23 WM_EVENT_NORMAL,
24 WM_EVENT_MAXIMIZE,
25 WM_EVENT_MINIMIZE,
26 WM_EVENT_FULLSCREEN,
27 WM_EVENT_SNAP_LEFT,
28 WM_EVENT_SNAP_RIGHT,
30 // A window is requested to be the given bounds. The request may or
31 // may not be fulfilled depending on the requested bounds and window's
32 // state. This will not change the window state type.
33 WM_EVENT_SET_BOUNDS,
35 // Following events are compond events which may lead to different
36 // states depending on the current state.
38 // A user requested to toggle maximized state by double clicking window
39 // header.
40 WM_EVENT_TOGGLE_MAXIMIZE_CAPTION,
42 // A user requested to toggle maximized state using shortcut.
43 WM_EVENT_TOGGLE_MAXIMIZE,
45 // A user requested to toggle vertical maximize by double clicking
46 // top/bottom edge.
47 WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE,
49 // A user requested to toggle horizontal maximize by double clicking
50 // left/right edge.
51 WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE,
53 // A user requested to toggle fullscreen state.
54 WM_EVENT_TOGGLE_FULLSCREEN,
56 // A user requested to center a window.
57 WM_EVENT_CENTER,
59 // TODO(oshima): Investigate if this can be removed from ash.
60 // Widget requested to show in inactive state.
61 WM_EVENT_SHOW_INACTIVE,
63 // Following events are generated when the workspace envrionment has changed.
64 // The window's state type will not be changed by these events.
66 // The window is added to the workspace, either as a new window, due to
67 // display disconnection or dragging.
68 WM_EVENT_ADDED_TO_WORKSPACE,
70 // Bounds of the display has changed.
71 WM_EVENT_DISPLAY_BOUNDS_CHANGED,
73 // Bounds of the work area has changed. This will not occur when the work
74 // area has changed as a result of DISPLAY_BOUNDS_CHANGED.
75 WM_EVENT_WORKAREA_BOUNDS_CHANGED,
78 class ASH_EXPORT WMEvent {
79 public:
80 explicit WMEvent(WMEventType type);
81 virtual ~WMEvent();
83 WMEventType type() const { return type_; }
85 private:
86 WMEventType type_;
87 DISALLOW_COPY_AND_ASSIGN(WMEvent);
90 // An WMEvent to request new bounds for the window.
91 class SetBoundsEvent : public WMEvent {
92 public:
93 SetBoundsEvent(WMEventType type, const gfx::Rect& requested_bounds);
94 virtual ~SetBoundsEvent();
96 const gfx::Rect& requested_bounds() const { return requested_bounds_; }
98 private:
99 gfx::Rect requested_bounds_;
101 DISALLOW_COPY_AND_ASSIGN(SetBoundsEvent);
104 } // namespace wm
105 } // namespace ash
107 #endif // ASH_WM_WM_EVENT_H_