Line data Source code
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 ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX
21 : #define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX
22 :
23 : #include <com/sun/star/accessibility/XAccessible.hpp>
24 : #include <com/sun/star/lang/XServiceInfo.hpp>
25 : #include <comphelper/accessibletexthelper.hxx>
26 : #include <cppuhelper/implbase2.hxx>
27 :
28 :
29 : class TabControl;
30 : class VCLExternalSolarLock;
31 :
32 : namespace utl {
33 : class AccessibleStateSetHelper;
34 : }
35 :
36 :
37 : // ----------------------------------------------------
38 : // class VCLXAccessibleTabPage
39 : // ----------------------------------------------------
40 :
41 : typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE;
42 :
43 : typedef ::cppu::ImplHelper2<
44 : ::com::sun::star::accessibility::XAccessible,
45 : ::com::sun::star::lang::XServiceInfo > VCLXAccessibleTabPage_BASE;
46 :
47 : class VCLXAccessibleTabPage : public AccessibleTextHelper_BASE,
48 : public VCLXAccessibleTabPage_BASE
49 : {
50 : friend class VCLXAccessibleTabControl;
51 :
52 : private:
53 : VCLExternalSolarLock* m_pExternalLock;
54 : TabControl* m_pTabControl;
55 : sal_uInt16 m_nPageId;
56 : bool m_bFocused;
57 : bool m_bSelected;
58 : OUString m_sPageText;
59 :
60 : protected:
61 : bool IsFocused();
62 : bool IsSelected();
63 :
64 : void SetFocused( bool bFocused );
65 : void SetSelected( bool bSelected );
66 : void SetPageText( const OUString& sPageText );
67 : OUString GetPageText();
68 :
69 : void Update( bool bNew );
70 :
71 0 : sal_uInt16 GetPageId() const { return m_nPageId; }
72 :
73 : virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
74 :
75 : // OCommonAccessibleComponent
76 : virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException);
77 :
78 : // OCommonAccessibleText
79 : virtual OUString implGetText();
80 : virtual ::com::sun::star::lang::Locale implGetLocale();
81 : virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex );
82 :
83 : // XComponent
84 : virtual void SAL_CALL disposing();
85 :
86 : public:
87 : VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId );
88 : virtual ~VCLXAccessibleTabPage();
89 :
90 : // XInterface
91 : DECLARE_XINTERFACE()
92 :
93 : // XTypeProvider
94 : DECLARE_XTYPEPROVIDER()
95 :
96 : // XServiceInfo
97 : virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
98 : virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
99 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
100 :
101 : // XAccessible
102 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
103 :
104 : // XAccessibleContext
105 : virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
106 : 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);
107 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException);
108 : virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException);
109 : virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException);
110 : virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException);
111 : virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
112 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
113 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException);
114 : virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
115 :
116 : // XAccessibleComponent
117 : 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);
118 : virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
119 : virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
120 : virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
121 :
122 : // XAccessibleExtendedComponent
123 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException);
124 : virtual OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException);
125 : virtual OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException);
126 :
127 : // XAccessibleText
128 : virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
129 : virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
130 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
131 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
132 : virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
133 : virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
134 : virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
135 : };
136 :
137 : #endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX
138 :
139 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|