Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <accessibility/standard/vclxaccessibletextfield.hxx>
30 : : #include <vcl/lstbox.hxx>
31 : : #include <accessibility/helper/listboxhelper.hxx>
32 : :
33 : : #include <unotools/accessiblestatesethelper.hxx>
34 : : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
35 : : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
36 : : #include <com/sun/star/accessibility/AccessibleRole.hpp>
37 : : #include <vcl/svapp.hxx>
38 : : #include <vcl/combobox.hxx>
39 : :
40 : : using namespace ::com::sun::star;
41 : : using namespace ::com::sun::star::uno;
42 : : using namespace ::com::sun::star::lang;
43 : : using namespace ::com::sun::star::beans;
44 : : using namespace ::com::sun::star::accessibility;
45 : :
46 : :
47 : :
48 : :
49 : 6 : VCLXAccessibleTextField::VCLXAccessibleTextField (VCLXWindow* pVCLWindow, const Reference< XAccessible >& _xParent) :
50 : :
51 : : VCLXAccessibleTextComponent (pVCLWindow),
52 : :
53 : 6 : m_xParent( _xParent )
54 : :
55 : : {
56 : 6 : }
57 : :
58 : :
59 : :
60 : :
61 : 0 : VCLXAccessibleTextField::~VCLXAccessibleTextField (void)
62 : : {
63 [ # # ]: 0 : }
64 : :
65 : :
66 : :
67 : :
68 : 0 : ::rtl::OUString VCLXAccessibleTextField::implGetText (void)
69 : : {
70 : 0 : ::rtl::OUString aText;
71 [ # # ]: 0 : ListBox* pListBox = static_cast<ListBox*>(GetWindow());
72 [ # # ][ # # ]: 0 : if (pListBox!=NULL && !pListBox->IsInDropDown())
[ # # ][ # # ]
73 [ # # ][ # # ]: 0 : aText = pListBox->GetSelectEntry();
[ # # ]
74 : :
75 : 0 : return aText;
76 : : }
77 : :
78 : :
79 : :
80 : :
81 [ - + ][ # # ]: 318 : IMPLEMENT_FORWARD_XINTERFACE2(VCLXAccessibleTextField, VCLXAccessibleTextComponent, VCLXAccessible_BASE)
82 [ # # ][ # # ]: 0 : IMPLEMENT_FORWARD_XTYPEPROVIDER2(VCLXAccessibleTextField, VCLXAccessibleTextComponent, VCLXAccessible_BASE)
[ # # ]
83 : :
84 : :
85 : : //===== XAccessible =========================================================
86 : :
87 : : Reference<XAccessibleContext> SAL_CALL
88 : 20 : VCLXAccessibleTextField::getAccessibleContext (void)
89 : : throw (RuntimeException)
90 : : {
91 : 20 : return this;
92 : : }
93 : :
94 : :
95 : : //===== XAccessibleContext ==================================================
96 : :
97 : 8 : sal_Int32 SAL_CALL VCLXAccessibleTextField::getAccessibleChildCount (void)
98 : : throw (RuntimeException)
99 : : {
100 : 8 : return 0;
101 : : }
102 : :
103 : :
104 : :
105 : :
106 : 0 : Reference<XAccessible> SAL_CALL VCLXAccessibleTextField::getAccessibleChild (sal_Int32)
107 : : throw (IndexOutOfBoundsException, RuntimeException)
108 : : {
109 [ # # ]: 0 : throw IndexOutOfBoundsException();
110 : : }
111 : :
112 : :
113 : :
114 : :
115 : 16 : sal_Int16 SAL_CALL VCLXAccessibleTextField::getAccessibleRole (void)
116 : : throw (RuntimeException)
117 : : {
118 [ + - ]: 16 : ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
119 : :
120 [ + - ]: 16 : return AccessibleRole::TEXT;
121 : : }
122 : :
123 : 6 : Reference< XAccessible > SAL_CALL VCLXAccessibleTextField::getAccessibleParent( )
124 : : throw (RuntimeException)
125 : : {
126 [ + - ]: 6 : ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
127 : :
128 [ + - ]: 6 : return m_xParent;
129 : : }
130 : :
131 : :
132 : :
133 : : //===== XServiceInfo ==========================================================
134 : :
135 : 2 : ::rtl::OUString VCLXAccessibleTextField::getImplementationName (void)
136 : : throw (RuntimeException)
137 : : {
138 : 2 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.toolkit.AccessibleTextField" ));
139 : : }
140 : :
141 : :
142 : :
143 : :
144 : 0 : Sequence< ::rtl::OUString > VCLXAccessibleTextField::getSupportedServiceNames (void)
145 : : throw (RuntimeException)
146 : : {
147 : 0 : Sequence< ::rtl::OUString > aNames = VCLXAccessibleTextComponent::getSupportedServiceNames();
148 : 0 : sal_Int32 nLength = aNames.getLength();
149 [ # # ]: 0 : aNames.realloc( nLength + 1 );
150 [ # # ][ # # ]: 0 : aNames[nLength] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleTextField" ));
151 : 0 : return aNames;
152 : : }
153 : :
154 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|