2012-05-29 05:18:45 +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/. */
|
|
|
|
|
|
|
|
#ifndef __NS_ACCESSIBLE_WRAP_H__
|
|
|
|
#define __NS_ACCESSIBLE_WRAP_H__
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2021-02-20 02:14:32 +03:00
|
|
|
#include "LocalAccessible.h"
|
2012-05-29 05:18:45 +04:00
|
|
|
|
|
|
|
struct _AtkObject;
|
|
|
|
typedef struct _AtkObject AtkObject;
|
|
|
|
|
|
|
|
enum AtkProperty {
|
|
|
|
PROP_0, // gobject convention
|
|
|
|
PROP_NAME,
|
|
|
|
PROP_DESCRIPTION,
|
|
|
|
PROP_PARENT, // ancestry has changed
|
|
|
|
PROP_ROLE,
|
|
|
|
PROP_LAYER,
|
|
|
|
PROP_MDI_ZORDER,
|
|
|
|
PROP_TABLE_CAPTION,
|
|
|
|
PROP_TABLE_COLUMN_DESCRIPTION,
|
|
|
|
PROP_TABLE_COLUMN_HEADER,
|
|
|
|
PROP_TABLE_ROW_DESCRIPTION,
|
|
|
|
PROP_TABLE_ROW_HEADER,
|
|
|
|
PROP_TABLE_SUMMARY,
|
|
|
|
PROP_LAST // gobject convention
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AtkPropertyChange {
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t type; // property type as listed above
|
2012-05-29 05:18:45 +04:00
|
|
|
void* oldvalue;
|
|
|
|
void* newvalue;
|
|
|
|
};
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
class MaiHyperlink;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* AccessibleWrap, and its descendents in atk directory provide the
|
|
|
|
* implementation of AtkObject.
|
|
|
|
*/
|
2021-02-20 02:14:32 +03:00
|
|
|
class AccessibleWrap : public LocalAccessible {
|
2012-05-29 05:18:45 +04:00
|
|
|
public:
|
|
|
|
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
|
|
|
|
virtual ~AccessibleWrap();
|
|
|
|
void ShutdownAtkObject();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Shutdown() override;
|
2012-05-29 05:18:45 +04:00
|
|
|
|
|
|
|
// return the atk object for this AccessibleWrap
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void GetNativeInterface(void** aOutAccessible) override;
|
|
|
|
virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
|
2012-05-29 05:18:45 +04:00
|
|
|
|
|
|
|
AtkObject* GetAtkObject(void);
|
2021-02-20 02:14:32 +03:00
|
|
|
static AtkObject* GetAtkObject(LocalAccessible* aAccessible);
|
2012-05-29 05:18:45 +04:00
|
|
|
|
|
|
|
bool IsValidObject();
|
2014-10-22 04:49:28 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
static const char* ReturnString(nsAString& aString) {
|
|
|
|
static nsCString returnedString;
|
2020-09-02 12:54:37 +03:00
|
|
|
CopyUTF16toUTF8(aString, returnedString);
|
2012-05-29 05:18:45 +04:00
|
|
|
return returnedString.get();
|
|
|
|
}
|
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
static void GetKeyBinding(LocalAccessible* aAccessible, nsAString& aResult);
|
2015-10-06 22:36:29 +03:00
|
|
|
|
2021-02-20 02:14:32 +03:00
|
|
|
static LocalAccessible* GetColumnHeader(TableAccessible* aAccessible,
|
|
|
|
int32_t aColIdx);
|
|
|
|
static LocalAccessible* GetRowHeader(TableAccessible* aAccessible,
|
|
|
|
int32_t aRowIdx);
|
2012-05-29 05:18:45 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject* aObject);
|
|
|
|
nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject* aObject);
|
|
|
|
|
|
|
|
AtkObject* mAtkObject;
|
|
|
|
|
|
|
|
private:
|
2014-03-08 01:35:19 +04:00
|
|
|
uint16_t CreateMaiInterfaces();
|
2012-05-29 05:18:45 +04:00
|
|
|
};
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
#endif /* __NS_ACCESSIBLE_WRAP_H__ */
|