FocusPolicy.h 684 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/EnumBits.h>
  8. namespace GUI {
  9. // FocusPolicy determines how GUI widgets gain focus.
  10. //
  11. // - NoFocus: The widget is not focusable.
  12. // - TabFocus: The widget can gain focus by cycling through focusable widgets with the Tab key.
  13. // - ClickFocus: The widget gains focus when clicked.
  14. // - StrongFocus: The widget can gain focus both via Tab, and by clicking on it.
  15. enum class FocusPolicy {
  16. NoFocus = 0,
  17. TabFocus = 0x1,
  18. ClickFocus = 0x2,
  19. StrongFocus = TabFocus | ClickFocus,
  20. };
  21. AK_ENUM_BITWISE_OPERATORS(FocusPolicy)
  22. }