1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <accessibility/vclxaccessibletextcomponent.hxx>
24 #include <cppuhelper/implbase.hxx>
26 /** This class represents non editable text fields. The object passed to
27 the constructor is expected to be a list (a ListBox to be
28 more specific). From this always the selected item is token to be made
29 accessible by this class. When the selected item changes then also the
30 exported text changes.
32 class VCLXAccessibleTextField final
:
33 public cppu::ImplInheritanceHelper
<VCLXAccessibleTextComponent
, css::accessibility::XAccessible
>
36 VCLXAccessibleTextField(vcl::Window
* pWindow
,
37 const css::uno::Reference
<css::accessibility::XAccessible
>& _xParent
);
40 css::uno::Reference
< css::accessibility::XAccessibleContext
> SAL_CALL
41 getAccessibleContext() override
;
44 sal_Int64 SAL_CALL
getAccessibleChildCount() override
;
45 css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
46 getAccessibleChild (sal_Int64 i
) override
;
47 sal_Int16 SAL_CALL
getAccessibleRole() override
;
48 css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
49 getAccessibleParent( ) override
;
52 virtual OUString SAL_CALL
getImplementationName() override
;
53 // Return text field specific services.
54 virtual css::uno::Sequence
< OUString
> SAL_CALL
55 getSupportedServiceNames() override
;
58 virtual ~VCLXAccessibleTextField() override
= default;
60 /** With this method the text of the currently selected item is made
61 available to the VCLXAccessibleTextComponent base class.
63 OUString
implGetText() override
;
65 /** We need to save the accessible parent to return it in getAccessibleParent(),
66 because this method of the base class returns the wrong parent.
68 css::uno::Reference
< css::accessibility::XAccessible
> m_xParent
;
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */