OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_PUBLIC_CPP_SHELF_TYPES_H_ | 5 #ifndef ASH_PUBLIC_CPP_SHELF_TYPES_H_ |
6 #define ASH_PUBLIC_CPP_SHELF_TYPES_H_ | 6 #define ASH_PUBLIC_CPP_SHELF_TYPES_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <string> |
9 | 10 |
10 #include "ash/public/cpp/app_launch_id.h" | |
11 #include "ash/public/cpp/ash_public_export.h" | 11 #include "ash/public/cpp/ash_public_export.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 enum ShelfAlignment { | 15 enum ShelfAlignment { |
16 SHELF_ALIGNMENT_BOTTOM, | 16 SHELF_ALIGNMENT_BOTTOM, |
17 SHELF_ALIGNMENT_LEFT, | 17 SHELF_ALIGNMENT_LEFT, |
18 SHELF_ALIGNMENT_RIGHT, | 18 SHELF_ALIGNMENT_RIGHT, |
19 // Top has never been supported. | 19 // Top has never been supported. |
20 | 20 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // An existing inactive window was activated. | 83 // An existing inactive window was activated. |
84 SHELF_ACTION_WINDOW_ACTIVATED, | 84 SHELF_ACTION_WINDOW_ACTIVATED, |
85 | 85 |
86 // The currently active window was minimized. | 86 // The currently active window was minimized. |
87 SHELF_ACTION_WINDOW_MINIMIZED, | 87 SHELF_ACTION_WINDOW_MINIMIZED, |
88 | 88 |
89 // The app list launcher menu was shown. | 89 // The app list launcher menu was shown. |
90 SHELF_ACTION_APP_LIST_SHOWN, | 90 SHELF_ACTION_APP_LIST_SHOWN, |
91 }; | 91 }; |
92 | 92 |
93 // TODO(msw): Rename AppLaunchId to ShelfID. | |
94 using ShelfID = AppLaunchId; | |
95 | |
96 // The type of a shelf item. | 93 // The type of a shelf item. |
97 enum ShelfItemType { | 94 enum ShelfItemType { |
98 // Represents a running app panel. | 95 // Represents a running app panel. |
99 TYPE_APP_PANEL, | 96 TYPE_APP_PANEL, |
100 | 97 |
101 // Represents a pinned shortcut to an app, the app may be running or not. | 98 // Represents a pinned shortcut to an app, the app may be running or not. |
102 TYPE_PINNED_APP, | 99 TYPE_PINNED_APP, |
103 | 100 |
104 // Toggles visiblity of the app list. | 101 // Toggles visiblity of the app list. |
105 TYPE_APP_LIST, | 102 TYPE_APP_LIST, |
(...skipping 22 matching lines...) Expand all Loading... |
128 // A closed shelf item, i.e. has no live instance. | 125 // A closed shelf item, i.e. has no live instance. |
129 STATUS_CLOSED, | 126 STATUS_CLOSED, |
130 // A shelf item that has live instance. | 127 // A shelf item that has live instance. |
131 STATUS_RUNNING, | 128 STATUS_RUNNING, |
132 // An active shelf item that has focus. | 129 // An active shelf item that has focus. |
133 STATUS_ACTIVE, | 130 STATUS_ACTIVE, |
134 // A shelf item that needs user's attention. | 131 // A shelf item that needs user's attention. |
135 STATUS_ATTENTION, | 132 STATUS_ATTENTION, |
136 }; | 133 }; |
137 | 134 |
| 135 // A unique shelf item id composed of an |app_id| and a |launch_id|. |
| 136 // |app_id| is the non-empty application id associated with a set of windows. |
| 137 // |launch_id| is passed on app launch, to support multiple shelf items per app. |
| 138 // As an example, a remote desktop client may want each remote application to |
| 139 // have its own icon. |
| 140 struct ASH_PUBLIC_EXPORT ShelfID { |
| 141 ShelfID(const std::string& app_id = std::string(), |
| 142 const std::string& launch_id = std::string()); |
| 143 ~ShelfID(); |
| 144 |
| 145 ShelfID(const ShelfID& other); |
| 146 ShelfID(ShelfID&& other); |
| 147 ShelfID& operator=(const ShelfID& other); |
| 148 bool operator==(const ShelfID& other) const; |
| 149 bool operator!=(const ShelfID& other) const; |
| 150 bool operator<(const ShelfID& other) const; |
| 151 |
| 152 // Returns true if both the application id and launch id are empty. |
| 153 // This is often used to determine if the id is invalid. |
| 154 bool IsNull() const; |
| 155 |
| 156 // The application id associated with a set of windows. |
| 157 std::string app_id; |
| 158 // An id passed on app launch, to support multiple shelf items per app. |
| 159 std::string launch_id; |
| 160 }; |
| 161 |
138 } // namespace ash | 162 } // namespace ash |
139 | 163 |
140 #endif // ASH_PUBLIC_CPP_SHELF_TYPES_H_ | 164 #endif // ASH_PUBLIC_CPP_SHELF_TYPES_H_ |
OLD | NEW |