2 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11 #include "nsStringFwd.h"
12 #include "mozAccessible.h"
13 #include "MOXAccessibleBase.h"
22 // convert an array of Gecko accessibles to an NSArray of native accessibles
23 template <typename AccArray
>
24 NSArray
<mozAccessible
*>* ConvertToNSArray(AccArray
& aArray
) {
25 NSMutableArray
* nativeArray
= [[[NSMutableArray alloc
] init
] autorelease
];
27 // iterate through the list, and get each native accessible.
28 for (Accessible
* curAccessible
: aArray
) {
29 mozAccessible
* curNative
= GetNativeFromGeckoAccessible(curAccessible
);
31 [nativeArray addObject
:GetObjectOrRepresentedView(curNative
)];
38 * Get a localized string from the string bundle.
39 * Return nil if not found.
41 NSString
* LocalizedString(const nsString
& aString
);
44 * Gets an accessible atttribute from the mozAccessible's associated
45 * accessible wrapper or proxy, and returns the value as an NSString.
46 * nil if no attribute is found.
48 NSString
* GetAccAttr(mozAccessible
* aNativeAccessible
, nsAtom
* aAttrName
);
51 * Return true if the passed raw pointer is a live document accessible. Uses
52 * the provided root doc accessible to check for current documents.
54 bool DocumentExists(Accessible
* aDoc
, uintptr_t aDocPtr
);
56 NSDictionary
* StringAttributesFromAccAttributes(AccAttributes
* aAttributes
,
57 Accessible
* aContainer
);
60 } // namespace mozilla