Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / basctl / source / inc / accessibledialogcontrolshape.hxx
blob3f2c8b63cee52be8dbcd4eef65b7c27b7f4e7abf
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_ACCESSIBLEDIALOGCONTROLSHAPE_HXX
21 #define INCLUDED_BASCTL_SOURCE_INC_ACCESSIBLEDIALOGCONTROLSHAPE_HXX
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <comphelper/accessiblecomponenthelper.hxx>
26 #include <cppuhelper/implbase3.hxx>
27 #include <vcl/vclptr.hxx>
29 namespace vcl { class Window; }
31 namespace utl {
32 class AccessibleStateSetHelper;
35 namespace basctl
38 class DlgEdObj;
39 class DialogWindow;
42 // class AccessibleDialogControlShape
44 typedef ::cppu::ImplHelper3<
45 css::accessibility::XAccessible,
46 css::lang::XServiceInfo,
47 css::beans::XPropertyChangeListener > AccessibleDialogControlShape_BASE;
49 class AccessibleDialogControlShape final : public comphelper::OAccessibleExtendedComponentHelper,
50 public AccessibleDialogControlShape_BASE
52 friend class AccessibleDialogWindow;
54 private:
55 VclPtr<DialogWindow> m_pDialogWindow;
56 DlgEdObj* m_pDlgEdObj;
57 bool m_bFocused;
58 bool m_bSelected;
60 css::awt::Rectangle m_aBounds;
61 css::uno::Reference< css::beans::XPropertySet > m_xControlModel;
63 bool IsFocused();
64 bool IsSelected();
66 void SetFocused (bool bFocused);
67 void SetSelected (bool bSelected);
69 css::awt::Rectangle GetBounds();
70 void SetBounds( const css::awt::Rectangle& aBounds );
72 vcl::Window* GetWindow() const;
74 OUString GetModelStringProperty( OUString const & pPropertyName );
76 void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
78 // OCommonAccessibleComponent
79 virtual css::awt::Rectangle implGetBounds() override;
81 // XComponent
82 virtual void SAL_CALL disposing() override;
84 public:
85 AccessibleDialogControlShape (DialogWindow*, DlgEdObj*);
86 virtual ~AccessibleDialogControlShape() override;
88 // XInterface
89 DECLARE_XINTERFACE()
91 // XTypeProvider
92 DECLARE_XTYPEPROVIDER()
94 // XEventListener
95 virtual void SAL_CALL disposing( const css::lang::EventObject& rSource ) override;
97 // XPropertyChangeListener
98 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& rEvent ) override;
100 // XServiceInfo
101 virtual OUString SAL_CALL getImplementationName() override;
102 virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
103 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
105 // XAccessible
106 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
108 // XAccessibleContext
109 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
110 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
111 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
112 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override;
113 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
114 virtual OUString SAL_CALL getAccessibleDescription( ) override;
115 virtual OUString SAL_CALL getAccessibleName( ) override;
116 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
117 virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override;
118 virtual css::lang::Locale SAL_CALL getLocale( ) override;
120 // XAccessibleComponent
121 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
122 virtual void SAL_CALL grabFocus( ) override;
123 virtual sal_Int32 SAL_CALL getForeground( ) override;
124 virtual sal_Int32 SAL_CALL getBackground( ) override;
126 // XAccessibleExtendedComponent
127 virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override;
128 virtual OUString SAL_CALL getTitledBorderText( ) override;
129 virtual OUString SAL_CALL getToolTipText( ) override;
132 } // namespace basctl
134 #endif // INCLUDED_BASCTL_SOURCE_INC_ACCESSIBLEDIALOGCONTROLSHAPE_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */