diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-25 08:04:46 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-25 08:04:46 +0000 |
commit | 1f2e3972aeab08c412cdcc441793c53f560fa63c (patch) | |
tree | 6449b9609b6aa83164b2c1fcd945d211efda4be3 /vcl/aqua | |
parent | 5abe57b3dcbf8c0c5707aac2ca523fc2c00d7faf (diff) |
INTEGRATION: CWS aqua11y02 (1.2.30); FILE MERGED
2008/05/21 08:33:59 fne 1.2.30.1: #i88045# support grouping of radio buttons
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/inc/aqua11yfactory.h | 3 | ||||
-rw-r--r-- | vcl/aqua/source/a11y/aqua11yfactory.mm | 21 |
2 files changed, 20 insertions, 4 deletions
diff --git a/vcl/aqua/inc/aqua11yfactory.h b/vcl/aqua/inc/aqua11yfactory.h index 599a8d432d38..70d36be3da8e 100644 --- a/vcl/aqua/inc/aqua11yfactory.h +++ b/vcl/aqua/inc/aqua11yfactory.h @@ -8,7 +8,7 @@ * * $RCSfile: aqua11yfactory.h,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This file is part of OpenOffice.org. * @@ -43,6 +43,7 @@ +(AquaA11yWrapper *)wrapperForAccessible: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible >) rxAccessible; +(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext; +(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate; ++(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup; +(void)removeFromWrapperRepositoryFor: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext; +(void)registerView: (NSView *) theView; +(void)revokeView: (NSView *) theViewt; diff --git a/vcl/aqua/source/a11y/aqua11yfactory.mm b/vcl/aqua/source/a11y/aqua11yfactory.mm index e999a4c1a252..b660472d9bbe 100644 --- a/vcl/aqua/source/a11y/aqua11yfactory.mm +++ b/vcl/aqua/source/a11y/aqua11yfactory.mm @@ -8,7 +8,7 @@ * * $RCSfile: aqua11yfactory.mm,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This file is part of OpenOffice.org. * @@ -80,6 +80,10 @@ static bool enabled = false; return [ NSValue valueWithPointer: rxAccessibleContext.get() ]; } ++(NSValue *)keyForAccessibleContextAsRadioGroup: (Reference < XAccessibleContext >) rxAccessibleContext { + return [ NSValue valueWithPointer: ( rxAccessibleContext.get() + 2 ) ]; +} + +(AquaA11yWrapper *)wrapperForAccessible: (Reference < XAccessible >) rxAccessible { if ( rxAccessible.is() ) { Reference< XAccessibleContext > xAccessibleContext = rxAccessible->getAccessibleContext(); @@ -91,12 +95,21 @@ static bool enabled = false; } +(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext { - return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: YES ]; + return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: YES asRadioGroup: NO ]; } +(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate { + return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: bCreate asRadioGroup: NO ]; +} + ++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup{ NSMutableDictionary * dAllWrapper = [ AquaA11yFactory allWrapper ]; - NSValue * nKey = [ AquaA11yFactory keyForAccessibleContext: rxAccessibleContext ]; + NSValue * nKey = nil; + if ( asRadioGroup ) { + nKey = [ AquaA11yFactory keyForAccessibleContextAsRadioGroup: rxAccessibleContext ]; + } else { + nKey = [ AquaA11yFactory keyForAccessibleContext: rxAccessibleContext ]; + } AquaA11yWrapper * aWrapper = (AquaA11yWrapper *) [ dAllWrapper objectForKey: nKey ]; if ( aWrapper != nil ) { [ aWrapper retain ]; @@ -137,6 +150,7 @@ static bool enabled = false; aWrapper = [ [ AquaA11yWrapper alloc ] initWithAccessibleContext: rxAccessibleContext ]; } [ nativeRole release ]; + [ aWrapper setActsAsRadioGroup: asRadioGroup ]; if ( ! rxAccessibleContext -> getAccessibleStateSet() -> contains ( AccessibleStateType::TRANSIENT ) ) { [ dAllWrapper setObject: aWrapper forKey: nKey ]; } @@ -150,6 +164,7 @@ static bool enabled = false; } +(void)removeFromWrapperRepositoryFor: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext { + // TODO: when RADIO_BUTTON search for associated RadioGroup-wrapper and delete that as well AquaA11yWrapper * theWrapper = [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: NO ]; if ( theWrapper != nil ) { [ [ AquaA11yFactory allWrapper ] removeObjectForKey: [ AquaA11yFactory keyForAccessibleContext: rxAccessibleContext ] ]; |