AccessibleAlignmentCell.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /******************************************************************************
  2. Copyright (C) 2025 by Taylor Giampaolo <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include <components/AlignmentSelector.hpp>
  16. #include <QAccessibleInterface>
  17. #include <QRect>
  18. class AlignmentSelector;
  19. class AccessibleAlignmentCell : public QAccessibleInterface {
  20. QAccessibleInterface *parent_;
  21. AlignmentSelector *widget;
  22. int index_;
  23. public:
  24. AccessibleAlignmentCell(QAccessibleInterface *parent, AlignmentSelector *widget, int index);
  25. int index() const { return index_; }
  26. QRect rect() const override;
  27. QString text(QAccessible::Text t) const override;
  28. QAccessible::State state() const override;
  29. QAccessible::Role role() const override;
  30. QObject *object() const override { return nullptr; }
  31. QAccessibleInterface *child(int) const override { return nullptr; }
  32. QAccessibleInterface *childAt(int, int) const override { return nullptr; }
  33. int childCount() const override { return 0; }
  34. int indexOfChild(const QAccessibleInterface *) const override { return -1; }
  35. QAccessibleInterface *parent() const override { return parent_; }
  36. QAccessibleInterface *focusChild() const override { return nullptr; }
  37. bool isValid() const override { return widget != nullptr; }
  38. void setText(QAccessible::Text, const QString &) override {}
  39. };