2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-09-27 13:52:10 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-06-27 14:41:48 +00:00
|
|
|
|
2016-05-27 10:56:17 +03:00
|
|
|
#include <standard/vclxaccessibletextfield.hxx>
|
2007-06-27 14:41:48 +00:00
|
|
|
#include <vcl/lstbox.hxx>
|
2016-05-27 10:56:17 +03:00
|
|
|
#include <helper/listboxhelper.hxx>
|
2007-06-27 14:41:48 +00:00
|
|
|
|
|
|
|
#include <unotools/accessiblestatesethelper.hxx>
|
|
|
|
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
|
|
|
|
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
|
|
|
|
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
2017-02-06 17:08:38 +01:00
|
|
|
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
|
2007-06-27 14:41:48 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#include <vcl/combobox.hxx>
|
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::accessibility;
|
|
|
|
|
|
|
|
|
|
|
|
VCLXAccessibleTextField::VCLXAccessibleTextField (VCLXWindow* pVCLWindow, const Reference< XAccessible >& _xParent) :
|
|
|
|
|
|
|
|
VCLXAccessibleTextComponent (pVCLWindow),
|
|
|
|
|
|
|
|
m_xParent( _xParent )
|
|
|
|
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
VCLXAccessibleTextField::~VCLXAccessibleTextField()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
OUString VCLXAccessibleTextField::implGetText()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
2012-09-07 03:36:42 -03:00
|
|
|
OUString aText;
|
2015-03-16 13:59:09 +00:00
|
|
|
VclPtr< ListBox > pListBox = GetAs< ListBox >();
|
|
|
|
if (pListBox && !pListBox->IsInDropDown())
|
2017-09-14 16:50:25 +02:00
|
|
|
aText = pListBox->GetSelectedEntry();
|
2007-06-27 14:41:48 +00:00
|
|
|
|
|
|
|
return aText;
|
|
|
|
}
|
|
|
|
|
|
|
|
IMPLEMENT_FORWARD_XINTERFACE2(VCLXAccessibleTextField, VCLXAccessibleTextComponent, VCLXAccessible_BASE)
|
|
|
|
IMPLEMENT_FORWARD_XTYPEPROVIDER2(VCLXAccessibleTextField, VCLXAccessibleTextComponent, VCLXAccessible_BASE)
|
|
|
|
|
|
|
|
|
2015-05-15 13:27:19 +02:00
|
|
|
// XAccessible
|
2007-06-27 14:41:48 +00:00
|
|
|
|
|
|
|
Reference<XAccessibleContext> SAL_CALL
|
2015-04-14 12:44:47 +02:00
|
|
|
VCLXAccessibleTextField::getAccessibleContext()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-15 13:27:19 +02:00
|
|
|
// XAccessibleContext
|
2007-06-27 14:41:48 +00:00
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
sal_Int32 SAL_CALL VCLXAccessibleTextField::getAccessibleChildCount()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Reference<XAccessible> SAL_CALL VCLXAccessibleTextField::getAccessibleChild (sal_Int32)
|
|
|
|
{
|
|
|
|
throw IndexOutOfBoundsException();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
sal_Int16 SAL_CALL VCLXAccessibleTextField::getAccessibleRole()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
|
|
|
|
|
|
|
return AccessibleRole::TEXT;
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XAccessible > SAL_CALL VCLXAccessibleTextField::getAccessibleParent( )
|
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
|
|
|
|
|
|
|
return m_xParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-15 13:27:19 +02:00
|
|
|
// XServiceInfo
|
2007-06-27 14:41:48 +00:00
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
OUString VCLXAccessibleTextField::getImplementationName()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
2012-09-07 03:36:42 -03:00
|
|
|
return OUString( "com.sun.star.comp.toolkit.AccessibleTextField" );
|
2007-06-27 14:41:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
Sequence< OUString > VCLXAccessibleTextField::getSupportedServiceNames()
|
2007-06-27 14:41:48 +00:00
|
|
|
{
|
2012-09-07 03:36:42 -03:00
|
|
|
Sequence< OUString > aNames = VCLXAccessibleTextComponent::getSupportedServiceNames();
|
2007-06-27 14:41:48 +00:00
|
|
|
sal_Int32 nLength = aNames.getLength();
|
|
|
|
aNames.realloc( nLength + 1 );
|
2012-09-07 03:36:42 -03:00
|
|
|
aNames[nLength] = "com.sun.star.accessibility.AccessibleTextField";
|
2007-06-27 14:41:48 +00:00
|
|
|
return aNames;
|
|
|
|
}
|
2010-10-12 15:57:08 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|