LibreOffice Module accessibility (master) 1
vclxaccessiblebox.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/accessibility/XAccessible.hpp>
23#include <com/sun/star/accessibility/XAccessibleAction.hpp>
24#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
25#include <com/sun/star/accessibility/XAccessibleValue.hpp>
28
29
35 : public cppu::ImplInheritanceHelper<
36 VCLXAccessibleComponent,
37 css::accessibility::XAccessible,
38 css::accessibility::XAccessibleValue,
39 css::accessibility::XAccessibleAction>
40{
41public:
43
48 VCLXAccessibleBox (VCLXWindow* pVCLXindow, BoxType aType, bool bIsDropDownBox);
49
50
51 // XAccessible
52
53 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL
54 getAccessibleContext( ) override;
55
56 // XAccessibleContext
57
62 sal_Int64 SAL_CALL getAccessibleChildCount() final override;
67 css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
68 getAccessibleChild (sal_Int64 i) override;
71 sal_Int16 SAL_CALL getAccessibleRole() override;
72
73 // XAccessibleAction
74
77 virtual sal_Int32 SAL_CALL getAccessibleActionCount() final override;
81 virtual sal_Bool SAL_CALL doAccessibleAction (sal_Int32 nIndex) override;
85 virtual OUString SAL_CALL getAccessibleActionDescription (sal_Int32 nIndex) override;
88 virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL
89 getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
90
91 // XAccessibleValue
92
93 virtual css::uno::Any SAL_CALL getCurrentValue( ) override;
94
95 virtual sal_Bool SAL_CALL setCurrentValue(
96 const css::uno::Any& aNumber ) override;
97
98 virtual css::uno::Any SAL_CALL getMaximumValue( ) override;
99
100 virtual css::uno::Any SAL_CALL getMinimumValue( ) override;
101
102 virtual css::uno::Any SAL_CALL getMinimumIncrement( ) override;
103
104protected:
105 virtual ~VCLXAccessibleBox() override = default;
106
109 virtual bool IsValid() const = 0;
110
111 virtual void ProcessWindowChildEvent (const VclWindowEvent& rVclWindowEvent) override;
112 virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override;
113
114 virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
115
116 sal_Int64 implGetAccessibleChildCount();
117
118private:
123
126
128 css::uno::Reference< css::accessibility::XAccessible>
130
132 css::uno::Reference< css::accessibility::XAccessible>
134
140
148};
149
150
151/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for list- and combo boxes.
bool m_bHasListChild
This flag specifies whether an object has a list as child regardless of whether that child being curr...
virtual void ProcessWindowChildEvent(const VclWindowEvent &rVclWindowEvent) override
virtual css::uno::Any SAL_CALL getMinimumValue() override
virtual bool IsValid() const =0
Returns true when the object is valid.
css::uno::Reference< css::accessibility::XAccessible > m_xText
The child that represents the text field if there is one.
virtual css::uno::Any SAL_CALL getCurrentValue() override
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
The returned string is associated with resource RID_STR_ACC_ACTION_TOGGLEPOPUP.
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
The action for drop down boxes lets the user toggle the visibility of the popup menu.
css::uno::Reference< css::accessibility::XAccessible > m_xList
The child that contains the items of this box.
virtual css::uno::Any SAL_CALL getMinimumIncrement() override
BoxType m_aBoxType
Specifies whether the box is a combo box or a list box.
bool m_bHasTextChild
This flag specifies whether an object has a text field as child regardless of whether that child bein...
sal_Int64 SAL_CALL getAccessibleChildCount() final override
Each object has one or two children: an optional text field and the actual list.
virtual sal_Bool SAL_CALL setCurrentValue(const css::uno::Any &aNumber) override
sal_Int16 SAL_CALL getAccessibleRole() override
The role is always AccessibleRole::COMBO_BOX.
sal_Int64 implGetAccessibleChildCount()
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual void FillAccessibleStateSet(sal_Int64 &rStateSet) override
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
No keybinding returned so far.
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
For drop down list boxes the text field is a not editable VCLXAccessibleTextField,...
virtual css::uno::Any SAL_CALL getMaximumValue() override
virtual sal_Int32 SAL_CALL getAccessibleActionCount() final override
There is one action for drop down boxes and none for others.
VCLXAccessibleBox(VCLXWindow *pVCLXindow, BoxType aType, bool bIsDropDownBox)
The constructor is initialized with the box type which may be either COMBOBOX or LISTBOX and a flag i...
bool m_bIsDropDownBox
Specifies whether the box is a drop down box and thus has an action.
unsigned char sal_Bool