diff options
Diffstat (limited to 'accessibility/inc/accessibility/standard')
32 files changed, 3457 insertions, 0 deletions
diff --git a/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx new file mode 100644 index 000000000000..19a3616f128e --- /dev/null +++ b/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: accessiblemenubasecomponent.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX +#define ACCESSIBILITY_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX + +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/awt/Point.hpp> +#include <comphelper/accessiblecomponenthelper.hxx> +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif +#include <tools/link.hxx> + +#include <vector> + +class Menu; +class VclSimpleEvent; +class VclMenuEvent; +class VCLExternalSolarLock; + +namespace utl { +class AccessibleStateSetHelper; +} + +// ---------------------------------------------------- +// class OAccessibleMenuBaseComponent +// ---------------------------------------------------- + +typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleExtendedComponentHelper_BASE; + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::lang::XServiceInfo > OAccessibleMenuBaseComponent_BASE; + +class OAccessibleMenuBaseComponent : public AccessibleExtendedComponentHelper_BASE, + public OAccessibleMenuBaseComponent_BASE +{ + friend class OAccessibleMenuItemComponent; + friend class VCLXAccessibleMenuItem; + friend class VCLXAccessibleMenu; + +private: + VCLExternalSolarLock* m_pExternalLock; + +protected: + typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + Menu* m_pMenu; + + sal_Bool m_bEnabled; + sal_Bool m_bFocused; + sal_Bool m_bVisible; + sal_Bool m_bSelected; + sal_Bool m_bChecked; + + Menu* GetMenu() { return m_pMenu; } + + virtual sal_Bool IsEnabled(); + virtual sal_Bool IsFocused(); + virtual sal_Bool IsVisible(); + virtual sal_Bool IsSelected(); + virtual sal_Bool IsChecked(); + + void SetEnabled( sal_Bool bEnabled ); + void SetFocused( sal_Bool bFocused ); + void SetVisible( sal_Bool bVisible ); + void SetSelected( sal_Bool bSelected ); + void SetChecked( sal_Bool bChecked ); + + void UpdateEnabled( sal_Int32 i, sal_Bool bEnabled ); + void UpdateFocused( sal_Int32 i, sal_Bool bFocused ); + void UpdateVisible(); + void UpdateSelected( sal_Int32 i, sal_Bool bSelected ); + void UpdateChecked( sal_Int32 i, sal_Bool bChecked ); + void UpdateAccessibleName( sal_Int32 i ); + void UpdateItemText( sal_Int32 i ); + + sal_Int32 GetChildCount(); + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChild( sal_Int32 i ); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAt( const ::com::sun::star::awt::Point& rPoint ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + + virtual sal_Bool IsHighlighted(); + sal_Bool IsChildHighlighted(); + + void SelectChild( sal_Int32 i ); + void DeSelectAll(); + sal_Bool IsChildSelected( sal_Int32 i ); + + virtual void Select(); + virtual void DeSelect(); + virtual void Click(); + virtual sal_Bool IsPopupMenuOpen(); + + DECL_LINK( MenuEventListener, VclSimpleEvent* ); + + virtual void ProcessMenuEvent( const VclMenuEvent& rVclMenuEvent ); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) = 0; + + // XComponent + virtual void SAL_CALL disposing(); + +public: + OAccessibleMenuBaseComponent( Menu* pMenu ); + virtual ~OAccessibleMenuBaseComponent(); + + void SetStates(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX + diff --git a/accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx new file mode 100644 index 000000000000..89b95b60cb8e --- /dev/null +++ b/accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: accessiblemenucomponent.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX +#define ACCESSIBILITY_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX + +#include <accessibility/standard/accessiblemenubasecomponent.hxx> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif + + +// ---------------------------------------------------- +// class OAccessibleMenuComponent +// ---------------------------------------------------- + +typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleExtendedComponentHelper_BASE; + +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleSelection > OAccessibleMenuComponent_BASE; + +class OAccessibleMenuComponent : public OAccessibleMenuBaseComponent, + public OAccessibleMenuComponent_BASE +{ +protected: + virtual sal_Bool IsEnabled(); + virtual sal_Bool IsVisible(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + +public: + OAccessibleMenuComponent( Menu* pMenu ); + virtual ~OAccessibleMenuComponent(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + 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); + virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX + diff --git a/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx new file mode 100644 index 000000000000..d83be52340f5 --- /dev/null +++ b/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: accessiblemenuitemcomponent.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX +#define ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX + +#include <accessibility/standard/accessiblemenubasecomponent.hxx> + + +// ---------------------------------------------------- +// class OAccessibleMenuItemComponent +// ---------------------------------------------------- + +class OAccessibleMenuItemComponent : public OAccessibleMenuBaseComponent +{ + friend class OAccessibleMenuBaseComponent; + +protected: + Menu* m_pParent; + sal_uInt16 m_nItemPos; + ::rtl::OUString m_sAccessibleName; + ::rtl::OUString m_sItemText; + + virtual sal_Bool IsEnabled(); + virtual sal_Bool IsVisible(); + virtual void Select(); + virtual void DeSelect(); + virtual void Click(); + + void SetItemPos( sal_uInt16 nItemPos ); + void SetAccessibleName( const ::rtl::OUString& sAccessibleName ); + ::rtl::OUString GetAccessibleName(); + void SetItemText( const ::rtl::OUString& sItemText ); + ::rtl::OUString GetItemText(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + OAccessibleMenuItemComponent( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu ); + virtual ~OAccessibleMenuItemComponent(); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + 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); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx new file mode 100644 index 000000000000..43ce408757dc --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx @@ -0,0 +1,187 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblebox.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBOX_HXX + +#include <map> +#include <accessibility/standard/vclxaccessibleedit.hxx> +#ifndef _COM_SUN_STAR_ACCESSIBILITY_STANDARD_ACCESSIBLEROLE_HPP_ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp> +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::accessibility::XAccessibleAction + > VCLXAccessibleBox_BASE; + + +/** Base class for list- and combo boxes. This class manages the box' + children. The classed derived from this one have only to implement the + <member>IsValid</member> method and return the corrent implementation name. +*/ +class VCLXAccessibleBox + : public VCLXAccessibleComponent, + public VCLXAccessibleBox_BASE +{ +public: + enum BoxType {COMBOBOX, LISTBOX}; + + /** The constructor is initialized with the box type whitch may be + either <const>COMBOBOX</const> or <const>LISTBOX</const> and a flag + indicating whether the box is a drop down box. + */ + VCLXAccessibleBox (VCLXWindow* pVCLXindow, BoxType aType, bool bIsDropDownBox); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XInterface + DECLARE_XINTERFACE() + + + + // XAccessible + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + + /** Each object has one or two children: an optional text field and the + actual list. The text field is not provided for non drop down list + boxes. + */ + sal_Int32 SAL_CALL getAccessibleChildCount (void) + throw (::com::sun::star::uno::RuntimeException); + /** For drop down list boxes the text field is a not editable + <type>VCLXAccessibleTextField</type>, for combo boxes it is an + editable <type>VLCAccessibleEdit</type>. + */ + ::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); + /** The role is always <const + scope="com::sun::star::accessibility">AccessibleRole::COMBO_BOX</const>. + */ + sal_Int16 SAL_CALL getAccessibleRole (void) + throw (::com::sun::star::uno::RuntimeException); + + sal_Int32 SAL_CALL getAccessibleIndexInParent (void) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + + /** There is one action for drop down boxes and none for others. + */ + virtual sal_Int32 SAL_CALL getAccessibleActionCount (void) + throw (::com::sun::star::uno::RuntimeException); + /** The action for drop down boxes lets the user toggle the visibility of the + popup menu. + */ + virtual sal_Bool SAL_CALL doAccessibleAction (sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + /** The returned string is assoicated with resource + <const>RID_STR_ACC_ACTION_TOGGLEPOPUP</const>. + */ + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription (sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + /** No keybinding returned so far. + */ + 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); + + // XComponent + + /** This method is called from the implementation helper during an + XComponent::dispose() call. + */ + virtual void SAL_CALL disposing (void); + + +protected: + /** Specifies whether the box is a combo box or a list box. List boxes + have multi selection. + */ + BoxType m_aBoxType; + + /// Specifies whether the box is a drop down box and thus has an action. + bool m_bIsDropDownBox; + + /// The child that represents the text field if there is one. + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> + m_xText; + + /// The child that contains the items of this box. + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> + m_xList; + + /** This flag specifies whether an object has a text field as child + regardless of whether that child being currently instantiated or + not. + */ + bool m_bHasTextChild; + + /** This flag specifies whether an object has a list as child regardless + of whether that child being currently instantiated or not. This + flag is always true in the current implementation because the list + child is just another wrapper arround this object and thus has the + same life time. + */ + bool m_bHasListChild; + + virtual ~VCLXAccessibleBox (void); + + /** Returns </true> when the object is valid. + */ + virtual bool IsValid (void) const = 0; + + virtual void ProcessWindowChildEvent (const VclWindowEvent& rVclWindowEvent); + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); + + +private: + /// Index in parent. This is settable from the outside. + sal_Int32 m_nIndexInParent; +}; + +#endif + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx new file mode 100644 index 000000000000..eab14ca012b2 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblebutton.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBUTTON_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBUTTON_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleValue.hpp> + +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +// ---------------------------------------------------- +// class VCLXAccessibleButton +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleValue > VCLXAccessibleButton_BASE; + +class VCLXAccessibleButton : public VCLXAccessibleTextComponent, + public VCLXAccessibleButton_BASE +{ +protected: + virtual ~VCLXAccessibleButton(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + +public: + VCLXAccessibleButton( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleValue + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBUTTON_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx new file mode 100644 index 000000000000..16ace783423b --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblecheckbox.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleValue.hpp> + +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +// ---------------------------------------------------- +// class VCLXAccessibleCheckBox +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleValue > VCLXAccessibleCheckBox_BASE; + +class VCLXAccessibleCheckBox : public VCLXAccessibleTextComponent, + public VCLXAccessibleCheckBox_BASE +{ +private: + bool m_bChecked; + bool m_bIndeterminate; + +protected: + virtual ~VCLXAccessibleCheckBox(); + + bool IsChecked(); + bool IsIndeterminate(); + + void SetChecked( bool bChecked ); + void SetIndeterminate( bool bIndeterminate ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + +public: + VCLXAccessibleCheckBox( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleValue + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx new file mode 100644 index 000000000000..5ac63cb09689 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblecombobox.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX + +#include <map> +#include <accessibility/standard/vclxaccessiblebox.hxx> +#ifndef _COM_SUN_STAR_ACCESSIBILITY_STANDARD_ACCESSIBLEROLE_HPP_ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#endif +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif + + +/** The accessible combobox has two children. The first is the text field + represented by an object of the <type>VCLXAccessibleEdit</type> class. + The second is the list containing all items and is represented by an + object of the <type>VCLXAccessibleList</type> class which does not + support selection at the moment. +*/ +class VCLXAccessibleComboBox + : public VCLXAccessibleBox +{ +public: + VCLXAccessibleComboBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return combo box specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual ~VCLXAccessibleComboBox (void); + + virtual bool IsValid (void) const; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx new file mode 100644 index 000000000000..a456a6d9eb20 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibledropdowncombobox.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX + +#include <accessibility/standard/vclxaccessiblebox.hxx> +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTEDIT_HXX +#include <accessibility/standard/vclxaccessibleedit.hxx> +#endif +#include <com/sun/star/accessibility/XAccessibleAction.hpp> + +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _CPPUHELPER_WEAKREF_HXX +#include <cppuhelper/weakref.hxx> +#endif + + +/** The accessible drop down combobox has two children. The first is the + text field represented by an object of the + <type>VCLXAccessibleEdit</type> class. The second is the list + containing all items and is represented by an object of the + <type>VCLXAccessibleList</type> class which does not support selection + at the moment. +*/ +class VCLXAccessibleDropDownComboBox : public VCLXAccessibleBox +{ +public: + VCLXAccessibleDropDownComboBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return drop down combo box specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual ~VCLXAccessibleDropDownComboBox (void); + + virtual bool IsValid (void) const; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx new file mode 100644 index 000000000000..41f0235734c4 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibledropdownlistbox.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX + +#include <accessibility/standard/vclxaccessiblebox.hxx> +#include <com/sun/star/accessibility/XAccessibleAction.hpp> + +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _CPPUHELPER_WEAKREF_HXX +#include <cppuhelper/weakref.hxx> +#endif + + +/** The accessible drop down combobox has two children. The first is the + text field represented by an object of the + <type>VCLXAccessibleTextField</type> class which can not be edited. The + second is the list containing all items and is represented by an object + of the <type>VCLXAccessibleListBoxList</type> class which does support + selection. +*/ +class VCLXAccessibleDropDownListBox : public VCLXAccessibleBox +{ +public: + VCLXAccessibleDropDownListBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return drop down list box specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual ~VCLXAccessibleDropDownListBox (void); + + virtual bool IsValid (void) const; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); + +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx b/accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx new file mode 100644 index 000000000000..0e3f1a929f8d --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibleedit.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEEDIT_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEEDIT_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> +#include <com/sun/star/accessibility/XAccessibleEditableText.hpp> +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif + +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +// ---------------------------------------------------- +// class VCLXAccessibleEdit +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleEditableText > VCLXAccessibleEdit_BASE; + +class VCLXAccessibleEdit : public VCLXAccessibleTextComponent, + public VCLXAccessibleEdit_BASE +{ + friend class VCLXAccessibleBox; + +private: + sal_Int32 m_nCaretPosition; + +protected: + virtual ~VCLXAccessibleEdit(); + + void UpdateCaretPosition(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + +public: + VCLXAccessibleEdit( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getSelectedText( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + 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); + 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); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleEditableText + virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL insertText( const ::rtl::OUString& sText, sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const ::rtl::OUString& sReplacement ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aAttributeSet ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setText( const ::rtl::OUString& sText ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEEDIT_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx new file mode 100644 index 000000000000..7cccf13ac248 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblefixedhyperlink.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> + +// ---------------------------------------------------- +// class VCLXAccessibleFixedHyperlink +// ---------------------------------------------------- + +class VCLXAccessibleFixedHyperlink : public VCLXAccessibleTextComponent +{ +protected: + virtual ~VCLXAccessibleFixedHyperlink(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + virtual void implGetLineBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex ); + +public: + VCLXAccessibleFixedHyperlink( VCLXWindow* pVCLXindow ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx new file mode 100644 index 000000000000..e902a037de12 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblefixedtext.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> + +// ---------------------------------------------------- +// class VCLXAccessibleFixedText +// ---------------------------------------------------- + +class VCLXAccessibleFixedText : public VCLXAccessibleTextComponent +{ +protected: + virtual ~VCLXAccessibleFixedText(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + virtual void implGetLineBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex ); + +public: + VCLXAccessibleFixedText( VCLXWindow* pVCLXindow ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx new file mode 100644 index 000000000000..f9451092a063 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx @@ -0,0 +1,231 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblelist.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLELIST_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLELIST_HXX + +#include <vector> +#include <functional> +#include "accessibility/standard/vclxaccessiblelistitem.hxx" +#include <accessibility/standard/vclxaccessibleedit.hxx> +#ifndef _COM_SUN_STAR_ACCESSIBILITY_STANDARD_ACCESSIBLEROLE_HPP_ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::accessibility::XAccessibleSelection + > VCLXAccessibleList_BASE; + +typedef std::vector< ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > > + ListItems; + +namespace accessibility +{ + class IComboListBoxHelper; +} + + +/** Base class for the list contained in list- and combo boxes. This class + does not support selection because lists of combo boxes give no direct + access to their underlying list implementation. Look into derived + classes for selection. +*/ +class VCLXAccessibleList + : public VCLXAccessibleComponent, + public VCLXAccessibleList_BASE +{ +public: + enum BoxType {COMBOBOX, LISTBOX}; + + VCLXAccessibleList (VCLXWindow* pVCLXindow, BoxType aBoxType, + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& _xParent); + + /** The index that is passed to this method is returned on following + calls to <member>getAccessibleIndexInParent</member>. + */ + void SetIndexInParent (sal_Int32 nIndex); + + /** Process some of the events and delegate the rest to the base classes. + */ + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); + + /** Called on reception of selection events this method checks all known + list items for a possible change in their selection state and + updates that accordingly. No accessibility events are send because + the XAccessibleSelection interface is not supported and the items + are transient. + @param sTextOfSelectedItem + This string contains the text of the the currently selected + item. It is used to retrieve the index of that item. + */ + void UpdateSelection (::rtl::OUString sTextOfSelectedItem); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL + getAccessibleContext (void) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount (void) + throw (::com::sun::star::uno::RuntimeException); + ::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); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleParent( ) + throw (::com::sun::star::uno::RuntimeException); + + /** The index returned as index in parent is always the one set with the + <member>SetIndexInParent()</member> method. + */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent (void) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole (void) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual sal_Bool SAL_CALL contains (const ::com::sun::star::awt::Point& aPoint) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleAt (const ::com::sun::star::awt::Point& aPoint) + throw (::com::sun::star::uno::RuntimeException); + + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return list specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); + +protected: + BoxType m_aBoxType; + ::accessibility::IComboListBoxHelper* m_pListBoxHelper; + ListItems m_aAccessibleChildren; + sal_Int32 m_nVisibleLineCount; + /// Index in parent. This is settable from the outside. + sal_Int32 m_nIndexInParent; + sal_Int32 m_nLastTopEntry; + USHORT m_nLastSelectedPos; + bool m_bDisableProcessEvent; + bool m_bVisible; + + + + /// The currently selected item. + ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible> + m_xSelectedItem; + + virtual ~VCLXAccessibleList (void); + + /** This function is called from the implementation helper during a + XComponent::dispose call. Free the list of items and the items themselves. + */ + virtual void SAL_CALL disposing (void); + + /** This method adds the states + <const>AccessibleStateType::FOCUSABLE</const> and possibly + <const>AccessibleStateType::MULTI_SELECTABLE</const> to the state set + of the base classes. + */ + virtual void FillAccessibleStateSet (utl::AccessibleStateSetHelper& rStateSet); + + /** Create the specified child and insert it into the list of children. + Sets the child's states. + */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + CreateChild (sal_Int32 i); + + /** Call this method when the item list has been changed, i.e. items + have been deleted or inserted. + @param bItemInserted + Indicate whether items have been inserted (<TRUE/>) or removed + (<FALSE/>). + @param nIndex + Index of the new or removed item. A value of -1 indicates that + the whole list has been cleared. + */ + virtual void HandleChangedItemList (bool bItemInserted, sal_Int32 nIndex); + + // VCLXAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + +private: + /** We need to save the accessible parent to return it in <type>getAccessibleParent()</type>, + because this method of the base class returns the wrong parent. + */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > m_xParent; + + + /** dispose all items aand clears the container + */ + void clearItems(); + + void adjustEntriesIndexInParent(ListItems::iterator& _aBegin,::std::mem_fun_t<bool,VCLXAccessibleListItem>& _rMemFun); + void UpdateEntryRange_Impl (void); +protected: + void UpdateSelection_Impl (USHORT nPos = 0); + BOOL checkEntrySelected(USHORT _nPos, + ::com::sun::star::uno::Any& _rNewValue, + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxNewAcc); +private: + void notifyVisibleStates(sal_Bool _bSetNew ); + void UpdateVisibleLineCount(); +}; + +#endif + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx new file mode 100644 index 000000000000..f776a1a3857c --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblelistbox.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX + +#include <accessibility/standard/vclxaccessiblebox.hxx> +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> + + +/** The accessible drop down combobox has one children. It is the list + containing all items and is represented by an object of the + <type>VCLXAccessibleListBoxList</type> class which does support + selection. +*/ +class VCLXAccessibleListBox : public VCLXAccessibleBox +{ +public: + VCLXAccessibleListBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return list box specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual ~VCLXAccessibleListBox (void); + + virtual bool IsValid (void) const; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx new file mode 100644 index 000000000000..a76f81aee221 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblelistboxlist.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOXLIST_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOXLIST_HXX + +#include <accessibility/standard/vclxaccessiblelist.hxx> +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#ifndef _COMPHELPER_BROADCASTHELPER_HXX +#include <comphelper/broadcasthelper.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX +#include <comphelper/uno3.hxx> +#endif +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif + +typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessibleSelection + > VCLXAccessibleListBoxList_BASE; + + +class ListBox; +/** This class extends the list of the <type>VCLXAccessibleList</type> class + about selection. +*/ +class VCLXAccessibleListBoxList : + public VCLXAccessibleList, + public VCLXAccessibleListBoxList_BASE +{ +public: + VCLXAccessibleListBoxList (VCLXWindow* pVCLXindow, BoxType aBoxType, + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& _xParent); + + // XInterface + DECLARE_XINTERFACE( ) + + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return list box list specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleSelection + void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + /** Create the specified child and insert it into the list of children. + Sets the child's states. + */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + CreateChild (sal_Int32 i); + + +protected: + virtual ~VCLXAccessibleListBoxList (void); + + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent); + +private: + sal_Int32 m_nLastTopEntry; + USHORT m_nLastSelectedPos; + bool m_bDisableProcessEvent; + + void UpdateEntryRange_Impl (void); + using VCLXAccessibleList::UpdateSelection_Impl; + void UpdateSelection_Impl (void); + using VCLXAccessibleList::checkEntrySelected; + BOOL checkEntrySelected(ListBox* _pListBox, + USHORT _nPos, + ::com::sun::star::uno::Any& _rNewValue, + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxNewAcc); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx new file mode 100644 index 000000000000..8711abc6b444 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx @@ -0,0 +1,203 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblelistitem.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTITEM_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTITEM_HXX + +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleComponent.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/accessibility/XAccessibleStateSet.hpp> +#include <com/sun/star/accessibility/XAccessibleText.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#ifndef _CPPUHELPER_COMPBASE6_HXX +#include <cppuhelper/compbase6.hxx> +#endif +#ifndef _COMPHELPER_BROADCASTHELPER_HXX +#include <comphelper/broadcasthelper.hxx> +#endif +#include <comphelper/accessibletexthelper.hxx> + +// forward --------------------------------------------------------------- + +namespace com { namespace sun { namespace star { namespace awt { + struct Point; + struct Rectangle; + struct Size; + class XFocusListener; +} } } } + +namespace accessibility +{ + class IComboListBoxHelper; +} + +// class VCLXAccessibleListItem ------------------------------------------ + +typedef ::cppu::WeakAggComponentImplHelper6< ::com::sun::star::accessibility::XAccessible + , ::com::sun::star::accessibility::XAccessibleContext + , ::com::sun::star::accessibility::XAccessibleComponent + , ::com::sun::star::accessibility::XAccessibleEventBroadcaster + , ::com::sun::star::accessibility::XAccessibleText + , ::com::sun::star::lang::XServiceInfo > VCLXAccessibleListItem_BASE; + +/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry +*/ +class VCLXAccessibleListItem : public ::comphelper::OBaseMutex, + public ::comphelper::OCommonAccessibleText, + public VCLXAccessibleListItem_BASE +{ +private: + ::rtl::OUString m_sEntryText; + sal_Int32 m_nIndexInParent; + sal_Bool m_bSelected; + sal_Bool m_bVisible; + +protected: + /// client id in the AccessibleEventNotifier queue + sal_uInt32 m_nClientId; + ::accessibility::IComboListBoxHelper* m_pListBoxHelper; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xParent; + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > m_xParentContext; + +private: + /** notifies all listeners that this object has changed + @param _nEventId + is the event id + @param _aOldValue + is the old value + @param _aNewValue + is the new value + */ + void NotifyAccessibleEvent( sal_Int16 _nEventId, + const ::com::sun::star::uno::Any& _aOldValue, + const ::com::sun::star::uno::Any& _aNewValue ); + +protected: + virtual ~VCLXAccessibleListItem(); + /** this function is called upon disposing the component + */ + virtual void SAL_CALL disposing(); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + +public: + /** OAccessibleBase needs a valid view + @param _pListBoxHelper + is the list- or combobox for which we implement an accessible object + @param _nIndexInParent + is the position of the entry inside the listbox + @param _xParent + is our parent accessible object + */ + VCLXAccessibleListItem( ::accessibility::IComboListBoxHelper* _pListBoxHelper, + sal_Int32 _nIndexInParent, + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent ); + + + inline sal_Bool IsSelected() const { return m_bSelected; } + void SetSelected( sal_Bool _bSelected ); + void SetVisible( sal_Bool _bVisible ); + inline bool DecrementIndexInParent() { OSL_ENSURE(m_nIndexInParent != 0,"Invalid call!");--m_nIndexInParent; return true;} + inline bool IncrementIndexInParent() { ++m_nIndexInParent; return true;} + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground (void) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground (void) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + 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); + 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); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleEventBroadcaster + using cppu::WeakAggComponentImplHelperBase::addEventListener; + using cppu::WeakAggComponentImplHelperBase::removeEventListener; + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_ACCESSIBLELISTBOXENTRY_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx new file mode 100644 index 000000000000..c35052e24b4d --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblemenu.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX + +#include <accessibility/standard/vclxaccessiblemenuitem.hxx> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> + +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif + + +// ---------------------------------------------------- +// class VCLXAccessibleMenu +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper1 < + ::com::sun::star::accessibility::XAccessibleSelection > VCLXAccessibleMenu_BASE; + +class VCLXAccessibleMenu : public VCLXAccessibleMenuItem, + public VCLXAccessibleMenu_BASE +{ +protected: + virtual sal_Bool IsFocused(); + virtual sal_Bool IsPopupMenuOpen(); + +public: + VCLXAccessibleMenu( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu ); + virtual ~VCLXAccessibleMenu(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + 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); + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx new file mode 100644 index 000000000000..fcba9e22364d --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblemenubar.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX + +#include <accessibility/standard/accessiblemenucomponent.hxx> + +class VclSimpleEvent; +class VclWindowEvent; +class Window; + + +// ---------------------------------------------------- +// class VCLXAccessibleMenuBar +// ---------------------------------------------------- + +class VCLXAccessibleMenuBar : public OAccessibleMenuComponent +{ +protected: + Window* m_pWindow; + + virtual sal_Bool IsFocused(); + + DECL_LINK( WindowEventListener, VclSimpleEvent* ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleMenuBar( Menu* pMenu ); + virtual ~VCLXAccessibleMenuBar(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx new file mode 100644 index 000000000000..34bc26aad2da --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblemenuitem.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUITEM_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUITEM_HXX + +#include <accessibility/standard/accessiblemenuitemcomponent.hxx> + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleValue.hpp> + +#ifndef _CPPUHELPER_IMPLBASE3_HXX +#include <cppuhelper/implbase3.hxx> +#endif +#include <comphelper/accessibletexthelper.hxx> + + +// ---------------------------------------------------- +// class VCLXAccessibleMenuItem +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper3< + ::com::sun::star::accessibility::XAccessibleText, + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleValue > VCLXAccessibleMenuItem_BASE; + +class VCLXAccessibleMenuItem : public OAccessibleMenuItemComponent, + public ::comphelper::OCommonAccessibleText, + public VCLXAccessibleMenuItem_BASE +{ +protected: + virtual sal_Bool IsFocused(); + virtual sal_Bool IsSelected(); + virtual sal_Bool IsChecked(); + + virtual sal_Bool IsHighlighted(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + +public: + VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = 0 ); + virtual ~VCLXAccessibleMenuItem(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + 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); + 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); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleValue + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUITEM_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx new file mode 100644 index 000000000000..f69401816f8f --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblemenuseparator.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX + +#include <accessibility/standard/accessiblemenuitemcomponent.hxx> + + +// ---------------------------------------------------- +// class VCLXAccessibleMenuSeparator +// ---------------------------------------------------- + +class VCLXAccessibleMenuSeparator : public OAccessibleMenuItemComponent +{ +public: + VCLXAccessibleMenuSeparator( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = 0 ); + virtual ~VCLXAccessibleMenuSeparator(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); +}; + + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx new file mode 100644 index 000000000000..02eabe046c5f --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblepopupmenu.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX + +#include <accessibility/standard/accessiblemenucomponent.hxx> + + +// ---------------------------------------------------- +// class VCLXAccessiblePopupMenu +// ---------------------------------------------------- + +class VCLXAccessiblePopupMenu : public OAccessibleMenuComponent +{ +protected: + virtual sal_Bool IsFocused(); + +public: + VCLXAccessiblePopupMenu( Menu* pMenu ); + virtual ~VCLXAccessiblePopupMenu(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX diff --git a/accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx b/accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx new file mode 100644 index 000000000000..390597012623 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibleradiobutton.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleValue.hpp> + +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +// ---------------------------------------------------- +// class VCLXAccessibleRadioButton +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleValue > VCLXAccessibleRadioButton_BASE; + +class VCLXAccessibleRadioButton : public VCLXAccessibleTextComponent, + public VCLXAccessibleRadioButton_BASE +{ +protected: + virtual ~VCLXAccessibleRadioButton(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + +public: + VCLXAccessibleRadioButton( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleValue + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx new file mode 100644 index 000000000000..d4e35f6f356d --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblescrollbar.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX + +#include <toolkit/awt/vclxaccessiblecomponent.hxx> + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleValue.hpp> + +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +// ---------------------------------------------------- +// class VCLXAccessibleScrollBar +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleValue > VCLXAccessibleScrollBar_BASE; + +class VCLXAccessibleScrollBar : public VCLXAccessibleComponent, + public VCLXAccessibleScrollBar_BASE +{ +protected: + virtual ~VCLXAccessibleScrollBar(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + +public: + VCLXAccessibleScrollBar( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleValue + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx new file mode 100644 index 000000000000..0be0bbd1a4f6 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblestatusbar.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX + +#include <toolkit/awt/vclxaccessiblecomponent.hxx> + +#include <vector> + +class StatusBar; + +// ---------------------------------------------------- +// class VCLXAccessibleStatusBar +// ---------------------------------------------------- + +class VCLXAccessibleStatusBar : public VCLXAccessibleComponent +{ +private: + typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + StatusBar* m_pStatusBar; + +protected: + void UpdateShowing( sal_Int32 i, sal_Bool bShowing ); + void UpdateItemName( sal_Int32 i ); + void UpdateItemText( sal_Int32 i ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleStatusBar( VCLXWindow* pVCLXWindow ); + ~VCLXAccessibleStatusBar(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleComponent + 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); +}; + + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx new file mode 100644 index 000000000000..61cb1736b8cd --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx @@ -0,0 +1,147 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessiblestatusbaritem.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX + +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/accessibletexthelper.hxx> +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +class StatusBar; +class VCLExternalSolarLock; + +namespace utl { +class AccessibleStateSetHelper; +} + + +// ---------------------------------------------------- +// class VCLXAccessibleStatusBarItem +// ---------------------------------------------------- + +typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::lang::XServiceInfo > VCLXAccessibleStatusBarItem_BASE; + +class VCLXAccessibleStatusBarItem : public AccessibleTextHelper_BASE, + public VCLXAccessibleStatusBarItem_BASE +{ + friend class VCLXAccessibleStatusBar; + +private: + VCLExternalSolarLock* m_pExternalLock; + StatusBar* m_pStatusBar; + sal_uInt16 m_nItemId; + ::rtl::OUString m_sItemName; + ::rtl::OUString m_sItemText; + sal_Bool m_bShowing; + +protected: + sal_Bool IsShowing(); + void SetShowing( sal_Bool bShowing ); + void SetItemName( const ::rtl::OUString& sItemName ); + ::rtl::OUString GetItemName(); + void SetItemText( const ::rtl::OUString& sItemText ); + ::rtl::OUString GetItemText(); + sal_uInt16 GetItemId() const { return m_nItemId; } + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, sal_uInt16 nItemId ); + virtual ~VCLXAccessibleStatusBarItem(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + 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); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx new file mode 100644 index 000000000000..ba7aaa9bcf35 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletabcontrol.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX + +#include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> + +#include <vector> + +class TabControl; + + +// ---------------------------------------------------- +// class VCLXAccessibleTabControl +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper1 < + ::com::sun::star::accessibility::XAccessibleSelection > VCLXAccessibleTabControl_BASE; + +class VCLXAccessibleTabControl : public VCLXAccessibleComponent, + public VCLXAccessibleTabControl_BASE +{ +private: + typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + TabControl* m_pTabControl; + +protected: + void UpdateFocused(); + void UpdateSelected( sal_Int32 i, bool bSelected ); + void UpdatePageText( sal_Int32 i ); + void UpdateTabPage( sal_Int32 i, bool bNew ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleTabControl( VCLXWindow* pVCLXWindow ); + ~VCLXAccessibleTabControl(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +}; + + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx new file mode 100644 index 000000000000..4d119a3813f2 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletabpage.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX + +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/accessibletexthelper.hxx> +#ifndef _CPPUHELPER_IMPLBASE2_HXX +#include <cppuhelper/implbase2.hxx> +#endif + + +class TabControl; +class VCLExternalSolarLock; + +namespace utl { +class AccessibleStateSetHelper; +} + + +// ---------------------------------------------------- +// class VCLXAccessibleTabPage +// ---------------------------------------------------- + +typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::lang::XServiceInfo > VCLXAccessibleTabPage_BASE; + +class VCLXAccessibleTabPage : public AccessibleTextHelper_BASE, + public VCLXAccessibleTabPage_BASE +{ + friend class VCLXAccessibleTabControl; + +private: + VCLExternalSolarLock* m_pExternalLock; + TabControl* m_pTabControl; + sal_uInt16 m_nPageId; + bool m_bFocused; + bool m_bSelected; + ::rtl::OUString m_sPageText; + +protected: + bool IsFocused(); + bool IsSelected(); + + void SetFocused( bool bFocused ); + void SetSelected( bool bSelected ); + void SetPageText( const ::rtl::OUString& sPageText ); + ::rtl::OUString GetPageText(); + + void Update( bool bNew ); + + sal_uInt16 GetPageId() const { return m_nPageId; } + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId ); + virtual ~VCLXAccessibleTabPage(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + 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); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx new file mode 100644 index 000000000000..09dc5e30ca05 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletabpagewindow.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX + +#include <toolkit/awt/vclxaccessiblecomponent.hxx> + + +class TabControl; +class TabPage; + + +// ---------------------------------------------------- +// class VCLXAccessibleTabPageWindow +// ---------------------------------------------------- + +class VCLXAccessibleTabPageWindow : public VCLXAccessibleComponent +{ +private: + TabControl* m_pTabControl; + TabPage* m_pTabPage; + sal_uInt16 m_nPageId; + +protected: + // OCommonAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleTabPageWindow( VCLXWindow* pVCLXWindow ); + ~VCLXAccessibleTabPageWindow(); + + // XAccessibleContext + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); +}; + + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx new file mode 100644 index 000000000000..99560f712781 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletextcomponent.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX + +#include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <comphelper/accessibletexthelper.hxx> + + +// ---------------------------------------------------- +// class VCLXAccessibleTextComponent +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper1 < + ::com::sun::star::accessibility::XAccessibleText > VCLXAccessibleTextComponent_BASE; + +class VCLXAccessibleTextComponent : public VCLXAccessibleComponent, + public ::comphelper::OCommonAccessibleText, + public VCLXAccessibleTextComponent_BASE +{ +protected: + ::rtl::OUString m_sText; + + void SetText( const ::rtl::OUString& sText ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleTextComponent( VCLXWindow* pVCLXWindow ); + ~VCLXAccessibleTextComponent(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + 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); + 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); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +}; + + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx new file mode 100644 index 000000000000..91cf681e3609 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletextfield.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX + +#include <accessibility/standard/vclxaccessibletextcomponent.hxx> + +#ifndef _CPPUHELPER_IMPLBASE1_HXX +#include <cppuhelper/implbase1.hxx> +#endif + +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessible + > VCLXAccessible_BASE; + + +/** This class represents non editable text fields. The object passed to + the constructor is expected to be a list (a <type>ListBox</type> to be + more specific). From this allways the selected item is token to be made + accessible by this class. When the selected item changes then also the + exported text changes. +*/ +class VCLXAccessibleTextField : + public VCLXAccessibleTextComponent, + public VCLXAccessible_BASE +{ +public: + VCLXAccessibleTextField (VCLXWindow* pVCLXindow, + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& _xParent); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessible + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL + getAccessibleContext (void) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + sal_Int32 SAL_CALL getAccessibleChildCount (void) + throw (::com::sun::star::uno::RuntimeException); + ::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); + sal_Int16 SAL_CALL getAccessibleRole (void) + throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleParent( ) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName (void) + throw (::com::sun::star::uno::RuntimeException); + // Return text field specific services. + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames (void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + virtual ~VCLXAccessibleTextField (void); + + /** With this method the text of the currently selected item is made + available to the <type>VCLXAccessibleTextComponent</type> base class. + */ + ::rtl::OUString implGetText (void); + +private: + /** We need to save the accessible parent to return it in <type>getAccessibleParent()</type>, + because this method of the base class returns the wrong parent. + */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > m_xParent; +}; + +#endif + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx new file mode 100644 index 000000000000..3c06fa11a25c --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletoolbox.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOX_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOX_HXX + +#include <map> +#include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> + +// ---------------------------------------------------- +// class VCLXAccessibleToolBox +// ---------------------------------------------------- + +typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessibleSelection > VCLXAccessibleToolBox_BASE; + +typedef std::map< sal_Int32, com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > ToolBoxItemsMap; + +class VCLXAccessibleToolBoxItem; +class ToolBox; + +class VCLXAccessibleToolBox : public VCLXAccessibleComponent, public VCLXAccessibleToolBox_BASE +{ +private: + ToolBoxItemsMap m_aAccessibleChildren; + + VCLXAccessibleToolBoxItem* GetItem_Impl( sal_Int32 _nPos, bool _bMustHaveFocus ); + + void UpdateFocus_Impl(); + void ReleaseFocus_Impl( sal_Int32 _nPos ); + void UpdateChecked_Impl( sal_Int32 _nPos ); + void UpdateIndeterminate_Impl( sal_Int32 _nPos ); + void UpdateItem_Impl( sal_Int32 _nPos, sal_Bool _bItemAdded ); + void UpdateAllItems_Impl(); + void UpdateItemName_Impl( sal_Int32 _nPos ); + void UpdateItemEnabled_Impl( sal_Int32 _nPos ); + void HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent, bool _bShow ); + void ReleaseSubToolBox( ToolBox* _pSubToolBox ); + +protected: + virtual ~VCLXAccessibleToolBox(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& rVclWindowEvent ); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetItemWindowAccessible( const VclWindowEvent& rVclWindowEvent ); + + // XComponent + virtual void SAL_CALL disposing(); + +public: + VCLXAccessibleToolBox( VCLXWindow* pVCLXWindow ); + + // XInterface + DECLARE_XINTERFACE( ) + + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + 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); + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + +private: + void implReleaseToolboxItem( + ToolBoxItemsMap::iterator& _rMapPos, + bool _bNotifyRemoval, + bool _bDispose + ); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOX_HXX + diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx new file mode 100644 index 000000000000..7d74b4ec2a14 --- /dev/null +++ b/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx @@ -0,0 +1,173 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclxaccessibletoolboxitem.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX +#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX + +#include <com/sun/star/accessibility/XAccessible.hpp> +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_ +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#endif +#include <com/sun/star/accessibility/XAccessibleComponent.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/accessibility/XAccessibleStateSet.hpp> +#include <com/sun/star/accessibility/XAccessibleText.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/accessibility/XAccessibleValue.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#ifndef _CPPUHELPER_IMPLBASE4_HXX +#include <cppuhelper/implbase4.hxx> +#endif +#include <comphelper/accessibletexthelper.hxx> +#include <tools/solar.h> + +// class VCLXAccessibleToolBoxItem --------------------------------------------- + +class ToolBox; + +typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; +typedef ::cppu::ImplHelper4 < ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleValue, + ::com::sun::star::lang::XServiceInfo > VCLXAccessibleToolBoxItem_BASE; + +class VCLExternalSolarLock; + +class VCLXAccessibleToolBoxItem : public AccessibleTextHelper_BASE, + public VCLXAccessibleToolBoxItem_BASE +{ +private: + ::rtl::OUString m_sOldName; + ToolBox* m_pToolBox; + VCLExternalSolarLock* m_pExternalLock; + sal_Int32 m_nIndexInParent; + sal_Int16 m_nRole; + USHORT m_nItemId; + sal_Bool m_bHasFocus; + sal_Bool m_bIsChecked; + bool m_bIndeterminate; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xChild; + +public: + inline sal_Int32 getIndexInParent() const { return m_nIndexInParent; } + inline void setIndexInParent( sal_Int32 _nNewIndex ) { m_nIndexInParent = _nNewIndex; } + +protected: + virtual ~VCLXAccessibleToolBoxItem(); + + virtual void SAL_CALL disposing(); + + /// implements the calculation of the bounding rectangle + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + + ::rtl::OUString GetText( bool _bAsName ); + +public: + VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_Int32 _nPos ); + + void SetFocus( sal_Bool _bFocus ); + inline sal_Bool HasFocus() const { return m_bHasFocus; } + void SetChecked( sal_Bool _bCheck ); + inline sal_Bool IsChecked() const { return m_bIsChecked; } + void SetIndeterminate( bool _bIndeterminate ); + inline bool IsIndeterminate() const { return m_bIndeterminate; } + inline void ReleaseToolBox() { m_pToolBox = NULL; } + void NameChanged(); + void SetChild( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xChild ); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + GetChild() const { return m_xChild; } + void NotifyChildEvent( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xChild, bool _bShow ); + + void ToggleEnableState(); + + // XInterface + DECLARE_XINTERFACE( ) + DECLARE_XTYPEPROVIDER( ) + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + 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); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + 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); + virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + 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); + + // XAccessibleValue + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX + |