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"
15 // WMEventType defines a set of operations that can change the
16 // window's state type and bounds.
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.
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.
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
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
47 WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE
,
49 // A user requested to toggle horizontal maximize by double clicking
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.
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
{
80 explicit WMEvent(WMEventType type
);
83 WMEventType
type() const { return type_
; }
87 DISALLOW_COPY_AND_ASSIGN(WMEvent
);
90 // An WMEvent to request new bounds for the window.
91 class SetBoundsEvent
: public WMEvent
{
93 SetBoundsEvent(WMEventType type
, const gfx::Rect
& requested_bounds
);
94 virtual ~SetBoundsEvent();
96 const gfx::Rect
& requested_bounds() const { return requested_bounds_
; }
99 gfx::Rect requested_bounds_
;
101 DISALLOW_COPY_AND_ASSIGN(SetBoundsEvent
);
107 #endif // ASH_WM_WM_EVENT_H_