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 10*a462bbb7SAndrew Rist * 11*a462bbb7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*a462bbb7SAndrew Rist * 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. 19*a462bbb7SAndrew Rist * 20*a462bbb7SAndrew Rist *************************************************************/ 21*a462bbb7SAndrew Rist 22*a462bbb7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX 25cdf0e10cSrcweir #define ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp> 28cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 29cdf0e10cSrcweir #include <comphelper/accessibletexthelper.hxx> 30cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE2_HXX 31cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir 35cdf0e10cSrcweir class StatusBar; 36cdf0e10cSrcweir class VCLExternalSolarLock; 37cdf0e10cSrcweir 38cdf0e10cSrcweir namespace utl { 39cdf0e10cSrcweir class AccessibleStateSetHelper; 40cdf0e10cSrcweir } 41cdf0e10cSrcweir 42cdf0e10cSrcweir 43cdf0e10cSrcweir // ---------------------------------------------------- 44cdf0e10cSrcweir // class VCLXAccessibleStatusBarItem 45cdf0e10cSrcweir // ---------------------------------------------------- 46cdf0e10cSrcweir 47cdf0e10cSrcweir typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; 48cdf0e10cSrcweir 49cdf0e10cSrcweir typedef ::cppu::ImplHelper2< 50cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible, 51cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo > VCLXAccessibleStatusBarItem_BASE; 52cdf0e10cSrcweir 53cdf0e10cSrcweir class VCLXAccessibleStatusBarItem : public AccessibleTextHelper_BASE, 54cdf0e10cSrcweir public VCLXAccessibleStatusBarItem_BASE 55cdf0e10cSrcweir { 56cdf0e10cSrcweir friend class VCLXAccessibleStatusBar; 57cdf0e10cSrcweir 58cdf0e10cSrcweir private: 59cdf0e10cSrcweir VCLExternalSolarLock* m_pExternalLock; 60cdf0e10cSrcweir StatusBar* m_pStatusBar; 61cdf0e10cSrcweir sal_uInt16 m_nItemId; 62cdf0e10cSrcweir ::rtl::OUString m_sItemName; 63cdf0e10cSrcweir ::rtl::OUString m_sItemText; 64cdf0e10cSrcweir sal_Bool m_bShowing; 65cdf0e10cSrcweir 66cdf0e10cSrcweir protected: 67cdf0e10cSrcweir sal_Bool IsShowing(); 68cdf0e10cSrcweir void SetShowing( sal_Bool bShowing ); 69cdf0e10cSrcweir void SetItemName( const ::rtl::OUString& sItemName ); 70cdf0e10cSrcweir ::rtl::OUString GetItemName(); 71cdf0e10cSrcweir void SetItemText( const ::rtl::OUString& sItemText ); 72cdf0e10cSrcweir ::rtl::OUString GetItemText(); GetItemId() const73cdf0e10cSrcweir sal_uInt16 GetItemId() const { return m_nItemId; } 74cdf0e10cSrcweir 75cdf0e10cSrcweir virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); 76cdf0e10cSrcweir 77cdf0e10cSrcweir // OCommonAccessibleComponent 78cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); 79cdf0e10cSrcweir 80cdf0e10cSrcweir // OCommonAccessibleText 81cdf0e10cSrcweir virtual ::rtl::OUString implGetText(); 82cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale implGetLocale(); 83cdf0e10cSrcweir virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); 84cdf0e10cSrcweir 85cdf0e10cSrcweir // XComponent 86cdf0e10cSrcweir virtual void SAL_CALL disposing(); 87cdf0e10cSrcweir 88cdf0e10cSrcweir public: 89cdf0e10cSrcweir VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, sal_uInt16 nItemId ); 90cdf0e10cSrcweir virtual ~VCLXAccessibleStatusBarItem(); 91cdf0e10cSrcweir 92cdf0e10cSrcweir // XInterface 93cdf0e10cSrcweir DECLARE_XINTERFACE() 94cdf0e10cSrcweir 95cdf0e10cSrcweir // XTypeProvider 96cdf0e10cSrcweir DECLARE_XTYPEPROVIDER() 97cdf0e10cSrcweir 98cdf0e10cSrcweir // XServiceInfo 99cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); 100cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); 102cdf0e10cSrcweir 103cdf0e10cSrcweir // XAccessible 104cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir 106cdf0e10cSrcweir // XAccessibleContext 107cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir 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); 109cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); 110cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); 111cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); 112cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); 114cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); 115cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); 116cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); 117cdf0e10cSrcweir 118cdf0e10cSrcweir // XAccessibleComponent 119cdf0e10cSrcweir 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); 120cdf0e10cSrcweir virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); 121cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); 122cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); 123cdf0e10cSrcweir 124cdf0e10cSrcweir // XAccessibleExtendedComponent 125cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); 126cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); 127cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); 128cdf0e10cSrcweir 129cdf0e10cSrcweir // XAccessibleText 130cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); 131cdf0e10cSrcweir virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 132cdf0e10cSrcweir 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); 133cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 134cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 135cdf0e10cSrcweir virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 136cdf0e10cSrcweir virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 137cdf0e10cSrcweir }; 138cdf0e10cSrcweir 139cdf0e10cSrcweir #endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX 140cdf0e10cSrcweir 141