LibreOffice Module vcl (master)  1
a11yfocustracker.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
21 #define INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
22 
23 #include <com/sun/star/accessibility/XAccessible.hpp>
24 
26 
27 #include <rtl/instance.hxx>
28 
29 #include <tools/link.hxx>
30 #include <vcl/vclevent.hxx>
31 #include <set>
32 
33 namespace vcl { class Window; }
34 class ToolBox;
35 class DocumentFocusListener;
36 
37 
39 {
40 
41 public:
43 
45 
46  css::uno::Reference< css::accessibility::XAccessible > const & getFocusedObject() { return m_xFocusedObject; };
47 
48  // sets the currently focus object and notifies the FocusEventListener (if any)
49  void setFocusedObject(const css::uno::Reference< css::accessibility::XAccessible >& xAccessible);
50 
51  // may evolve to add/remove later
52  void setFocusListener(const rtl::Reference< KeyboardFocusListener >& aFocusListener) { m_aFocusListener = aFocusListener; };
53 
54 protected:
55 
56  // received a WINDOW_GETFOCUS event for this window
57  void window_got_focus(vcl::Window *pWindow);
58 
59  // received a TOOLBOX_HIGHLIGHT event for this window
60  void toolbox_highlight_on(vcl::Window *pWindow);
61 
62  // received a TOOLBOX_HIGHLIGHTOFF event for this window
63  void toolbox_highlight_off(vcl::Window const *pWindow);
64 
65  // received a TABPAGE_ACTIVATE event for this window
66  void tabpage_activated(vcl::Window *pWindow);
67 
68  // received a MENU_HIGHLIGHT event for this window
69  void menu_highlighted(const ::VclMenuEvent *pEvent);
70 
71  // toolbox items are widgets in gtk+ and Cocoa
72  void notify_toolbox_item_focus(ToolBox *pToolBox);
73 
74  // toolbox item opened a floating window (e.g. color chooser)
75  void toolbox_open_floater(vcl::Window *pWindow);
76 
77  // callback function for Application::addEventListener
78  static void WindowEventHandler(void * pThis, VclSimpleEvent&);
79 
80 private:
81  // the accessible object that has the keyboard focus (if any)
82  css::uno::Reference< css::accessibility::XAccessible > m_xFocusedObject;
83 
84  // the listener for focus events
86 
87  // the list of Windows that need deeper (focus) investigation
88  std::set<VclPtr<vcl::Window>> m_aDocumentWindowList;
89 
90  // the link object needed for Application::addEventListener
92 
93  // the UNO XAccessibilityEventListener for Documents and other non VCL objects
95 };
96 
98  rtl::Static<AquaA11yFocusTracker, TheAquaA11yFocusTracker>
99 {};
100 
101 #endif // INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void menu_highlighted(const ::VclMenuEvent *pEvent)
void toolbox_open_floater(vcl::Window *pWindow)
css::uno::Reference< css::accessibility::XAccessible > const & getFocusedObject()
void notify_toolbox_item_focus(ToolBox *pToolBox)
void toolbox_highlight_on(vcl::Window *pWindow)
void setFocusListener(const rtl::Reference< KeyboardFocusListener > &aFocusListener)
std::set< VclPtr< vcl::Window > > m_aDocumentWindowList
void setFocusedObject(const css::uno::Reference< css::accessibility::XAccessible > &xAccessible)
css::uno::Reference< css::accessibility::XAccessible > m_xFocusedObject
void window_got_focus(vcl::Window *pWindow)
void toolbox_highlight_off(vcl::Window const *pWindow)
rtl::Reference< KeyboardFocusListener > m_aFocusListener
const rtl::Reference< DocumentFocusListener > m_xDocumentFocusListener
static void WindowEventHandler(void *pThis, VclSimpleEvent &)
Link< VclSimpleEvent &, void > m_aWindowEventLink
void tabpage_activated(vcl::Window *pWindow)