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 .
20 #include <vcl/svapp.hxx>
21 #include <vcl/unohelp.hxx>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <comphelper/processfactory.hxx>
28 #include <com/sun/star/i18n/BreakIterator.hpp>
29 #include <com/sun/star/i18n/CharacterClassification.hpp>
30 #include <com/sun/star/awt/XExtendedToolkit.hpp>
31 #include <com/sun/star/accessibility/AccessibleEventObject.hpp>
32 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
34 using namespace ::com::sun::star
;
36 uno::Reference
< i18n::XBreakIterator
> vcl::unohelper::CreateBreakIterator()
38 uno::Reference
< uno::XComponentContext
> xContext
= comphelper::getProcessComponentContext();
39 return i18n::BreakIterator::create(xContext
);
42 uno::Reference
< i18n::XCharacterClassification
> vcl::unohelper::CreateCharacterClassification()
44 return i18n::CharacterClassification::create( comphelper::getProcessComponentContext() );
47 void vcl::unohelper::NotifyAccessibleStateEventGlobally( const css::accessibility::AccessibleEventObject
& rEventObject
)
49 css::uno::Reference
< css::awt::XExtendedToolkit
> xExtToolkit( Application::GetVCLToolkit(), uno::UNO_QUERY
);
50 if ( xExtToolkit
.is() )
52 // Only for focus events
53 sal_Int16 nType
= css::accessibility::AccessibleStateType::INVALID
;
54 rEventObject
.NewValue
>>= nType
;
55 if ( nType
== css::accessibility::AccessibleStateType::FOCUSED
)
56 xExtToolkit
->fireFocusGained( rEventObject
.Source
);
59 rEventObject
.OldValue
>>= nType
;
60 if ( nType
== css::accessibility::AccessibleStateType::FOCUSED
)
61 xExtToolkit
->fireFocusLost( rEventObject
.Source
);
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */