1/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6#include "nsISupports.idl"
7
8%{C++
9#include <objc/objc.h>
10
11#define NS_ACCESSIBLE_MAC_EVENT_TOPIC "accessible-mac-event"
12%}
13
14[scriptable, builtinclass, uuid(9d27cf21-66fc-47dc-8a07-98edb18707b1)]
15interface nsIAccessibleMacInterface : nsISupports
16{
17  /**
18   * List of available attribute names for tthe object.
19   * Emulates `AXUIElementCopyAttributeNames`.
20   */
21  readonly attribute Array<AString> attributeNames;
22
23  /**
24   * List of available action names for tthe object.
25   * Emulates `AXUIElementCopyActionNames`.
26   */
27  readonly attribute Array<AString> actionNames;
28
29  /**
30   * Returns the value of an attribute.
31   * Emulates `AXUIElementCopyAttributeValue`.
32   */
33  [implicit_jscontext]
34  jsval getAttributeValue(in AString attributeName);
35
36  /**
37   * Requests that the accessibility object perform the specified action.
38   * Emulatets `AXUIElementPerformAction`.
39   */
40  void performAction(in AString actionName);
41
42  /**
43   * Returns true if the given attribute is settable on the object.
44   * Emulates `AXUIElementIsAttributeSettable`.
45   **/
46  bool isAttributeSettable(in AString attributeName);
47
48  /**
49   * Sets the given attribute with the given value on the object.
50   * Emulates `AXUIElementSetAttributeValue`.
51   **/
52  [implicit_jscontext]
53  void setAttributeValue(in AString attributeName, in jsval attributeValue);
54
55  %{C++
56  virtual id GetNativeMacAccessible() const = 0;
57  %}
58};
59
60