2019-09-24 02:42:51 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef _TraversalRule_H_
|
|
|
|
#define _TraversalRule_H_
|
|
|
|
|
|
|
|
#include "Pivot.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
class LocalAccessible;
|
2019-09-24 02:42:51 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class represents a simple traversal rule.
|
|
|
|
*/
|
|
|
|
class TraversalRule final : public PivotRule {
|
|
|
|
public:
|
|
|
|
TraversalRule();
|
|
|
|
explicit TraversalRule(int32_t aGranularity);
|
|
|
|
|
|
|
|
~TraversalRule() = default;
|
|
|
|
|
2021-07-22 20:58:49 +03:00
|
|
|
virtual uint16_t Match(Accessible* aAcc) override;
|
2019-09-24 02:42:51 +03:00
|
|
|
|
|
|
|
private:
|
2021-02-20 02:14:32 +03:00
|
|
|
bool IsSingleLineage(LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
bool IsFlatSubtree(const LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
bool IsListItemBullet(const LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
bool HasName(const LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
uint16_t DefaultMatch(LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
uint16_t LinkMatch(LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
uint16_t HeadingMatch(LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
uint16_t ControlMatch(LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
uint16_t SectionMatch(LocalAccessible* aAccessible);
|
2019-09-24 02:42:51 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
uint16_t LandmarkMatch(LocalAccessible* aAccessible);
|
2020-04-16 01:12:37 +03:00
|
|
|
|
2019-09-24 02:42:51 +03:00
|
|
|
int32_t mGranularity;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2020-07-29 01:35:24 +03:00
|
|
|
#endif
|