aura_constants.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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
  3. // found in the LICENSE file.
  4. #ifndef UI_AURA_CLIENT_AURA_CONSTANTS_H_
  5. #define UI_AURA_CLIENT_AURA_CONSTANTS_H_
  6. #include <string>
  7. #include <vector>
  8. #include "third_party/skia/include/core/SkColor.h"
  9. #include "ui/aura/aura_export.h"
  10. #include "ui/aura/window.h"
  11. #include "ui/base/ui_base_types.h"
  12. namespace gfx {
  13. class ImageSkia;
  14. }
  15. namespace ws {
  16. namespace mojom {
  17. enum class WindowType;
  18. }
  19. } // namespace ws
  20. namespace aura {
  21. namespace client {
  22. class FocusClient;
  23. // Values used with property key kResizeBehaviorKey.
  24. constexpr int kResizeBehaviorNone = 0;
  25. constexpr int kResizeBehaviorCanResize = 1 << 0;
  26. constexpr int kResizeBehaviorCanMaximize = 1 << 1;
  27. constexpr int kResizeBehaviorCanMinimize = 1 << 2;
  28. // A value used to represent an unassigned workspace for `kWindowWorkspaceKey`.
  29. constexpr int kWindowWorkspaceUnassignedWorkspace = -1;
  30. // A value used to represent a window being assigned to all workspaces for
  31. // `kWindowWorkspaceKey`.
  32. constexpr int kWindowWorkspaceVisibleOnAllWorkspaces = -2;
  33. // Alphabetical sort.
  34. // A property key to store whether accessibility touch exploration gets handled
  35. // by the window and all touches pass through directly.
  36. AURA_EXPORT extern const WindowProperty<bool>* const
  37. kAccessibilityTouchExplorationPassThrough;
  38. // A property key to store whether activation on pointer event is enabled or
  39. // not. The default value is true, which means windows are activated when a
  40. // pointer down event occurs on them.
  41. AURA_EXPORT extern const WindowProperty<bool>* const kActivateOnPointerKey;
  42. // A property key to store whether animations are disabled for the window. Type
  43. // of value is an int.
  44. AURA_EXPORT extern const WindowProperty<bool>* const kAnimationsDisabledKey;
  45. // A property key to store the app icon, typically larger for shelf icons, etc.
  46. // This is not transported to the window service.
  47. AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const kAppIconKey;
  48. // A property key to store the type of window that will be used to record
  49. // pointer metrics. See AppType in ash/public/cpp/app_types.h for more details.
  50. AURA_EXPORT extern const WindowProperty<int>* const kAppType;
  51. // A property key to store the aspect ratio of the window.
  52. AURA_EXPORT extern const WindowProperty<gfx::SizeF*>* const kAspectRatio;
  53. // A property key to store the avatar icon that will be displayed on the window
  54. // frame to indicate the owner of the window when needed.
  55. AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const kAvatarIconKey;
  56. // A property key to indicate if a client window's layer is drawn.
  57. // It is passed to the Window Service side for the occlusion tracker to process
  58. // since the info is only available at the client side.
  59. AURA_EXPORT extern const WindowProperty<bool>* const kWindowLayerDrawn;
  60. // A property key to store if a window is a constrained window or not.
  61. AURA_EXPORT extern const WindowProperty<bool>* const kConstrainedWindowKey;
  62. // A property key to store if a window was created by a user gesture.
  63. AURA_EXPORT extern const WindowProperty<bool>* const kCreatedByUserGesture;
  64. // A property key to indicate that a window should show that it deserves
  65. // attention.
  66. AURA_EXPORT extern const WindowProperty<bool>* const kDrawAttentionKey;
  67. // A property key to store the focus client on the window.
  68. AURA_EXPORT extern const WindowProperty<FocusClient*>* const kFocusClientKey;
  69. // A property key to store the host window of a window. This lets
  70. // WebContentsViews find the windows that should constrain NPAPI plugins.
  71. AURA_EXPORT extern const WindowProperty<Window*>* const kHostWindowKey;
  72. // A property key to store menu type of the window. Valid only for the menu
  73. // windows.
  74. AURA_EXPORT extern const WindowProperty<ui::MenuType>* const kMenuType;
  75. // The modal parent of a child modal window.
  76. AURA_EXPORT extern const WindowProperty<Window*>* const kChildModalParentKey;
  77. // A property key to store the window modality.
  78. AURA_EXPORT extern const WindowProperty<ui::ModalType>* const kModalKey;
  79. // A property key to store the name of the window; mostly used for debugging.
  80. AURA_EXPORT extern const WindowProperty<std::string*>* const kNameKey;
  81. // A property key to store anchor to attach an owned anchored window to (such
  82. // as tooltips, menus, etc).
  83. AURA_EXPORT extern const WindowProperty<struct ui::OwnedWindowAnchor*>* const
  84. kOwnedWindowAnchor;
  85. // A property key to store if a window drop shadow and resize shadow of a
  86. // window are exactly the same as the window bounds, i.e. if resizing a window
  87. // immediately resizes its shadows. Generally, resizing and content rendering
  88. // happen in server side without any client involved, so without any delay in
  89. // communication this value should be true: shadow bounds are the same as
  90. // window bounds which define content bounds. For LaCros and other windows with
  91. // server-controlled shadow but client-controlled content, this value should be
  92. // false to ensure that the shadow is not immediately resized along with window
  93. // in server side. Instead, the shadow waits for client content to catch up with
  94. // the new window bounds first to avoid a gap between shadow and content
  95. // (crbug.com/1199497).
  96. // TODO(crbug/1247880): all exo clients that use server side resize shadow
  97. // should have this property set to true.
  98. AURA_EXPORT extern const WindowProperty<bool>* const kUseWindowBoundsForShadow;
  99. // A property key to store the accessible parent of a native view. This is
  100. // used to allow WebContents to access their accessible parents for use in
  101. // walking up the accessibility tree via platform APIs.
  102. AURA_EXPORT extern const aura::WindowProperty<gfx::NativeViewAccessible>* const
  103. kParentNativeViewAccessibleKey;
  104. // A property key to store the preferred size of the window.
  105. AURA_EXPORT extern const WindowProperty<gfx::Size*>* const kPreferredSize;
  106. // A property key to store the resize behavior, which is a bitmask of the
  107. // ResizeBehavior values.
  108. AURA_EXPORT extern const WindowProperty<int>* const kResizeBehaviorKey;
  109. // A property key to store the restore bounds in screen coordinates for a
  110. // window.
  111. AURA_EXPORT extern const WindowProperty<gfx::Rect*>* const kRestoreBoundsKey;
  112. // A property key to store ui::WindowShowState for a window.
  113. // See ui/base/ui_base_types.h for its definition.
  114. AURA_EXPORT extern const WindowProperty<ui::WindowShowState>* const
  115. kShowStateKey;
  116. // A property key to store ui::WindowShowState for a window to restore back to
  117. // from the current window show state.
  118. AURA_EXPORT extern const WindowProperty<ui::WindowShowState>* const
  119. kRestoreShowStateKey;
  120. // A property key to indicate if a window is currently being restored. Normally
  121. // restoring a window equals to changing window's state to normal window state.
  122. // This property will be used on Chrome OS to decide if we should use window
  123. // state restore stack to decide which window state the window should restore
  124. // back to, and it's not always the normal window state. As an example,
  125. // unminimizing a window will restore the window back to its pre-minimized
  126. // window state, which can have a non-normal window state. Note this property
  127. // does not have any effort on any other operation systems except Chrome OS.
  128. AURA_EXPORT extern const WindowProperty<bool>* const kIsRestoringKey;
  129. // A property key to store key event dispatch policy. The default value is
  130. // false, which means IME receives a key event in PREDISPATCH phace before a
  131. // window receives it. If it's true, a window receives a key event before IME.
  132. AURA_EXPORT extern const WindowProperty<bool>* const kSkipImeProcessing;
  133. // A property key to store the title of the window; sometimes shown to users.
  134. AURA_EXPORT extern const WindowProperty<std::u16string*>* const kTitleKey;
  135. // The inset of the topmost view in the client view from the top of the
  136. // non-client view. The topmost view depends on the window type. The topmost
  137. // view is the tab strip for tabbed browser windows, the toolbar for popups,
  138. // the web contents for app windows and varies for fullscreen windows.
  139. AURA_EXPORT extern const WindowProperty<int>* const kTopViewInset;
  140. // A property key to store the window icon, typically 16x16 for title bars.
  141. AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const kWindowIconKey;
  142. // The corner radius of a window in DIPs. Currently only used for shadows.
  143. // Default is -1, meaning "unspecified". 0 Ensures corners are square.
  144. AURA_EXPORT extern const WindowProperty<int>* const kWindowCornerRadiusKey;
  145. // A property key to indicate a desk index of a workspace this window belongs
  146. // to. The default value is kWindowWorkspaceUnassignedWorkspace.
  147. AURA_EXPORT extern const WindowProperty<int>* const kWindowWorkspaceKey;
  148. // A property key to store the z-ordering.
  149. AURA_EXPORT extern const WindowProperty<ui::ZOrderLevel>* const kZOrderingKey;
  150. // Alphabetical sort.
  151. } // namespace client
  152. } // namespace aura
  153. #endif // UI_AURA_CLIENT_AURA_CONSTANTS_H_