2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2010-06-10 11:11:40 -07:00
|
|
|
#include "mozilla/ModuleUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsIServiceManager.h"
|
|
|
|
#include "nsIComponentManager.h"
|
|
|
|
#include "nsIAccessibilityService.h"
|
|
|
|
#include "nsIAccessibleRetrieval.h"
|
|
|
|
#include "nscore.h"
|
|
|
|
|
2010-06-10 11:11:40 -07:00
|
|
|
static nsresult
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_ConstructAccessibilityService(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
NS_ASSERTION(aOuter == nsnull, "no aggregation");
|
|
|
|
nsIAccessibilityService* accessibility;
|
|
|
|
rv = NS_GetAccessibilityService(&accessibility);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Unable to construct accessibility service");
|
|
|
|
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 11:11:40 -07: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
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2010-06-10 11:11:40 -07:00
|
|
|
NSMODULE_DEFN(nsAccessibilityModule) = &kA11yModule;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
|