2011-04-27 06:42:27 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2011-05-27 15:37:24 -07:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef __MAI_HYPERLINK_H__
|
|
|
|
#define __MAI_HYPERLINK_H__
|
|
|
|
|
|
|
|
#include "nsMai.h"
|
2012-05-28 18:18:45 -07:00
|
|
|
#include "Accessible.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
struct _AtkHyperlink;
|
|
|
|
typedef struct _AtkHyperlink AtkHyperlink;
|
|
|
|
|
2012-11-17 18:01:44 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/*
|
|
|
|
* MaiHyperlink is a auxiliary class for MaiInterfaceHyperText.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class MaiHyperlink
|
|
|
|
{
|
|
|
|
public:
|
2015-04-21 13:31:58 -07:00
|
|
|
explicit MaiHyperlink(uintptr_t aHyperLink);
|
2012-05-28 18:18:45 -07:00
|
|
|
~MaiHyperlink();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
2015-04-07 12:56:28 -07:00
|
|
|
AtkHyperlink* GetAtkHyperlink() const { return mMaiAtkHyperlink; }
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible* GetAccHyperlink()
|
2015-04-21 13:31:58 -07:00
|
|
|
{
|
|
|
|
if (!mHyperlink || mHyperlink & IS_PROXY)
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
Accessible* link = reinterpret_cast<Accessible*>(mHyperlink);
|
|
|
|
NS_ASSERTION(link->IsLink(), "Why isn't it a link!");
|
|
|
|
return link;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2015-04-22 15:31:19 -07:00
|
|
|
ProxyAccessible* Proxy() const
|
|
|
|
{
|
|
|
|
if (!(mHyperlink & IS_PROXY))
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
return reinterpret_cast<ProxyAccessible*>(mHyperlink & ~IS_PROXY);
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2015-04-21 13:31:58 -07:00
|
|
|
uintptr_t mHyperlink;
|
2012-05-28 18:18:45 -07:00
|
|
|
AtkHyperlink* mMaiAtkHyperlink;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
2012-11-17 18:01:44 -08:00
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif /* __MAI_HYPERLINK_H__ */
|