1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/accessibility/AccessibleScrollType.hpp>
23 #include <com/sun/star/accessibility/XAccessible.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <comphelper/accessibletexthelper.hxx>
26 #include <cppuhelper/implbase.hxx>
27 #include <vcl/vclptr.hxx>
33 class VCLXAccessibleTabPage final
: public cppu::ImplInheritanceHelper
<
34 comphelper::OAccessibleTextHelper
,
35 css::accessibility::XAccessible
,
36 css::lang::XServiceInfo
>
38 friend class VCLXAccessibleTabControl
;
41 VclPtr
<TabControl
> m_pTabControl
;
47 sal_Int64
implGetAccessibleChildCount();
49 bool IsFocused() const;
50 bool IsSelected() const;
52 void SetFocused( bool bFocused
);
53 void SetSelected( bool bSelected
);
54 void SetPageText( const OUString
& sPageText
);
55 OUString
GetPageText();
57 void Update( bool bNew
);
59 sal_uInt16
GetPageId() const { return m_nPageId
; }
61 void FillAccessibleStateSet( sal_Int64
& rStateSet
);
63 // OCommonAccessibleComponent
64 virtual css::awt::Rectangle
implGetBounds( ) override
;
66 // OCommonAccessibleText
67 virtual OUString
implGetText() override
;
68 virtual css::lang::Locale
implGetLocale() override
;
69 virtual void implGetSelection( sal_Int32
& nStartIndex
, sal_Int32
& nEndIndex
) override
;
72 virtual void SAL_CALL
disposing() override
;
75 VCLXAccessibleTabPage( TabControl
* pTabControl
, sal_uInt16 nPageId
);
76 virtual ~VCLXAccessibleTabPage() override
;
79 virtual OUString SAL_CALL
getImplementationName() override
;
80 virtual sal_Bool SAL_CALL
supportsService( const OUString
& rServiceName
) override
;
81 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
84 virtual css::uno::Reference
< css::accessibility::XAccessibleContext
> SAL_CALL
getAccessibleContext( ) override
;
87 virtual sal_Int64 SAL_CALL
getAccessibleChildCount( ) override
;
88 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
getAccessibleChild( sal_Int64 i
) override
;
89 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
getAccessibleParent( ) override
;
90 virtual sal_Int64 SAL_CALL
getAccessibleIndexInParent( ) override
;
91 virtual sal_Int16 SAL_CALL
getAccessibleRole( ) override
;
92 virtual OUString SAL_CALL
getAccessibleDescription( ) override
;
93 virtual OUString SAL_CALL
getAccessibleName( ) override
;
94 virtual css::uno::Reference
< css::accessibility::XAccessibleRelationSet
> SAL_CALL
getAccessibleRelationSet( ) override
;
95 virtual sal_Int64 SAL_CALL
getAccessibleStateSet( ) override
;
96 virtual css::lang::Locale SAL_CALL
getLocale( ) override
;
98 // XAccessibleComponent
99 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
getAccessibleAtPoint( const css::awt::Point
& aPoint
) override
;
100 virtual void SAL_CALL
grabFocus( ) override
;
101 virtual sal_Int32 SAL_CALL
getForeground( ) override
;
102 virtual sal_Int32 SAL_CALL
getBackground( ) override
;
104 // XAccessibleExtendedComponent
105 virtual OUString SAL_CALL
getTitledBorderText( ) override
;
106 virtual OUString SAL_CALL
getToolTipText( ) override
;
109 virtual OUString SAL_CALL
getText() override
;
110 virtual sal_Unicode SAL_CALL
getCharacter( sal_Int32 nIndex
) override
;
111 virtual sal_Int32 SAL_CALL
getCharacterCount() override
;
112 virtual sal_Int32 SAL_CALL
getCaretPosition() override
;
113 virtual sal_Bool SAL_CALL
setCaretPosition( sal_Int32 nIndex
) override
;
114 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getCharacterAttributes( sal_Int32 nIndex
, const css::uno::Sequence
< OUString
>& aRequestedAttributes
) override
;
115 virtual css::awt::Rectangle SAL_CALL
getCharacterBounds( sal_Int32 nIndex
) override
;
116 virtual sal_Int32 SAL_CALL
getIndexAtPoint( const css::awt::Point
& aPoint
) override
;
117 virtual sal_Bool SAL_CALL
setSelection( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
118 virtual sal_Bool SAL_CALL
copyText( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
119 virtual OUString SAL_CALL
getTextRange(sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
120 virtual sal_Bool SAL_CALL
scrollSubstringTo( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
, css::accessibility::AccessibleScrollType aScrollType
) override
;
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */