LibreOffice Module accessibility (master) 1
vclxaccessibletextfield.cxx
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
22
23#include <com/sun/star/accessibility/AccessibleRole.hpp>
24#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
25
26using namespace ::com::sun::star;
27using namespace ::com::sun::star::uno;
28using namespace ::com::sun::star::lang;
29using namespace ::com::sun::star::beans;
30using namespace ::com::sun::star::accessibility;
31
32
34 ImplInheritanceHelper (pVCLWindow),
35 m_xParent( _xParent )
36
37{
38}
39
40
42{
43 OUString aText;
44 VclPtr< ListBox > pListBox = GetAs< ListBox >();
45 if (pListBox && !pListBox->IsInDropDown())
46 aText = pListBox->GetSelectedEntry();
47
48 return aText;
49}
50
51
52// XAccessible
53
54Reference<XAccessibleContext> SAL_CALL
56{
57 return this;
58}
59
60
61// XAccessibleContext
62
64{
65 return 0;
66}
67
68
69Reference<XAccessible> SAL_CALL VCLXAccessibleTextField::getAccessibleChild (sal_Int64)
70{
71 throw IndexOutOfBoundsException();
72}
73
74
76{
77 return AccessibleRole::TEXT;
78}
79
81{
82 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
83
84 return m_xParent;
85}
86
87
88// XServiceInfo
89
91{
92 return "com.sun.star.comp.toolkit.AccessibleTextField";
93}
94
95
97{
98 return comphelper::concatSequences(VCLXAccessibleTextComponent::getSupportedServiceNames(),
99 Sequence<OUString>{"com.sun.star.accessibility.AccessibleTextField"});
100}
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
sal_Int16 SAL_CALL getAccessibleRole() override
virtual OUString SAL_CALL getImplementationName() override
sal_Int64 SAL_CALL getAccessibleChildCount() override
css::uno::Reference< css::accessibility::XAccessible > m_xParent
We need to save the accessible parent to return it in getAccessibleParent(), because this method of t...
css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString implGetText() override
With this method the text of the currently selected item is made available to the VCLXAccessibleTextC...
VCLXAccessibleTextField(VCLXWindow *pVCLXindow, const css::uno::Reference< css::accessibility::XAccessible > &_xParent)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)