xref: /trunk/main/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*a462bbb7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*a462bbb7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a462bbb7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a462bbb7SAndrew Rist  * distributed with this work for additional information
6*a462bbb7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a462bbb7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a462bbb7SAndrew Rist  * "License"); you may not use this file except in compliance
9*a462bbb7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*a462bbb7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*a462bbb7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a462bbb7SAndrew Rist  * software distributed under the License is distributed on an
15*a462bbb7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a462bbb7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*a462bbb7SAndrew Rist  * specific language governing permissions and limitations
18*a462bbb7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*a462bbb7SAndrew Rist  *************************************************************/
21*a462bbb7SAndrew Rist 
22*a462bbb7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef ACCESSIBILITY_EXT_ACCESSIBLEICONCHOICECTRLENTRY_HXX_
25cdf0e10cSrcweir #define ACCESSIBILITY_EXT_ACCESSIBLEICONCHOICECTRLENTRY_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <deque>
28cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp>
29cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
30cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleContext.hpp>
31cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
32cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
33cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleAction.hpp>
34cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
35cdf0e10cSrcweir #include <com/sun/star/lang/DisposedException.hpp>
36cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
38cdf0e10cSrcweir #include <cppuhelper/compbase8.hxx>
39cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx>
40cdf0e10cSrcweir #include <comphelper/accessibletexthelper.hxx>
41cdf0e10cSrcweir #include <tools/gen.hxx>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir // forward ---------------------------------------------------------------
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class SvxIconChoiceCtrlEntry;
46cdf0e10cSrcweir class SvtIconChoiceCtrl;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir //........................................................................
49cdf0e10cSrcweir namespace accessibility
50cdf0e10cSrcweir {
51cdf0e10cSrcweir //........................................................................
52cdf0e10cSrcweir 
53cdf0e10cSrcweir // class AccessibleIconChoiceCtrlEntry ------------------------------------------
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     typedef ::cppu::WeakAggComponentImplHelper8< ::com::sun::star::accessibility::XAccessible
56cdf0e10cSrcweir                                                 , ::com::sun::star::accessibility::XAccessibleContext
57cdf0e10cSrcweir                                                 , ::com::sun::star::accessibility::XAccessibleComponent
58cdf0e10cSrcweir                                                 , ::com::sun::star::accessibility::XAccessibleEventBroadcaster
59cdf0e10cSrcweir                                                 , ::com::sun::star::accessibility::XAccessibleText
60cdf0e10cSrcweir                                                 , ::com::sun::star::accessibility::XAccessibleAction
61cdf0e10cSrcweir                                                 , ::com::sun::star::lang::XServiceInfo
62cdf0e10cSrcweir                                                 , ::com::sun::star::lang::XEventListener > AccessibleIconChoiceCtrlEntry_BASE;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     /** the class AccessibleListBoxEntry represents the class for an accessible object of a listbox entry */
65cdf0e10cSrcweir     class AccessibleIconChoiceCtrlEntry :   public ::comphelper::OBaseMutex,
66cdf0e10cSrcweir                                     public AccessibleIconChoiceCtrlEntry_BASE,
67cdf0e10cSrcweir                                     public ::comphelper::OCommonAccessibleText
68cdf0e10cSrcweir     {
69cdf0e10cSrcweir     private:
70cdf0e10cSrcweir         /** The treelistbox control */
71cdf0e10cSrcweir         SvtIconChoiceCtrl*                  m_pIconCtrl;
72cdf0e10cSrcweir         sal_Int32                           m_nIndex;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     protected:
75cdf0e10cSrcweir         /// client id in the AccessibleEventNotifier queue
76cdf0e10cSrcweir         sal_uInt32                          m_nClientId;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xParent;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     private:
81cdf0e10cSrcweir     #ifdef ACCESSIBLE_EVENT_NOTIFICATION_ENABLED
82cdf0e10cSrcweir     // (the following method is unused currently. If you need it, simply remove the #ifdef thing here and
83cdf0e10cSrcweir     // in the cxx)
84cdf0e10cSrcweir         /** notifies all listeners that this object has changed
85cdf0e10cSrcweir             @param  _nEventId
86cdf0e10cSrcweir                 is the event id
87cdf0e10cSrcweir             @param  _aOldValue
88cdf0e10cSrcweir                 is the old value
89cdf0e10cSrcweir             @param  _aNewValue
90cdf0e10cSrcweir                 is the new value
91cdf0e10cSrcweir         */
92cdf0e10cSrcweir         void    NotifyAccessibleEvent( sal_Int16 _nEventId,
93cdf0e10cSrcweir                                     const ::com::sun::star::uno::Any& _aOldValue,
94cdf0e10cSrcweir                                     const ::com::sun::star::uno::Any& _aNewValue );
95cdf0e10cSrcweir     #endif
96cdf0e10cSrcweir 
97cdf0e10cSrcweir         Rectangle               GetBoundingBox_Impl() const;
98cdf0e10cSrcweir         Rectangle               GetBoundingBoxOnScreen_Impl() const;
99cdf0e10cSrcweir         sal_Bool                IsAlive_Impl() const;
100cdf0e10cSrcweir         sal_Bool                IsShowing_Impl() const;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir         Rectangle               GetBoundingBox() throw ( ::com::sun::star::lang::DisposedException );
103cdf0e10cSrcweir         Rectangle               GetBoundingBoxOnScreen() throw ( ::com::sun::star::lang::DisposedException );
104cdf0e10cSrcweir         void                    EnsureIsAlive() const throw ( ::com::sun::star::lang::DisposedException );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     protected:
107cdf0e10cSrcweir         virtual ~AccessibleIconChoiceCtrlEntry();
108cdf0e10cSrcweir         /** this function is called upon disposing the component
109cdf0e10cSrcweir         */
110cdf0e10cSrcweir         virtual void SAL_CALL                   disposing();
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         // OCommonAccessibleText
113cdf0e10cSrcweir         virtual ::rtl::OUString                 implGetText();
114cdf0e10cSrcweir         virtual ::com::sun::star::lang::Locale  implGetLocale();
115cdf0e10cSrcweir         virtual void                            implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     public:
118cdf0e10cSrcweir         /** Ctor()
119cdf0e10cSrcweir             @param  _rListBox
120cdf0e10cSrcweir                 the view control
121cdf0e10cSrcweir             @param  _pEntry
122cdf0e10cSrcweir                 the entry
123cdf0e10cSrcweir             @param  _xParent
124cdf0e10cSrcweir                 is our parent accessible object
125cdf0e10cSrcweir         */
126cdf0e10cSrcweir         AccessibleIconChoiceCtrlEntry( SvtIconChoiceCtrl& _rIconCtrl,
127cdf0e10cSrcweir                                        sal_uLong _nPos,
128cdf0e10cSrcweir                                        const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent );
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         // XTypeProvider
131cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
132cdf0e10cSrcweir 
133cdf0e10cSrcweir         // XServiceInfo
134cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
135cdf0e10cSrcweir         virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
136cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException);
137cdf0e10cSrcweir 
138cdf0e10cSrcweir         // XServiceInfo - static methods
139cdf0e10cSrcweir         static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw(com::sun::star::uno::RuntimeException);
140cdf0e10cSrcweir         static ::rtl::OUString getImplementationName_Static(void) throw(com::sun::star::uno::RuntimeException);
141cdf0e10cSrcweir 
142cdf0e10cSrcweir         // XEventListener
143cdf0e10cSrcweir         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
144cdf0e10cSrcweir 
145cdf0e10cSrcweir         // XAccessible
146cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
147cdf0e10cSrcweir 
148cdf0e10cSrcweir         // XAccessibleContext
149cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
150cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
151cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
152cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
153cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
154cdf0e10cSrcweir         virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
155cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
156cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
157cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
158cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
159cdf0e10cSrcweir         virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
160cdf0e10cSrcweir 
161cdf0e10cSrcweir         // XAccessibleComponent
162cdf0e10cSrcweir         virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
163cdf0e10cSrcweir         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);
164cdf0e10cSrcweir         virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(  ) throw (::com::sun::star::uno::RuntimeException);
165cdf0e10cSrcweir         virtual ::com::sun::star::awt::Point SAL_CALL getLocation(  ) throw (::com::sun::star::uno::RuntimeException);
166cdf0e10cSrcweir         virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(  ) throw (::com::sun::star::uno::RuntimeException);
167cdf0e10cSrcweir         virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw (::com::sun::star::uno::RuntimeException);
168cdf0e10cSrcweir         virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
169cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
170cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
171cdf0e10cSrcweir 
172cdf0e10cSrcweir         // XAccessibleText
173cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
174cdf0e10cSrcweir         virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
175cdf0e10cSrcweir         virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
176cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
177cdf0e10cSrcweir         virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
178cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
179cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
180cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
181cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
182cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
183cdf0e10cSrcweir         virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
184cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
185cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
186cdf0e10cSrcweir         virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
187cdf0e10cSrcweir         virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
188cdf0e10cSrcweir         virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
189cdf0e10cSrcweir         virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
190cdf0e10cSrcweir 
191cdf0e10cSrcweir         // XAccessibleEventBroadcaster
192cdf0e10cSrcweir         using cppu::WeakAggComponentImplHelperBase::addEventListener;
193cdf0e10cSrcweir         virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
194cdf0e10cSrcweir         using cppu::WeakAggComponentImplHelperBase::removeEventListener;
195cdf0e10cSrcweir         virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
196cdf0e10cSrcweir 
197cdf0e10cSrcweir         // XAccessibleAction
198cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getAccessibleActionCount(  ) throw (::com::sun::star::uno::RuntimeException);
199cdf0e10cSrcweir         virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
200cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
201cdf0e10cSrcweir         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);
202cdf0e10cSrcweir     };
203cdf0e10cSrcweir 
204cdf0e10cSrcweir //........................................................................
205cdf0e10cSrcweir }// namespace accessibility
206cdf0e10cSrcweir //........................................................................
207cdf0e10cSrcweir 
208cdf0e10cSrcweir #endif // ACCESSIBILITY_EXT_ACCESSIBLELISTBOXENTRY_HXX_
209