1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef AccGroupInfo_h_
6 #define AccGroupInfo_h_
8 #include "nsISupportsImpl.h"
9 #include "mozilla/MemoryReporting.h"
18 * Calculate and store group information.
22 MOZ_COUNTED_DTOR(AccGroupInfo
)
24 AccGroupInfo() = default;
25 AccGroupInfo(AccGroupInfo
&&) = default;
26 AccGroupInfo
& operator=(AccGroupInfo
&&) = default;
29 * Return 1-based position in the group.
31 uint32_t PosInSet() const { return mPosInSet
; }
34 * Return a number of items in the group.
36 uint32_t SetSize() const { return mSetSize
; }
39 * Return a direct or logical parent of the accessible that this group info is
42 Accessible
* ConceptualParent() const { return mParent
; }
45 * Update group information.
52 static AccGroupInfo
* CreateGroupInfo(const Accessible
* aAccessible
);
55 * Return a first item for the given container.
57 static Accessible
* FirstItemOf(const Accessible
* aContainer
);
60 * Return total number of items in container, and if it is has nested
63 static uint32_t TotalItemCount(Accessible
* aContainer
, bool* aIsHierarchical
);
66 * Return next item of the same group to the given item.
68 static Accessible
* NextItemTo(Accessible
* aItem
);
70 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
);
73 AccGroupInfo(const Accessible
* aItem
, a11y::role aRole
);
76 AccGroupInfo(const AccGroupInfo
&) = delete;
77 AccGroupInfo
& operator=(const AccGroupInfo
&) = delete;
80 * Return true if the given parent and child roles should have their node
83 static bool ShouldReportRelations(a11y::role aRole
, a11y::role aParentRole
);
86 * Return ARIA level value or the default one if ARIA is missed for the
89 static int32_t GetARIAOrDefaultLevel(const Accessible
* aAccessible
);
94 const Accessible
* mItem
;
99 } // namespace mozilla