2003-03-22 02:47:40 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00: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-03-22 02:47:40 +00:00
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2010-06-10 18:11:40 +00:00
|
|
|
#include "mozilla/ModuleUtils.h"
|
2003-03-22 02:47:40 +00:00
|
|
|
|
|
|
|
#include "nsIServiceManager.h"
|
|
|
|
#include "nsIComponentManager.h"
|
|
|
|
#include "nsIAccessibilityService.h"
|
2003-07-09 07:01:46 +00:00
|
|
|
#include "nsIAccessibleRetrieval.h"
|
2003-03-22 02:47:40 +00:00
|
|
|
#include "nscore.h"
|
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
static nsresult
|
2003-03-22 02:47:40 +00:00
|
|
|
NS_ConstructAccessibilityService(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
2012-07-30 14:20:58 +00:00
|
|
|
NS_ASSERTION(aOuter == nullptr, "no aggregation");
|
2003-03-22 02:47:40 +00:00
|
|
|
nsIAccessibilityService* accessibility;
|
2003-07-09 07:01:46 +00:00
|
|
|
rv = NS_GetAccessibilityService(&accessibility);
|
2003-03-22 02:47:40 +00:00
|
|
|
if (NS_FAILED(rv)) {
|
2003-07-09 07:01:46 +00:00
|
|
|
NS_ERROR("Unable to construct accessibility service");
|
2003-03-22 02:47:40 +00:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = accessibility->QueryInterface(aIID, aResult);
|
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to find correct interface");
|
|
|
|
NS_RELEASE(accessibility);
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
|
|
|
|
|
|
|
|
static const mozilla::Module::CIDEntry kA11yCIDs[] = {
|
|
|
|
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, NULL, NS_ConstructAccessibilityService },
|
|
|
|
{ NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const mozilla::Module::ContractIDEntry kA11yContracts[] = {
|
|
|
|
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
|
|
|
{ "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
|
|
|
{ NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const mozilla::Module kA11yModule = {
|
|
|
|
mozilla::Module::kVersion,
|
|
|
|
kA11yCIDs,
|
|
|
|
kA11yContracts
|
2003-03-22 02:47:40 +00:00
|
|
|
};
|
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
NSMODULE_DEFN(nsAccessibilityModule) = &kA11yModule;
|
2003-03-22 02:47:40 +00:00
|
|
|
|
|
|
|
|