From 9af444ccb85011713dfb7b4600d7fb4cbb124a96 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Fri, 12 Jun 2009 20:49:28 +0800 Subject: [PATCH] Bug 493723 - implement IAccessibleTable interface for ARIA grids, r=marcoz, davidb, ginn --- accessible/src/atk/Makefile.in | 1 + accessible/src/atk/nsARIAGridAccessibleWrap.h | 49 ++++++++++++++ .../src/base/nsAccessibilityService.cpp | 4 +- accessible/src/mac/Makefile.in | 1 + accessible/src/mac/nsARIAGridAccessibleWrap.h | 49 ++++++++++++++ accessible/src/msaa/Makefile.in | 2 + .../src/msaa/nsARIAGridAccessibleWrap.cpp | 48 ++++++++++++++ .../src/msaa/nsARIAGridAccessibleWrap.h | 65 +++++++++++++++++++ accessible/src/other/Makefile.in | 1 + .../src/other/nsARIAGridAccessibleWrap.h | 49 ++++++++++++++ 10 files changed, 267 insertions(+), 2 deletions(-) create mode 100644 accessible/src/atk/nsARIAGridAccessibleWrap.h create mode 100644 accessible/src/mac/nsARIAGridAccessibleWrap.h create mode 100644 accessible/src/msaa/nsARIAGridAccessibleWrap.cpp create mode 100644 accessible/src/msaa/nsARIAGridAccessibleWrap.h create mode 100644 accessible/src/other/nsARIAGridAccessibleWrap.h diff --git a/accessible/src/atk/Makefile.in b/accessible/src/atk/Makefile.in index 771172b7cd3..36e63b7782a 100644 --- a/accessible/src/atk/Makefile.in +++ b/accessible/src/atk/Makefile.in @@ -91,6 +91,7 @@ endif EXPORTS = \ nsAccessNodeWrap.h \ + nsARIAGridAccessibleWrap.h \ nsAccessibleWrap.h \ nsDocAccessibleWrap.h \ nsRootAccessibleWrap.h \ diff --git a/accessible/src/atk/nsARIAGridAccessibleWrap.h b/accessible/src/atk/nsARIAGridAccessibleWrap.h new file mode 100644 index 00000000000..c381990fe0b --- /dev/null +++ b/accessible/src/atk/nsARIAGridAccessibleWrap.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ +/* ***** 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 + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov (original author) + * + * 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 _NSARIAGRIDACCESSIBLEWRAP_H +#define _NSARIAGRIDACCESSIBLEWRAP_H + +#include "nsARIAGridAccessible.h" + +typedef class nsARIAGridAccessible nsARIAGridAccessibleWrap; + +#endif + diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index db7bb67509a..3e3cd42764d 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -41,7 +41,7 @@ #include "nsAccessibilityService.h" #include "nsCoreUtils.h" #include "nsAccUtils.h" -#include "nsARIAGridAccessible.h" +#include "nsARIAGridAccessibleWrap.h" #include "nsARIAMap.h" #include "nsIContentViewer.h" #include "nsCURILoader.h" @@ -1555,7 +1555,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode, // Try to create ARIA grid/treegrid accessibles. if (roleMapEntry->role == nsIAccessibleRole::ROLE_TABLE || roleMapEntry->role == nsIAccessibleRole::ROLE_TREE_TABLE) { - newAcc = new nsARIAGridAccessible(aNode, aWeakShell); + newAcc = new nsARIAGridAccessibleWrap(aNode, aWeakShell); } else if (roleMapEntry->role == nsIAccessibleRole::ROLE_GRID_CELL || roleMapEntry->role == nsIAccessibleRole::ROLE_ROWHEADER || roleMapEntry->role == nsIAccessibleRole::ROLE_COLUMNHEADER) { diff --git a/accessible/src/mac/Makefile.in b/accessible/src/mac/Makefile.in index 29a2d0e6d69..cde2e317e40 100644 --- a/accessible/src/mac/Makefile.in +++ b/accessible/src/mac/Makefile.in @@ -77,6 +77,7 @@ EXPORTS = \ nsAccessNodeWrap.h \ nsTextAccessibleWrap.h \ nsAccessibleWrap.h \ + nsARIAGridAccessibleWrap.h \ nsDocAccessibleWrap.h \ nsRootAccessibleWrap.h \ nsXULMenuAccessibleWrap.h \ diff --git a/accessible/src/mac/nsARIAGridAccessibleWrap.h b/accessible/src/mac/nsARIAGridAccessibleWrap.h new file mode 100644 index 00000000000..c381990fe0b --- /dev/null +++ b/accessible/src/mac/nsARIAGridAccessibleWrap.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ +/* ***** 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 + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov (original author) + * + * 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 _NSARIAGRIDACCESSIBLEWRAP_H +#define _NSARIAGRIDACCESSIBLEWRAP_H + +#include "nsARIAGridAccessible.h" + +typedef class nsARIAGridAccessible nsARIAGridAccessibleWrap; + +#endif + diff --git a/accessible/src/msaa/Makefile.in b/accessible/src/msaa/Makefile.in index 608f68ae231..d694b512986 100644 --- a/accessible/src/msaa/Makefile.in +++ b/accessible/src/msaa/Makefile.in @@ -74,6 +74,7 @@ CPPSRCS = \ nsDocAccessibleWrap.cpp \ nsRootAccessibleWrap.cpp \ nsHTMLWin32ObjectAccessible.cpp \ + nsARIAGridAccessibleWrap.cpp \ nsXULMenuAccessibleWrap.cpp \ nsXULTreeAccessibleWrap.cpp \ nsHyperTextAccessibleWrap.cpp \ @@ -99,6 +100,7 @@ EXPORTS = \ nsDocAccessibleWrap.h \ nsRootAccessibleWrap.h \ nsHTMLWin32ObjectAccessible.h \ + nsARIAGridAccessibleWrap.h \ nsXULMenuAccessibleWrap.h \ nsXULTreeAccessibleWrap.h \ nsHyperTextAccessibleWrap.h \ diff --git a/accessible/src/msaa/nsARIAGridAccessibleWrap.cpp b/accessible/src/msaa/nsARIAGridAccessibleWrap.cpp new file mode 100644 index 00000000000..652958cfc82 --- /dev/null +++ b/accessible/src/msaa/nsARIAGridAccessibleWrap.cpp @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ +/* ***** 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 + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov (original author) + * + * 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 "nsARIAGridAccessibleWrap.h" + +NS_IMPL_ISUPPORTS_INHERITED0(nsARIAGridAccessibleWrap, + nsARIAGridAccessible) + +IMPL_IUNKNOWN_INHERITED1(nsARIAGridAccessibleWrap, + nsAccessibleWrap, + CAccessibleTable); diff --git a/accessible/src/msaa/nsARIAGridAccessibleWrap.h b/accessible/src/msaa/nsARIAGridAccessibleWrap.h new file mode 100644 index 00000000000..7e5ffe86b11 --- /dev/null +++ b/accessible/src/msaa/nsARIAGridAccessibleWrap.h @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ +/* ***** 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 + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov (original author) + * + * 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 _NSARIAGRIDACCESSIBLEWRAP_H +#define _NSARIAGRIDACCESSIBLEWRAP_H + +#include "nsARIAGridAccessible.h" +#include "CAccessibleTable.h" + +/** + * Accessible for ARIA grid and treegrid implementing IAccessibleTable + * interface. + */ +class nsARIAGridAccessibleWrap : public nsARIAGridAccessible, + public CAccessibleTable +{ +public: + nsARIAGridAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference* aShell) : + nsARIAGridAccessible(aNode, aShell) {} + + // IUnknown + DECL_IUNKNOWN_INHERITED + + // nsISupports + NS_DECL_ISUPPORTS_INHERITED +}; + +#endif diff --git a/accessible/src/other/Makefile.in b/accessible/src/other/Makefile.in index 523c710c866..16687054060 100644 --- a/accessible/src/other/Makefile.in +++ b/accessible/src/other/Makefile.in @@ -75,6 +75,7 @@ CPPSRCS = \ EXPORTS = \ nsAccessNodeWrap.h \ + nsARIAGridAccessibleWrap.h \ nsTextAccessibleWrap.h \ nsAccessibleWrap.h \ nsDocAccessibleWrap.h \ diff --git a/accessible/src/other/nsARIAGridAccessibleWrap.h b/accessible/src/other/nsARIAGridAccessibleWrap.h new file mode 100644 index 00000000000..c381990fe0b --- /dev/null +++ b/accessible/src/other/nsARIAGridAccessibleWrap.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ +/* ***** 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 + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov (original author) + * + * 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 _NSARIAGRIDACCESSIBLEWRAP_H +#define _NSARIAGRIDACCESSIBLEWRAP_H + +#include "nsARIAGridAccessible.h" + +typedef class nsARIAGridAccessible nsARIAGridAccessibleWrap; + +#endif +