XP part of accessibility landing

-r vidur, rods -sr hyatt
This commit is contained in:
evaughan@netscape.com
2001-04-01 01:01:33 +00:00
parent 61e3644dda
commit 690be860d9
26 changed files with 598 additions and 55 deletions

View File

@@ -32,6 +32,11 @@
#include "nsINameSpaceManager.h"
#include "nsIPresState.h"
#include "nsCSSRendering.h"
#include "nsIMutableAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
//------------------------------------------------------------
nsresult
@@ -82,6 +87,23 @@ nsGfxCheckboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr
*aInstancePtr = (void*) ((nsICheckboxControlFrame*) this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIAccessible))) {
nsresult rv = NS_OK;
NS_WITH_SERVICE(nsIAccessibilityService, accService, "@mozilla.org/accessibilityService;1", &rv);
if (accService) {
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent);
nsIMutableAccessible* acc = nsnull;
accService->CreateMutableAccessible(node,&acc);
acc->SetName(NS_LITERAL_STRING("Check Box").get());
acc->SetRole(NS_LITERAL_STRING("check box").get());
acc->SetIsLeaf(PR_TRUE);
*aInstancePtr = acc;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return nsFormControlFrame::QueryInterface(aIID, aInstancePtr);
}