22#include <toolkit/awt/vclxwindows.hxx>
28#include <com/sun/star/awt/KeyModifier.hpp>
29#include <com/sun/star/accessibility/AccessibleStateType.hpp>
30#include <com/sun/star/accessibility/AccessibleEventId.hpp>
31#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
49 :ImplInheritanceHelper( pVCLWindow )
58 bool bChecked =
false;
61 if ( pVCLXCheckBox && pVCLXCheckBox->
getState() == sal_Int16(1) )
70 bool bIndeterminate =
false;
73 if ( pVCLXCheckBox && pVCLXCheckBox->
getState() == sal_Int16(2) )
74 bIndeterminate =
true;
76 return bIndeterminate;
84 Any aOldValue, aNewValue;
86 aOldValue <<= AccessibleStateType::CHECKED;
88 aNewValue <<= AccessibleStateType::CHECKED;
90 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
99 Any aOldValue, aNewValue;
101 aOldValue <<= AccessibleStateType::INDETERMINATE;
103 aNewValue <<= AccessibleStateType::INDETERMINATE;
105 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
112 switch ( rVclWindowEvent.
GetId() )
114 case VclEventId::CheckboxToggle:
128 VCLXAccessibleTextComponent::FillAccessibleStateSet( rStateSet );
130 rStateSet |= AccessibleStateType::FOCUSABLE;
133 rStateSet |= AccessibleStateType::CHECKED;
136 rStateSet |= AccessibleStateType::INDETERMINATE;
145 return "com.sun.star.comp.toolkit.AccessibleCheckBox";
151 return {
"com.sun.star.awt.AccessibleCheckBox" };
160 OExternalLockGuard aGuard(
this );
168 OExternalLockGuard aGuard(
this );
171 throw IndexOutOfBoundsException();
175 if ( pCheckBox && pVCLXCheckBox )
177 sal_Int32 nValueMax = sal_Int32(1);
179 if ( pCheckBox->IsTriStateEnabled() )
180 nValueMax = sal_Int32(2);
182 sal_Int32
nValue =
static_cast<sal_Int32
>(pVCLXCheckBox->
getState());
198 OExternalLockGuard aGuard(
this );
201 throw IndexOutOfBoundsException();
204 return AccResId( RID_STR_ACC_ACTION_UNCHECK );
206 return AccResId( RID_STR_ACC_ACTION_CHECK );
212 OExternalLockGuard aGuard(
this );
215 throw IndexOutOfBoundsException();
222 KeyEvent aKeyEvent = pWindow->GetActivationKey();
226 awt::KeyStroke aKeyStroke;
227 aKeyStroke.Modifiers = 0;
229 aKeyStroke.Modifiers |= awt::KeyModifier::SHIFT;
231 aKeyStroke.Modifiers |= awt::KeyModifier::MOD1;
233 aKeyStroke.Modifiers |= awt::KeyModifier::MOD2;
235 aKeyStroke.Modifiers |= awt::KeyModifier::MOD3;
238 aKeyStroke.KeyFunc =
static_cast< sal_Int16
>( aKeyCode.
GetFunction() );
239 pKeyBindingHelper->AddKeyBinding( aKeyStroke );
243 return pKeyBindingHelper;
252 OExternalLockGuard aGuard(
this );
258 aValue <<= static_cast<sal_Int32>(pVCLXCheckBox->
getState());
266 OExternalLockGuard aGuard(
this );
268 bool bReturn =
false;
273 sal_Int32
nValue = 0, nValueMin = 0, nValueMax = 0;
274 OSL_VERIFY( aNumber >>=
nValue );
279 else if (
nValue > nValueMax )
292 OExternalLockGuard aGuard(
this );
303 if ( pCheckBox && pCheckBox->IsTriStateEnabled() )
311 OExternalLockGuard aGuard(
this );
314 aValue <<= sal_Int32(0);
321 OExternalLockGuard aGuard(
this );
324 aValue <<= sal_Int32(1);
OUString AccResId(TranslateId aId)
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
virtual sal_Bool SAL_CALL setCurrentValue(const css::uno::Any &aNumber) override
VCLXAccessibleCheckBox(VCLXWindow *pVCLXindow)
virtual css::uno::Any SAL_CALL getMinimumValue() override
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
virtual css::uno::Any SAL_CALL getMaximumValue() override
void SetIndeterminate(bool bIndeterminate)
bool IsIndeterminate() const
sal_Int32 implGetMaximumValue()
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
virtual css::uno::Any SAL_CALL getMinimumIncrement() override
void SetChecked(bool bChecked)
virtual css::uno::Any SAL_CALL getCurrentValue() override
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void FillAccessibleStateSet(sal_Int64 &rStateSet) override
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
virtual OUString SAL_CALL getImplementationName() override
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
void SAL_CALL setState(sal_Int16 n) override
sal_Int16 SAL_CALL getState() override
sal_uInt16 GetCode() const
KeyFuncType GetFunction() const