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.

85 lines
3.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 7 End-User License
  8. Agreement and JUCE Privacy Policy.
  9. End User License Agreement: www.juce.com/juce-7-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. namespace juce
  19. {
  20. /** An abstract interface which represents a UI element that supports a text interface.
  21. A UI element can use this interface to provide extended textual information which
  22. cannot be conveyed using just the title, description, and help text properties of
  23. AccessibilityHandler. This is typically for text that an accessibility client might
  24. want to read line-by-line, or provide text selection and input for.
  25. @tags{Accessibility}
  26. */
  27. class JUCE_API AccessibilityTextInterface
  28. {
  29. public:
  30. /** Destructor. */
  31. virtual ~AccessibilityTextInterface() = default;
  32. /** Returns true if the text being displayed is protected and should not be
  33. exposed to the user, for example a password entry field.
  34. */
  35. virtual bool isDisplayingProtectedText() const = 0;
  36. /** Returns true if the text being displayed is read-only or false if editable. */
  37. virtual bool isReadOnly() const = 0;
  38. /** Returns the total number of characters in the text element. */
  39. virtual int getTotalNumCharacters() const = 0;
  40. /** Returns the range of characters that are currently selected, or an empty
  41. range if nothing is selected.
  42. */
  43. virtual Range<int> getSelection() const = 0;
  44. /** Selects a section of the text. */
  45. virtual void setSelection (Range<int> newRange) = 0;
  46. /** Gets the current text insertion position, if supported. */
  47. virtual int getTextInsertionOffset() const = 0;
  48. /** Returns a section of text. */
  49. virtual String getText (Range<int> range) const = 0;
  50. /** Returns the full text. */
  51. String getAllText() const { return getText ({ 0, getTotalNumCharacters() }); }
  52. /** Replaces the text with a new string. */
  53. virtual void setText (const String& newText) = 0;
  54. /** Returns the bounding box in screen coordinates for a range of text.
  55. As the range may span multiple lines, this method returns a RectangleList.
  56. */
  57. virtual RectangleList<int> getTextBounds (Range<int> textRange) const = 0;
  58. /** Returns the index of the character at a given position in screen coordinates. */
  59. virtual int getOffsetAtPoint (Point<int> point) const = 0;
  60. };
  61. } // namespace juce