update dev300-m58
[ooovba.git] / basctl / source / inc / accessibledialogwindow.hxx
blob880d6a7328828fd5b465a74a869f65b146827ebd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: accessibledialogwindow.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BASCTL_ACCESSIBLEDIALOGWINDOW_HXX_
32 #define _BASCTL_ACCESSIBLEDIALOGWINDOW_HXX_
34 #include <com/sun/star/accessibility/XAccessible.hpp>
35 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <comphelper/accessiblecomponenthelper.hxx>
38 #include <cppuhelper/implbase3.hxx>
39 #include <tools/link.hxx>
40 #include <svtools/lstner.hxx>
42 #include <vector>
44 class DialogWindow;
45 class DlgEditor;
46 class DlgEdModel;
47 class DlgEdObj;
48 class VCLExternalSolarLock;
49 class VclSimpleEvent;
50 class VclWindowEvent;
52 namespace utl {
53 class AccessibleStateSetHelper;
57 // ----------------------------------------------------
58 // class AccessibleDialogWindow
59 // ----------------------------------------------------
61 typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleExtendedComponentHelper_BASE;
63 typedef ::cppu::ImplHelper3 <
64 ::com::sun::star::accessibility::XAccessible,
65 ::com::sun::star::accessibility::XAccessibleSelection,
66 ::com::sun::star::lang::XServiceInfo > AccessibleDialogWindow_BASE;
68 class AccessibleDialogWindow : public AccessibleExtendedComponentHelper_BASE,
69 public AccessibleDialogWindow_BASE,
70 public SfxListener
72 private:
74 class ChildDescriptor
76 public:
77 DlgEdObj* pDlgEdObj;
78 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > rxAccessible;
80 ChildDescriptor( DlgEdObj* _pDlgEdObj );
81 ~ChildDescriptor();
83 ChildDescriptor( const ChildDescriptor& rDesc );
84 ChildDescriptor& operator=( const ChildDescriptor& rDesc );
86 bool operator==( const ChildDescriptor& rDesc );
87 bool operator<( const ChildDescriptor& rDesc ) const;
90 typedef ::std::vector< ChildDescriptor > AccessibleChildren;
92 AccessibleChildren m_aAccessibleChildren;
93 VCLExternalSolarLock* m_pExternalLock;
94 DialogWindow* m_pDialogWindow;
95 DlgEditor* m_pDlgEditor;
96 DlgEdModel* m_pDlgEdModel;
98 protected:
99 void UpdateFocused();
100 void UpdateSelected();
101 void UpdateBounds();
103 sal_Bool IsChildVisible( const ChildDescriptor& rDesc );
105 void InsertChild( const ChildDescriptor& rDesc );
106 void RemoveChild( const ChildDescriptor& rDesc );
107 void UpdateChild( const ChildDescriptor& rDesc );
108 void UpdateChildren();
109 void SortChildren();
111 DECL_LINK( WindowEventListener, VclSimpleEvent* );
113 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
114 virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
116 // OCommonAccessibleComponent
117 virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException);
119 // XComponent
120 virtual void SAL_CALL disposing();
122 public:
123 AccessibleDialogWindow( DialogWindow* pDialogWindow );
124 ~AccessibleDialogWindow();
126 // SfxListener
127 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
129 // XInterface
130 DECLARE_XINTERFACE()
132 // XTypeProvider
133 DECLARE_XTYPEPROVIDER()
135 // XServiceInfo
136 virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
137 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
138 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
140 // XAccessible
141 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
143 // XAccessibleContext
144 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
145 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);
146 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException);
147 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException);
148 virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException);
149 virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException);
150 virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
151 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
152 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException);
153 virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
155 // XAccessibleComponent
156 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);
157 virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
158 virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
159 virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
161 // XAccessibleExtendedComponent
162 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException);
163 virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException);
164 virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException);
166 // XAccessibleSelection
167 virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
168 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
169 virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
170 virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
171 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
172 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);
173 virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
177 #endif // _BASCTL_ACCESSIBLEDIALOGWINDOW_HXX_