Bug 343150 Use AtkHyperlinkImpl

patch by nian.liu at sun.com r=ginn.chen
This commit is contained in:
ginn.chen%sun.com 2006-08-28 06:18:25 +00:00
Родитель 6e4070bafb
Коммит 983c7a72d8
4 изменённых файлов: 138 добавлений и 1 удалений

Просмотреть файл

@ -76,6 +76,7 @@ CPPSRCS = \
nsMaiInterfaceValue.cpp \
nsMaiHyperlink.cpp \
nsMaiInterfaceHypertext.cpp \
nsMaiInterfaceHyperlinkImpl.cpp \
nsMaiInterfaceTable.cpp \
nsMaiInterfaceDocument.cpp \
$(NULL)

Просмотреть файл

@ -53,6 +53,7 @@
#include "nsMaiInterfaceSelection.h"
#include "nsMaiInterfaceValue.h"
#include "nsMaiInterfaceHypertext.h"
#include "nsMaiInterfaceHyperlinkImpl.h"
#include "nsMaiInterfaceTable.h"
#include "nsMaiInterfaceDocument.h"
@ -76,10 +77,11 @@ enum MaiInterfaceType {
MAI_INTERFACE_VALUE,
MAI_INTERFACE_EDITABLE_TEXT,
MAI_INTERFACE_HYPERTEXT,
MAI_INTERFACE_HYPERLINK_IMPL,
MAI_INTERFACE_SELECTION,
MAI_INTERFACE_TABLE,
MAI_INTERFACE_TEXT,
MAI_INTERFACE_DOCUMENT /* 8 */
MAI_INTERFACE_DOCUMENT /* 9 */
};
static GType GetAtkTypeForMai(MaiInterfaceType type)
@ -95,6 +97,8 @@ static GType GetAtkTypeForMai(MaiInterfaceType type)
return ATK_TYPE_EDITABLE_TEXT;
case MAI_INTERFACE_HYPERTEXT:
return ATK_TYPE_HYPERTEXT;
case MAI_INTERFACE_HYPERLINK_IMPL:
return ATK_TYPE_HYPERLINK_IMPL;
case MAI_INTERFACE_SELECTION:
return ATK_TYPE_SELECTION;
case MAI_INTERFACE_TABLE:
@ -118,6 +122,8 @@ static const GInterfaceInfo atk_if_infos[] = {
(GInterfaceFinalizeFunc) NULL, NULL},
{(GInterfaceInitFunc)hypertextInterfaceInitCB,
(GInterfaceFinalizeFunc) NULL, NULL},
{(GInterfaceInitFunc)hyperlinkImplInterfaceInitCB,
(GInterfaceFinalizeFunc) NULL, NULL},
{(GInterfaceInitFunc)selectionInterfaceInitCB,
(GInterfaceFinalizeFunc) NULL, NULL},
{(GInterfaceInitFunc)tableInterfaceInitCB,
@ -366,6 +372,14 @@ nsAccessibleWrap::CreateMaiInterfaces(void)
}
}
//nsIAccessibleHyperLink
nsCOMPtr<nsIAccessibleHyperLink> accessInterfaceHyperlink;
QueryInterface(NS_GET_IID(nsIAccessibleHyperLink),
getter_AddRefs(accessInterfaceHyperlink));
if (accessInterfaceHyperlink) {
interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
}
//nsIAccessibleTable
nsCOMPtr<nsIAccessibleTable> accessInterfaceTable;
QueryInterface(NS_GET_IID(nsIAccessibleTable),

Просмотреть файл

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:expandtab:shiftwidth=4:tabstop=4:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Neo Liu(nian.liu@sun.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsMaiInterfaceHyperlinkImpl.h"
#include "nsMaiHyperlink.h"
void
hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface)
{
g_return_if_fail(aIface != NULL);
aIface->get_hyperlink = getHyperlinkCB;
}
AtkHyperlink*
getHyperlinkCB(AtkHyperlinkImpl *aImpl)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
NS_ENSURE_TRUE(accWrap, nsnull);
nsCOMPtr<nsIAccessibleHyperLink> accHyperlink;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperLink),
getter_AddRefs(accHyperlink));
NS_ENSURE_TRUE(accHyperlink, nsnull);
MaiHyperlink *maiHyperlink = new MaiHyperlink(accHyperlink);
return maiHyperlink->GetAtkHyperlink();
}

Просмотреть файл

@ -0,0 +1,56 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:expandtab:shiftwidth=4:tabstop=4:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Neo Liu(nian.liu@sun.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __MAI_INTERFACE_HYPERLINKIMPL_H__
#define __MAI_INTERFACE_HYPERLINKIMPL_H__
#include "nsMai.h"
G_BEGIN_DECLS
void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface);
/* hyperlinkImpl interface callbacks */
AtkHyperlink *getHyperlinkCB (AtkHyperlinkImpl *aImpl);
G_END_DECLS
#endif /* __MAI_INTERFACE_HYPERLINKIMPL_H__ */