Line data Source code
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 :
20 : #include <vcl/svapp.hxx>
21 : #include <vcl/unohelp.hxx>
22 :
23 : #include <svdata.hxx>
24 :
25 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 : #include <comphelper/processfactory.hxx>
27 :
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>
33 :
34 : using namespace ::com::sun::star;
35 : using namespace ::rtl;
36 :
37 0 : uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator()
38 : {
39 0 : uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
40 0 : return i18n::BreakIterator::create(xContext);
41 : }
42 :
43 0 : uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacterClassification()
44 : {
45 0 : return i18n::CharacterClassification::create( comphelper::getProcessComponentContext() );
46 : }
47 :
48 0 : void vcl::unohelper::NotifyAccessibleStateEventGlobally( const ::com::sun::star::accessibility::AccessibleEventObject& rEventObject )
49 : {
50 0 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit > xExtToolkit( Application::GetVCLToolkit(), uno::UNO_QUERY );
51 0 : if ( xExtToolkit.is() )
52 : {
53 : // Only for focus events
54 0 : sal_Int16 nType = ::com::sun::star::accessibility::AccessibleStateType::INVALID;
55 0 : rEventObject.NewValue >>= nType;
56 0 : if ( nType == ::com::sun::star::accessibility::AccessibleStateType::FOCUSED )
57 0 : xExtToolkit->fireFocusGained( rEventObject.Source );
58 : else
59 : {
60 0 : rEventObject.OldValue >>= nType;
61 0 : if ( nType == ::com::sun::star::accessibility::AccessibleStateType::FOCUSED )
62 0 : xExtToolkit->fireFocusLost( rEventObject.Source );
63 : }
64 :
65 0 : }
66 0 : }
67 :
68 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|