2003-04-02 02:18:29 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2003-04-02 02:18:29 +04:00
|
|
|
|
2012-05-04 10:09:22 +04:00
|
|
|
#include "RootAccessibleWrap.h"
|
2003-04-02 02:18:29 +04:00
|
|
|
|
2008-02-08 12:35:42 +03:00
|
|
|
#include "mozDocAccessible.h"
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2008-02-22 23:13:17 +03:00
|
|
|
#include "nsObjCExceptions.h"
|
2013-04-23 15:37:18 +04:00
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsView.h"
|
2006-09-11 19:44:00 +04:00
|
|
|
#include "nsIWidget.h"
|
|
|
|
|
2012-05-04 10:09:22 +04:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
|
|
|
RootAccessibleWrap::
|
2016-03-02 17:39:06 +03:00
|
|
|
RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell) :
|
|
|
|
RootAccessible(aDocument, aPresShell)
|
2003-04-02 02:18:29 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-05-04 10:09:22 +04:00
|
|
|
RootAccessibleWrap::~RootAccessibleWrap()
|
2003-04-02 02:18:29 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-05-17 18:00:30 +04:00
|
|
|
Class
|
2012-05-04 10:09:22 +04:00
|
|
|
RootAccessibleWrap::GetNativeType()
|
2006-09-11 19:44:00 +04:00
|
|
|
{
|
2008-02-22 23:13:17 +03:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2006-09-11 19:44:00 +04:00
|
|
|
return [mozRootAccessible class];
|
2008-02-22 23:13:17 +03:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2006-09-11 19:44:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-05-04 10:09:22 +04:00
|
|
|
RootAccessibleWrap::GetNativeWidget(void** aOutView)
|
2006-09-11 19:44:00 +04:00
|
|
|
{
|
|
|
|
nsIFrame *frame = GetFrame();
|
|
|
|
if (frame) {
|
2016-04-16 02:37:35 +03:00
|
|
|
nsView *view = frame->GetView();
|
2006-09-11 19:44:00 +04:00
|
|
|
if (view) {
|
|
|
|
nsIWidget *widget = view->GetWidget();
|
|
|
|
if (widget) {
|
|
|
|
*aOutView = (void**)widget->GetNativeData (NS_NATIVE_WIDGET);
|
2015-06-08 17:59:19 +03:00
|
|
|
NS_ASSERTION (*aOutView,
|
2006-09-11 19:44:00 +04:00
|
|
|
"Couldn't get the native NSView parent we need to connect the accessibility hierarchy!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|