2012-12-02 04:58:25 +04: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/. */
|
|
|
|
|
2016-08-18 18:49:13 +03:00
|
|
|
#ifndef mozilla_a11y_Platform_h
|
|
|
|
#define mozilla_a11y_Platform_h
|
|
|
|
|
2014-09-30 18:00:26 +04:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2015-06-05 22:43:30 +03:00
|
|
|
class nsString;
|
|
|
|
|
2012-12-02 04:58:25 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2014-03-08 01:35:19 +04:00
|
|
|
class ProxyAccessible;
|
|
|
|
|
2012-12-02 04:58:25 +04:00
|
|
|
enum EPlatformDisabledState {
|
|
|
|
ePlatformIsForceEnabled = -1,
|
|
|
|
ePlatformIsEnabled = 0,
|
|
|
|
ePlatformIsDisabled = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the platform disabled state.
|
|
|
|
*/
|
|
|
|
EPlatformDisabledState PlatformDisabledState();
|
|
|
|
|
|
|
|
#ifdef MOZ_ACCESSIBILITY_ATK
|
|
|
|
/**
|
|
|
|
* Perform initialization that should be done as soon as possible, in order
|
|
|
|
* to minimize startup time.
|
|
|
|
* XXX: this function and the next defined in ApplicationAccessibleWrap.cpp
|
|
|
|
*/
|
|
|
|
void PreInit();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(MOZ_ACCESSIBILITY_ATK) || defined(XP_MACOSX)
|
|
|
|
/**
|
|
|
|
* Is platform accessibility enabled.
|
|
|
|
* Only used on linux with atk and MacOS for now.
|
|
|
|
*/
|
|
|
|
bool ShouldA11yBeEnabled();
|
|
|
|
#endif
|
|
|
|
|
2017-06-15 19:05:26 +03:00
|
|
|
#if defined(XP_WIN)
|
|
|
|
bool IsHandlerRegistered();
|
|
|
|
#endif
|
|
|
|
|
2012-12-02 04:58:25 +04:00
|
|
|
/**
|
|
|
|
* Called to initialize platform specific accessibility support.
|
|
|
|
* Note this is called after internal accessibility support is initialized.
|
|
|
|
*/
|
|
|
|
void PlatformInit();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shutdown platform accessibility.
|
|
|
|
* Note this is called before internal accessibility support is shutdown.
|
|
|
|
*/
|
|
|
|
void PlatformShutdown();
|
|
|
|
|
2014-03-08 01:35:19 +04:00
|
|
|
/**
|
|
|
|
* called when a new ProxyAccessible is created, so the platform may setup a
|
|
|
|
* wrapper for it, or take other action.
|
|
|
|
*/
|
2015-01-09 23:01:39 +03:00
|
|
|
void ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces);
|
2014-03-08 01:35:19 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called just before a ProxyAccessible is destroyed so its wrapper can be
|
|
|
|
* disposed of and other action taken.
|
|
|
|
*/
|
|
|
|
void ProxyDestroyed(ProxyAccessible*);
|
2014-09-30 18:00:26 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Callied when an event is fired on a proxied accessible.
|
|
|
|
*/
|
|
|
|
void ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType);
|
2015-05-13 21:21:23 +03:00
|
|
|
void ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
|
|
|
|
bool aEnabled);
|
2017-05-15 23:11:46 +03:00
|
|
|
|
|
|
|
#if defined(XP_WIN)
|
|
|
|
void ProxyFocusEvent(ProxyAccessible* aTarget,
|
|
|
|
const LayoutDeviceIntRect& aCaretRect);
|
|
|
|
void ProxyCaretMoveEvent(ProxyAccessible* aTarget,
|
|
|
|
const LayoutDeviceIntRect& aCaretRect);
|
|
|
|
#else
|
2015-05-13 21:21:23 +03:00
|
|
|
void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset);
|
2017-05-15 23:11:46 +03:00
|
|
|
#endif
|
2015-06-05 22:43:30 +03:00
|
|
|
void ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
|
|
|
|
int32_t aStart, uint32_t aLen, bool aIsInsert,
|
|
|
|
bool aFromUser);
|
2016-04-06 04:43:04 +03:00
|
|
|
void ProxyShowHideEvent(ProxyAccessible* aTarget, ProxyAccessible* aParent,
|
|
|
|
bool aInsert, bool aFromUser);
|
2016-04-21 22:06:57 +03:00
|
|
|
void ProxySelectionEvent(ProxyAccessible* aTarget, ProxyAccessible* aWidget,
|
|
|
|
uint32_t aType);
|
2012-12-02 04:58:25 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-08-18 18:49:13 +03:00
|
|
|
#endif // mozilla_a11y_Platform_h
|