2020-09-02 01:12:55 +03:00
|
|
|
/* clang-format off */
|
|
|
|
/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* clang-format on */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#import "mozAccessible.h"
|
|
|
|
#include "Pivot.h"
|
|
|
|
|
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
|
|
|
/**
|
2020-09-29 01:32:07 +03:00
|
|
|
* This rule matches all accessibles that satisfy the "boilerplate"
|
|
|
|
* pivot conditions and have a corresponding native accessible.
|
2020-09-02 01:12:55 +03:00
|
|
|
*/
|
2020-09-29 01:32:07 +03:00
|
|
|
class RotorRule : public PivotRule {
|
2020-09-15 23:48:45 +03:00
|
|
|
public:
|
2020-09-29 01:32:07 +03:00
|
|
|
explicit RotorRule(AccessibleOrProxy& aDirectDescendantsFrom);
|
|
|
|
explicit RotorRule();
|
|
|
|
uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
|
2020-09-15 23:48:45 +03:00
|
|
|
|
2020-09-29 01:32:07 +03:00
|
|
|
private:
|
|
|
|
AccessibleOrProxy mDirectDescendantsFrom;
|
2020-09-28 22:18:32 +03:00
|
|
|
};
|
|
|
|
|
2020-09-29 01:32:07 +03:00
|
|
|
/**
|
|
|
|
* This rule matches all accessibles of a given role.
|
|
|
|
*/
|
|
|
|
class RotorRoleRule final : public RotorRule {
|
2020-09-28 22:18:32 +03:00
|
|
|
public:
|
2020-09-29 01:32:07 +03:00
|
|
|
explicit RotorRoleRule(role aRole, AccessibleOrProxy& aDirectDescendantsFrom);
|
|
|
|
explicit RotorRoleRule(role aRole);
|
|
|
|
uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
|
2020-09-28 22:18:32 +03:00
|
|
|
|
2020-09-29 01:32:07 +03:00
|
|
|
private:
|
|
|
|
role mRole;
|
2020-09-28 22:18:32 +03:00
|
|
|
};
|
|
|
|
|
2020-09-29 01:32:07 +03:00
|
|
|
class RotorControlRule final : public RotorRule {
|
2020-09-15 19:42:34 +03:00
|
|
|
public:
|
|
|
|
explicit RotorControlRule(AccessibleOrProxy& aDirectDescendantsFrom);
|
|
|
|
explicit RotorControlRule();
|
|
|
|
|
|
|
|
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
|
|
|
|
};
|
|
|
|
|
2020-09-29 01:32:07 +03:00
|
|
|
class RotorLinkRule : public RotorRule {
|
2020-09-17 23:20:55 +03:00
|
|
|
public:
|
|
|
|
explicit RotorLinkRule();
|
|
|
|
explicit RotorLinkRule(AccessibleOrProxy& aDirectDescendantsFrom);
|
|
|
|
|
|
|
|
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RotorVisitedLinkRule final : public RotorLinkRule {
|
|
|
|
public:
|
|
|
|
explicit RotorVisitedLinkRule();
|
|
|
|
explicit RotorVisitedLinkRule(AccessibleOrProxy& aDirectDescendantsFrom);
|
|
|
|
|
|
|
|
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RotorUnvisitedLinkRule final : public RotorLinkRule {
|
|
|
|
public:
|
|
|
|
explicit RotorUnvisitedLinkRule();
|
|
|
|
explicit RotorUnvisitedLinkRule(AccessibleOrProxy& aDirectDescendantsFrom);
|
|
|
|
|
|
|
|
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
|
|
|
|
};
|