Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.2KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 7 technical preview.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For the technical preview this file cannot be licensed commercially.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. Base class for traversing components.
  18. If you need custom focus or keyboard focus traversal for a component you can
  19. create a subclass of ComponentTraverser and return it from
  20. Component::createFocusTraverser() or Component::createKeyboardFocusTraverser().
  21. @see Component::createFocusTraverser, Component::createKeyboardFocusTraverser
  22. @tags{GUI}
  23. */
  24. class JUCE_API ComponentTraverser
  25. {
  26. public:
  27. /** Destructor. */
  28. virtual ~ComponentTraverser() = default;
  29. /** Returns the component that should be used as the traversal entry point
  30. within the given parent component.
  31. This must return nullptr if there is no default component.
  32. */
  33. virtual Component* getDefaultComponent (Component* parentComponent) = 0;
  34. /** Returns the component that comes after the specified one when moving "forwards".
  35. This must return nullptr if there is no next component.
  36. */
  37. virtual Component* getNextComponent (Component* current) = 0;
  38. /** Returns the component that comes after the specified one when moving "backwards".
  39. This must return nullptr if there is no previous component.
  40. */
  41. virtual Component* getPreviousComponent (Component* current) = 0;
  42. /** Returns all of the traversable components within the given parent component in
  43. traversal order.
  44. */
  45. virtual std::vector<Component*> getAllComponents (Component* parentComponent) = 0;
  46. };
  47. } // namespace juce