update credits
[LibreOffice.git] / basctl / source / inc / accessibledialogwindow.hxx
blobbd27394401604d3509f44077cf25e7816a7e0ee7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #ifndef INCLUDED_BASCTL_SOURCE_INC_ACCESSIBLEDIALOGWINDOW_HXX
21 #define INCLUDED_BASCTL_SOURCE_INC_ACCESSIBLEDIALOGWINDOW_HXX
23 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <comphelper/accessiblecomponenthelper.hxx>
26 #include <cppuhelper/implbase3.hxx>
27 #include <svl/lstner.hxx>
28 #include <tools/link.hxx>
29 #include <vcl/vclptr.hxx>
31 class VCLExternalSolarLock;
32 class VclSimpleEvent;
33 class VclWindowEvent;
35 namespace utl {
36 class AccessibleStateSetHelper;
39 namespace basctl
42 class DialogWindow;
43 class DlgEditor;
44 class DlgEdModel;
45 class DlgEdObj;
48 // class AccessibleDialogWindow
51 typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleExtendedComponentHelper_BASE;
53 typedef ::cppu::ImplHelper3 <
54 ::com::sun::star::accessibility::XAccessible,
55 ::com::sun::star::accessibility::XAccessibleSelection,
56 ::com::sun::star::lang::XServiceInfo > AccessibleDialogWindow_BASE;
58 class AccessibleDialogWindow : public AccessibleExtendedComponentHelper_BASE,
59 public AccessibleDialogWindow_BASE,
60 public SfxListener
62 private:
64 class ChildDescriptor
66 public:
67 DlgEdObj* pDlgEdObj;
68 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > rxAccessible;
70 ChildDescriptor( DlgEdObj* _pDlgEdObj );
71 ~ChildDescriptor();
73 ChildDescriptor( const ChildDescriptor& rDesc );
74 ChildDescriptor& operator=( const ChildDescriptor& rDesc );
76 bool operator==( const ChildDescriptor& rDesc );
77 bool operator<( const ChildDescriptor& rDesc ) const;
80 typedef ::std::vector< ChildDescriptor > AccessibleChildren;
82 AccessibleChildren m_aAccessibleChildren;
83 VCLExternalSolarLock* m_pExternalLock;
84 VclPtr<basctl::DialogWindow> m_pDialogWindow;
85 DlgEditor* m_pDlgEditor;
86 DlgEdModel* m_pDlgEdModel;
88 protected:
89 void UpdateFocused();
90 void UpdateSelected();
91 void UpdateBounds();
93 bool IsChildVisible( const ChildDescriptor& rDesc );
95 void InsertChild( const ChildDescriptor& rDesc );
96 void RemoveChild( const ChildDescriptor& rDesc );
97 void UpdateChild( const ChildDescriptor& rDesc );
98 void UpdateChildren();
99 void SortChildren();
101 DECL_LINK( WindowEventListener, VclSimpleEvent* );
103 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
104 void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
106 // OCommonAccessibleComponent
107 virtual ::com::sun::star::awt::Rectangle implGetBounds( ) throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
109 // XComponent
110 virtual void SAL_CALL disposing() SAL_OVERRIDE;
112 public:
113 AccessibleDialogWindow (basctl::DialogWindow*);
114 virtual ~AccessibleDialogWindow();
116 // SfxListener
117 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
119 // XInterface
120 DECLARE_XINTERFACE()
122 // XTypeProvider
123 DECLARE_XTYPEPROVIDER()
125 // XServiceInfo
126 virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
130 // XAccessible
131 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 // XAccessibleContext
134 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
135 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
137 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
138 virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
139 virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
140 virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
141 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
142 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
143 virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 // XAccessibleComponent
146 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
147 virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
148 virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
149 virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
151 // XAccessibleExtendedComponent
152 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
153 virtual OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
154 virtual OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
156 // XAccessibleSelection
157 virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
158 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
159 virtual void SAL_CALL clearAccessibleSelection()
160 throw (::com::sun::star::uno::RuntimeException,
161 std::exception) SAL_OVERRIDE;
162 virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
164 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
165 virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
168 } // namespace basctl
170 #endif // INCLUDED_BASCTL_SOURCE_INC_ACCESSIBLEDIALOGWINDOW_HXX
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */