palette_ids.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2016 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 ASH_SYSTEM_PALETTE_PALETTE_IDS_H_
  5. #define ASH_SYSTEM_PALETTE_PALETTE_IDS_H_
  6. namespace ash {
  7. // Palette tools are grouped into different categories. Each tool corresponds to
  8. // exactly one group, and at most one tool can be active per group. Actions are
  9. // actions the user wants to do, such as take a screenshot, and modes generally
  10. // change OS behavior, like showing a laser pointer instead of a cursor. A mode
  11. // is active until the user completes the action or disables it.
  12. enum class PaletteGroup { ACTION, MODE };
  13. enum class PaletteToolId {
  14. NONE,
  15. CREATE_NOTE,
  16. LASER_POINTER,
  17. MAGNIFY,
  18. METALAYER,
  19. ENTER_CAPTURE_MODE,
  20. };
  21. // Usage of each pen palette option. This enum is used to back an UMA histogram
  22. // and should be treated as append-only.
  23. enum PaletteTrayOptions {
  24. PALETTE_CLOSED_NO_ACTION = 0,
  25. PALETTE_SETTINGS_BUTTON,
  26. PALETTE_HELP_BUTTON,
  27. PALETTE_CAPTURE_REGION,
  28. PALETTE_CAPTURE_SCREEN,
  29. PALETTE_NEW_NOTE,
  30. PALETTE_MAGNIFY,
  31. PALETTE_LASER_POINTER,
  32. PALETTE_METALAYER,
  33. PALETTE_ENTER_CAPTURE_MODE,
  34. PALETTE_OPTIONS_COUNT
  35. };
  36. // Type of palette mode cancellation. This enum is used to back an UMA histogram
  37. // and should be treated as append-only.
  38. enum PaletteModeCancelType {
  39. PALETTE_MODE_LASER_POINTER_CANCELLED = 0,
  40. PALETTE_MODE_LASER_POINTER_SWITCHED,
  41. PALETTE_MODE_MAGNIFY_CANCELLED,
  42. PALETTE_MODE_MAGNIFY_SWITCHED,
  43. PALETTE_MODE_CANCEL_TYPE_COUNT
  44. };
  45. // Type of palette option invocation method.
  46. enum class PaletteInvocationMethod {
  47. MENU,
  48. SHORTCUT,
  49. };
  50. // Helper functions that convert PaletteToolIds to PaletteTrayOptions.
  51. PaletteTrayOptions PaletteToolIdToPaletteTrayOptions(PaletteToolId tool_id);
  52. // Helper functions that convert PaletteToolIds to PaletteModeCancelType.
  53. PaletteModeCancelType PaletteToolIdToPaletteModeCancelType(
  54. PaletteToolId tool_id,
  55. bool is_switched);
  56. } // namespace ash
  57. #endif // ASH_SYSTEM_PALETTE_PALETTE_IDS_H_