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 : #ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX
20 : #define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX
21 :
22 : #include <com/sun/star/accessibility/XAccessible.hpp>
23 : #include <com/sun/star/accessibility/XAccessibleAction.hpp>
24 : #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
25 : #include <com/sun/star/accessibility/XAccessibleContext.hpp>
26 : #include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
27 : #include <com/sun/star/accessibility/XAccessibleText.hpp>
28 : #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
29 : #include <com/sun/star/accessibility/XAccessibleValue.hpp>
30 : #include <com/sun/star/lang/XServiceInfo.hpp>
31 : #include <cppuhelper/implbase4.hxx>
32 : #include <comphelper/accessibletexthelper.hxx>
33 :
34 : class ToolBox;
35 :
36 : typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE;
37 : typedef ::cppu::ImplHelper4 < ::com::sun::star::accessibility::XAccessible,
38 : ::com::sun::star::accessibility::XAccessibleAction,
39 : ::com::sun::star::accessibility::XAccessibleValue,
40 : ::com::sun::star::lang::XServiceInfo > VCLXAccessibleToolBoxItem_BASE;
41 :
42 : class VCLExternalSolarLock;
43 :
44 : class VCLXAccessibleToolBoxItem : public AccessibleTextHelper_BASE,
45 : public VCLXAccessibleToolBoxItem_BASE
46 : {
47 : private:
48 : OUString m_sOldName;
49 : ToolBox* m_pToolBox;
50 : VCLExternalSolarLock* m_pExternalLock;
51 : sal_Int32 m_nIndexInParent;
52 : sal_Int16 m_nRole;
53 : sal_uInt16 m_nItemId;
54 : sal_Bool m_bHasFocus;
55 : sal_Bool m_bIsChecked;
56 : bool m_bIndeterminate;
57 :
58 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xChild;
59 :
60 : public:
61 0 : inline sal_Int32 getIndexInParent() const { return m_nIndexInParent; }
62 0 : inline void setIndexInParent( sal_Int32 _nNewIndex ) { m_nIndexInParent = _nNewIndex; }
63 :
64 : protected:
65 : virtual ~VCLXAccessibleToolBoxItem();
66 :
67 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
68 :
69 : /// implements the calculation of the bounding rectangle
70 : virtual ::com::sun::star::awt::Rectangle implGetBounds( ) throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
71 :
72 : // OCommonAccessibleText
73 : virtual OUString implGetText() SAL_OVERRIDE;
74 : virtual ::com::sun::star::lang::Locale implGetLocale() SAL_OVERRIDE;
75 : virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) SAL_OVERRIDE;
76 :
77 : OUString GetText( bool _bAsName );
78 :
79 : public:
80 : VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_Int32 _nPos );
81 :
82 : void SetFocus( sal_Bool _bFocus );
83 0 : inline sal_Bool HasFocus() const { return m_bHasFocus; }
84 : void SetChecked( sal_Bool _bCheck );
85 : inline sal_Bool IsChecked() const { return m_bIsChecked; }
86 : void SetIndeterminate( bool _bIndeterminate );
87 : inline bool IsIndeterminate() const { return m_bIndeterminate; }
88 0 : inline void ReleaseToolBox() { m_pToolBox = NULL; }
89 : void NameChanged();
90 : void SetChild( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xChild );
91 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
92 0 : GetChild() const { return m_xChild; }
93 : void NotifyChildEvent( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xChild, bool _bShow );
94 :
95 : void ToggleEnableState();
96 :
97 : // XInterface
98 : DECLARE_XINTERFACE( )
99 : DECLARE_XTYPEPROVIDER( )
100 :
101 : // XServiceInfo
102 : virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 : virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 :
106 : // XAccessible
107 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 :
109 : // XAccessibleContext
110 : virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 : 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;
112 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 : virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 : virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
115 : virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
117 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 :
120 : // XAccessibleText
121 : virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 : virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
123 : 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, std::exception) SAL_OVERRIDE;
124 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 : virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 : virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 : virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 :
129 : // XAccessibleComponent
130 : 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;
131 : virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
132 : virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 : virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 :
135 : // XAccessibleExtendedComponent
136 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
137 : virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontMetrics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& xFont ) throw (::com::sun::star::uno::RuntimeException);
138 : virtual OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
139 : virtual OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
140 :
141 : // XAccessibleAction
142 : virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
143 : virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
144 : virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
146 :
147 : // XAccessibleValue
148 : virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
149 : virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 : virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
151 : virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
152 : };
153 :
154 : #endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX
155 :
156 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|