diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-17 21:37:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-21 22:08:04 +0100 |
commit | 47897fdd936d9b6e9ac8cb6110c79352ab080df7 (patch) | |
tree | c657b53080caa94590d1e9b1fd4383d6dc795728 /include/svtools | |
parent | cfa76f538a44d4396574ece59e8a3953c22c6eb7 (diff) |
weld SwCondCollPage
and put back original SvTreeListBox a11y factory use
Change-Id: I4ad8ce29d8fed6ec5d44e9a1d641919a89226b79
Reviewed-on: https://gerrit.libreoffice.org/63501
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svtools')
-rw-r--r-- | include/svtools/AccessibleBrowseBoxObjType.hxx | 48 | ||||
-rw-r--r-- | include/svtools/accessiblefactory.hxx | 165 | ||||
-rw-r--r-- | include/svtools/accessibletable.hxx | 175 | ||||
-rw-r--r-- | include/svtools/accessibletableprovider.hxx | 235 | ||||
-rw-r--r-- | include/svtools/brwbox.hxx | 21 | ||||
-rw-r--r-- | include/svtools/brwhead.hxx | 2 | ||||
-rw-r--r-- | include/svtools/headbar.hxx | 335 | ||||
-rw-r--r-- | include/svtools/simptabl.hxx | 4 | ||||
-rw-r--r-- | include/svtools/svtabbx.hxx | 248 |
9 files changed, 15 insertions, 1218 deletions
diff --git a/include/svtools/AccessibleBrowseBoxObjType.hxx b/include/svtools/AccessibleBrowseBoxObjType.hxx deleted file mode 100644 index 33e54331ebd8..000000000000 --- a/include/svtools/AccessibleBrowseBoxObjType.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX -#define INCLUDED_SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX - - -namespace svt { - - -/** This enumeration contains a constant for each kind of accessible object of - a BrowseBox. */ -enum AccessibleBrowseBoxObjType -{ - BBTYPE_BROWSEBOX, /// The BrowseBox itself. - BBTYPE_TABLE, /// The data table. - BBTYPE_ROWHEADERBAR, /// The row header bar ("handle column"). - BBTYPE_COLUMNHEADERBAR, /// The horizontal column header bar. - BBTYPE_TABLECELL, /// A cell of the data table. - BBTYPE_ROWHEADERCELL, /// A cell of the row header bar. - BBTYPE_COLUMNHEADERCELL, /// A cell of the column header bar. - BBTYPE_CHECKBOXCELL /// A cell with a checkbox. -}; - - -} // namespace svt - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/accessiblefactory.hxx b/include/svtools/accessiblefactory.hxx deleted file mode 100644 index 05c5715cc0ef..000000000000 --- a/include/svtools/accessiblefactory.hxx +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVTOOLS_ACCESSIBLEFACTORY_HXX -#define INCLUDED_SVTOOLS_ACCESSIBLEFACTORY_HXX - -#include <svtools/AccessibleBrowseBoxObjType.hxx> -#include <svtools/accessibletableprovider.hxx> - -#include <com/sun/star/uno/Reference.hxx> - -#include <rtl/ref.hxx> -#include <salhelper/simplereferenceobject.hxx> - -namespace com { namespace sun { namespace star { - namespace accessibility { - class XAccessible; - class XAccessibleContext; - } - namespace awt { - class XWindow; - } -} } } -class SvHeaderTabListBox; -class SvtIconChoiceCtrl; -class TabBar; -class SvTreeListBox; -class VCLXWindow; -class TextEngine; -class TextView; - - -namespace svt -{ - - - class PanelTabBar; - namespace table - { - class IAccessibleTable; - class IAccessibleTableControl; - } - - /** a function which is able to create a factory for the standard Accessible/Context - components needed for standard toolkit controls - - The returned pointer denotes an instance of the IAccessibleFactory, which has been acquired - <em>once</em>. The caller is responsible for holding this reference as long as it needs the - factory, and release it afterwards. - */ - typedef void* (* GetSvtAccessibilityComponentFactory)( ); - - - //= IAccessibleFactory - - class IAccessibleFactory : public virtual ::salhelper::SimpleReferenceObject - { - public: - virtual IAccessibleTabListBox* - createAccessibleTabListBox( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - SvHeaderTabListBox& rBox - ) const = 0; - - virtual IAccessibleBrowseBox* - createAccessibleBrowseBox( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - IAccessibleTableProvider& _rBrowseBox - ) const = 0; - virtual table::IAccessibleTableControl* - createAccessibleTableControl( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - table::IAccessibleTable& _rTable - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessibleIconChoiceCtrl( - SvtIconChoiceCtrl& _rIconCtrl, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessibleTabBar( - TabBar& _rTabBar - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessibleContext > - createAccessibleTextWindowContext( - VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessibleBrowseBoxHeaderBar( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - IAccessibleTableProvider& _rOwningTable, - AccessibleBrowseBoxObjType _eObjType - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessibleBrowseBoxTableCell( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - sal_Int32 _nRowId, - sal_uInt16 _nColId, - sal_Int32 _nOffset - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessibleBrowseBoxHeaderCell( - sal_Int32 _nColumnRowId, - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - AccessibleBrowseBoxObjType _eObjType - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessibleCheckBoxCell( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos, - const TriState& _eState, - bool _bIsTriState - ) const = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > - createEditBrowseBoxTableCellAccess( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - const css::uno::Reference< css::accessibility::XAccessible >& _rxControlAccessible, - const css::uno::Reference< css::awt::XWindow >& _rxFocusWindow, - IAccessibleTableProvider& _rBrowseBox, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos - ) const = 0; - - protected: - virtual ~IAccessibleFactory() override {} - }; - - -} // namespace svt - - -#endif // INCLUDED_SVTOOLS_ACCESSIBLEFACTORY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/accessibletable.hxx b/include/svtools/accessibletable.hxx deleted file mode 100644 index f24e2963270a..000000000000 --- a/include/svtools/accessibletable.hxx +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVTOOLS_ACCESSIBLETABLE_HXX -#define INCLUDED_SVTOOLS_ACCESSIBLETABLE_HXX - -#include <vcl/window.hxx> -#include <unotools/accessiblestatesethelper.hxx> -#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> - - -namespace svt{ namespace table -{ - -typedef sal_Int32 RowPos; - -enum AccessibleTableControlObjType -{ - TCTYPE_GRIDCONTROL, /// The GridControl itself. - TCTYPE_TABLE, /// The data table. - TCTYPE_ROWHEADERBAR, /// The row header bar. - TCTYPE_COLUMNHEADERBAR, /// The horizontal column header bar. - TCTYPE_TABLECELL, /// A cell of the data table. - TCTYPE_ROWHEADERCELL, /// A cell of the row header bar. - TCTYPE_COLUMNHEADERCELL, /// A cell of the column header bar. -}; - - -/** This abstract class provides methods to implement an accessible table object. -*/ -class IAccessibleTable -{ -public: - /** @return The position of the current row. */ - virtual sal_Int32 GetCurrentRow() const = 0; - /** @return The position of the current column. */ - virtual sal_Int32 GetCurrentColumn() const = 0; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex )= 0; - virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0; - virtual void GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0; - virtual bool HasColHeader() = 0; - virtual bool HasRowHeader() = 0; - - /** return the description of the specified object. - @param eObjType - The type to ask for - @return - The description of the specified object. - */ - virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType) const= 0; - - /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by - the accessible object), depending on the specified object type. */ - virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet, - AccessibleTableControlObjType eObjType ) const= 0; - - // Window - virtual tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const = 0; - virtual void GrabFocus()= 0; - virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible()= 0; - virtual vcl::Window* GetAccessibleParentWindow() const= 0; - virtual vcl::Window* GetWindowInstance()= 0; - virtual sal_Int32 GetAccessibleControlCount() const = 0; - virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0; - virtual long GetRowCount() const= 0; - virtual long GetColumnCount() const= 0; - virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0; - virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar ) = 0; - virtual tools::Rectangle calcHeaderCellRect( bool _bColHeader, sal_Int32 _nPos ) = 0; - virtual tools::Rectangle calcTableRect() = 0; - virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0; - virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0; - virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0; - virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0; - virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0; - virtual OUString GetRowName(sal_Int32 _nIndex) const = 0; - virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0; - virtual OUString GetColumnName( sal_Int32 _nIndex ) const = 0; - virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; - - virtual sal_Int32 GetSelectedRowCount() const = 0; - virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0; - virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0; - virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0; - virtual void SelectAllRows( bool const i_select ) = 0; - -protected: - ~IAccessibleTable() {} -}; - - -/** interface for an implementation of a table control's Accessible component -*/ -class IAccessibleTableControl -{ -public: - /** returns the XAccessible object itself - - The reference returned here can be used to control the life time of the - IAccessibleTableImplementation object. - - The returned reference is guaranteed to not be <NULL/>. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() = 0; - - /** disposes the accessible implementation, so that it becomes defunc - */ - virtual void DisposeAccessImpl() = 0; - - /** checks whether the accessible implementation, and its context, are still alive - @return <TRUE/>, if the object is not disposed or disposing. - */ - virtual bool isAlive() const = 0; - - /** commits the event at all listeners of the cell - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - virtual void commitCellEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue - ) = 0; - /** commits the event at all listeners of the table - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - virtual void commitTableEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue - ) = 0; - - ///** Commits an event to all listeners. */ - virtual void commitEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue - ) = 0; - -protected: - ~IAccessibleTableControl() {} -}; - - -} // namespace table -} // namespace svt - -#endif // INCLUDED_SVTOOLS_ACCESSIBLETABLE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/accessibletableprovider.hxx b/include/svtools/accessibletableprovider.hxx deleted file mode 100644 index 094c4a16fb27..000000000000 --- a/include/svtools/accessibletableprovider.hxx +++ /dev/null @@ -1,235 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX -#define INCLUDED_SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX - -#include <vcl/window.hxx> -#include <unotools/accessiblestatesethelper.hxx> -#include <svtools/AccessibleBrowseBoxObjType.hxx> -#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> - - -namespace svt -{ - -#define OFFSET_DEFAULT (sal_Int32(-1)) -#define OFFSET_NONE (sal_Int32(0)) - -enum AccessibleTableChildIndex -{ - /** Child index of the column header bar (first row). Exists always. */ - BBINDEX_COLUMNHEADERBAR = 0, - /** Child index of the row header bar ("handle column"). Exists always. */ - BBINDEX_ROWHEADERBAR = 1, - /** Child index of the data table. */ - BBINDEX_TABLE = 2, - /** Child index of the first additional control. */ - BBINDEX_FIRSTCONTROL = 3 -}; - - -/** This abstract class provides methods to implement an accessible table object. -*/ -class IAccessibleTableProvider -{ -public: - /** @return The count of the rows. */ - virtual long GetRowCount() const = 0; - /** @return The count of the columns. */ - virtual sal_uInt16 GetColumnCount() const = 0; - - /** @return The position of the current row. */ - virtual sal_Int32 GetCurrRow() const = 0; - /** @return The position of the current column. */ - virtual sal_uInt16 GetCurrColumn() const = 0; - - /** @return The description of a row. - @param _nRow The row which description is in demand. */ - virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0; - /** @return The description of a column. - @param _nColumn The column which description is in demand. */ - virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0; - - /** @return <TRUE/>, if the object has a row header. */ - virtual bool HasRowHeader() const = 0; //GetColumnId - virtual bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0; - - virtual void SetNoSelection() = 0; - virtual void SelectAll() = 0; - virtual void SelectRow( long _nRow, bool _bSelect = true, bool bExpand = true ) = 0; - virtual void SelectColumn( sal_uInt16 _nColumnPos, bool _bSelect = true ) = 0; - virtual sal_Int32 GetSelectedRowCount() const = 0; - virtual sal_Int32 GetSelectedColumnCount() const = 0; - /** @return <TRUE/>, if the row is selected. */ - virtual bool IsRowSelected( long _nRow ) const = 0; - virtual bool IsColumnSelected( long _nColumnPos ) const = 0; - virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const = 0; - virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const = 0; - - /** @return <TRUE/>, if the cell is visible. */ - virtual bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0; - virtual OUString GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const = 0; - - virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar, bool _bOnScreen = true ) = 0; - virtual tools::Rectangle calcTableRect( bool _bOnScreen = true ) = 0; - virtual tools::Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, bool _bIsHeader, bool _bOnScreen = true ) = 0; - - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0; - - virtual sal_Int32 GetAccessibleControlCount() const = 0; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) = 0; - virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) = 0; - - virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0; - virtual bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) = 0; - virtual bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) = 0; - - virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0; - virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0; - - virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const = 0; - virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0; - virtual void GrabTableFocus() = 0; - - // OutputDevice - virtual bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, MetricVector& rVector ) = 0; - - // Window - virtual tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const = 0; - virtual void GrabFocus() = 0; - virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() = 0; - virtual vcl::Window* GetAccessibleParentWindow() const = 0; - virtual vcl::Window* GetWindowInstance() = 0; - - virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) = 0; - virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) = 0; - -protected: - ~IAccessibleTableProvider() {} -}; - - -/** interface for an implementation of a table control's Accessible component -*/ -class IAccessibleTabListBox -{ -public: - /** returns the XAccessible object itself - - The reference returned here can be used to control the life time of the - IAccessibleTableImplementation object. - - The returned reference is guaranteed to not be <NULL/>. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() = 0; - - /** returns the accessible object for the column header bar - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getHeaderBar() = 0; - -protected: - ~IAccessibleTabListBox() {} -}; - -/** interface for an implementation of a browse box's Accessible component -*/ -class IAccessibleBrowseBox -{ -public: - /** returns the XAccessible object itself - - The reference returned here can be used to control the life time of the - IAccessibleTableImplementation object. - - The returned reference is guaranteed to not be <NULL/>. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() = 0; - - /** disposes the accessible implementation, so that it becomes defunc - */ - virtual void dispose() = 0; - - /** checks whether the accessible implementation, and its context, are still alive - @return <TRUE/>, if the object is not disposed or disposing. - */ - virtual bool isAlive() const = 0; - - /** returns the accessible object for the row or the column header bar - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0; - - /** returns the accessible object for the table representation - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - getTable() = 0; - - /** commits the event at all listeners of the column/row header bar - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - virtual void commitHeaderBarEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue, - bool _bColumnHeaderBar - ) = 0; - - /** commits the event at all listeners of the table - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - virtual void commitTableEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue - ) = 0; - - /** Commits an event to all listeners. */ - virtual void commitEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue - ) = 0; - -protected: - ~IAccessibleBrowseBox() {} -}; - - -} // namespace svt - - -#endif // INCLUDED_SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index e300fe997fa6..ba09a67050b0 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -24,10 +24,10 @@ #include <vcl/ctrl.hxx> #include <vcl/vclptr.hxx> #include <tools/multisel.hxx> -#include <svtools/headbar.hxx> +#include <vcl/headbar.hxx> #include <vcl/transfer.hxx> -#include <svtools/AccessibleBrowseBoxObjType.hxx> -#include <svtools/accessibletableprovider.hxx> +#include <vcl/AccessibleBrowseBoxObjType.hxx> +#include <vcl/accessibletableprovider.hxx> #include <vector> #include <stack> @@ -42,13 +42,16 @@ class BrowserHeader; namespace svt { class BrowseBoxImpl; - class IAccessibleFactory; } namespace utl { class AccessibleStateSetHelper; } +namespace vcl { + class IAccessibleFactory; +} + #define BROWSER_INVALIDID SAL_MAX_UINT16 #define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION)) @@ -186,7 +189,7 @@ class SVT_DLLPUBLIC BrowseBox :public Control ,public DragSourceHelper ,public DropTargetHelper - ,public svt::IAccessibleTableProvider + ,public vcl::IAccessibleTableProvider { friend class BrowserDataWin; friend class ::svt::BrowseBoxImpl; @@ -309,7 +312,7 @@ private: protected: /// retrieves the XAccessible implementation associated with the BrowseBox instance - ::svt::IAccessibleFactory& getAccessibleFactory(); + ::vcl::IAccessibleFactory& getAccessibleFactory(); protected: sal_uInt16 ColCount() const; @@ -706,7 +709,7 @@ public: @return The name of the specified object. */ - virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + virtual OUString GetAccessibleObjectName( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; /** return the description of the specified object. @param eObjType @@ -716,7 +719,7 @@ public: @return The description of the specified object. */ - virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + virtual OUString GetAccessibleObjectDescription( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; /** @return The header text of the specified row. */ virtual OUString GetRowDescription( sal_Int32 nRow ) const override; @@ -728,7 +731,7 @@ public: the accessible object), depending on the specified object type. */ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet, - ::svt::AccessibleBrowseBoxObjType eObjType ) const override; + ::vcl::AccessibleBrowseBoxObjType eObjType ) const override; /** Fills the StateSet with all states for one cell (except DEFUNC and SHOWING, done by the accessible object). */ diff --git a/include/svtools/brwhead.hxx b/include/svtools/brwhead.hxx index 0520007cb247..082e9c134970 100644 --- a/include/svtools/brwhead.hxx +++ b/include/svtools/brwhead.hxx @@ -21,7 +21,7 @@ #define INCLUDED_SVTOOLS_BRWHEAD_HXX #include <svtools/svtdllapi.h> -#include <svtools/headbar.hxx> +#include <vcl/headbar.hxx> class BrowseBox; diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx deleted file mode 100644 index 08203a2c611a..000000000000 --- a/include/svtools/headbar.hxx +++ /dev/null @@ -1,335 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVTOOLS_HEADBAR_HXX -#define INCLUDED_SVTOOLS_HEADBAR_HXX - -#include <svtools/svtdllapi.h> -#include <tools/link.hxx> -#include <vcl/window.hxx> -#include <o3tl/typed_flags_set.hxx> -#include <memory> - -/************************************************************************* - -Description -============ - -class HeaderBar - -This class serves for displaying a header bar. A header bar can display -texts, images or both of them. The items can be changed in size, dragged or -clicked at. In many cases, it makes, for example, sense to use this control -in combination with a SvTabListBox. - --------------------------------------------------------------------------- - -WinBits - -WB_BORDER a border is drawn in the top and in the bottom -WB_BOTTOMBORDER a border is drawn in the bottom -WB_BUTTONSTYLE The items look like buttons, otherwise they are flat. -WB_3DLOOK 3D look -WB_DRAG items can be dragged -WB_STDHEADERBAR WB_BUTTONSTYLE | WB_BOTTOMBORDER - --------------------------------------------------------------------------- - -ItemBits - -HeaderBarItemBits::LEFT content is displayed in the item left-justified -HeaderBarItemBits::CENTER content is displayed in the item centred -HeaderBarItemBits::RIGHT content is displayed in the item right-justified -HeaderBarItemBits::TOP content is displayed in the item at the upper border -HeaderBarItemBits::VCENTER content is displayed in the item vertically centred -HeaderBarItemBits::BOTTOM content is displayed in the item at the bottom border -HeaderBarItemBits::LEFTIMAGE in case of text and image, the image is displayed left of the text -HeaderBarItemBits::RIGHTIMAGE in case of text and image, the image is displayed right of the text -HeaderBarItemBits::FIXED item cannot be changed in size -HeaderBarItemBits::FIXEDPOS item cannot be moved -HeaderBarItemBits::CLICKABLE item is clickable - (select handler is only called on MouseButtonUp) -HeaderBarItemBits::FLAT item is displayed in a flat way, even if WB_BUTTONSTYLE is set -HeaderBarItemBits::DOWNARROW An arrow pointing downwards is displayed behind the text, - which should, for example, be shown, when after this item, - a corresponding list is sorted in descending order. - The status of the arrow can be set/reset with SetItemBits(). -HeaderBarItemBits::UPARROW An arrow pointing upwards is displayed behind the text, - which should, for example, be shown, when after this item, - a corresponding list is sorted in ascending order. - The status of the arrow can be set/reset with SetItemBits(). -HeaderBarItemBits::USERDRAW For this item, the UserDraw handler is called as well. -HeaderBarItemBits::STDSTYLE (HeaderBarItemBits::LEFT | HeaderBarItemBits::LEFTIMAGE | HeaderBarItemBits::VCENTER | HeaderBarItemBits::CLICKABLE) - --------------------------------------------------------------------------- - -Handler - -Select() Is called, when the item is clicked. If HeaderBarItemBits::CLICKABLE - is set in the item and not HeaderBarItemBits::FLAT, the handler is only - called in the MouseButtonUp handler, when the mouse has been - released over the item. In this case, the Select handler - behaves like it does with a ToolBox button. -DoubleClick() This handler is called, when an item is double-clicked. - Whether the item or the separator has been clicked, can - be determined by IsItemMode(). Normally, when a separator - is double-clicked, the optimal column width should be - calculated and should be set. -StartDrag() This handler is called, when dragging is started resp. - an item has been clicked. At the latest in this handler, - the size of the size-line should be set with - SetDragSize(), if IsItemMode() returns false. -Drag() This handler is called, when dragging is taking place. - If no size is set with SetDragSize(), this handler can - be used to draw the line in the neighbouring window by - oneself. The current dragging position can be requested - with GetDragPos(). In every case, IsItemMode() - should be checked to find out whether a separator is - dragged as well. -EndDrag() This handler is called, when a dragging process has been - stopped. If GetCurItemId() returns 0 in the EndDrag handler, - the drag process was aborted. If this is not the case and - IsItemMode() returns false, the new size of the dragged - item should be requested using GetItemSize() and it - should be taken over in the corresponding control. - If IsItemMode() returns true, GetCurItemId() - returns an Id and IsItemDrag() returns true, this - item has been dragged. In this case, the new position - should be requested using GetItemPos() and the data - in the corresponding control should be adapted. - Otherwise, the position to which the item has been dragged - could also be requested with GetItemDragPos(). - -Further methods that are important for the handler. - -GetCurItemId() Returns the id of the item, for which the handler has - currently been called. Only returns a valid id in the - handlers Select(), DoubleClick(), StartDrag(), - Drag() and EndDrag(). In the EndDrag handler, - this method returns the id of the dragged item or 0, - if the drag process has been aborted. -GetItemDragPos() Returns the position, at which an item has been moved. - HEADERBAR_ITEM_NOTFOUND is returned, if the process - has been aborted or no ItemDrag is active. -IsItemMode() This method can be used to determine whether the - handler has been called for an item or a separator. - true - handler was called for the item - false - handler was called for the separator -IsItemDrag() This method can be used to determine whether an item - has been dragged or selected. - true - item is dragged - false - item is selected -SetDragSize() This method is used to set the size of the separating - line that is drawn by the control. It should be - equivalent to the height of the neighbouring window. - The height of the HeaderBar is added automatically. - --------------------------------------------------------------------------- - -Further methods - -SetOffset() This method sets the offset, from which on the - items are shown. This is needed when the - corresponding window is scrolled. -CalcWindowSizePixel() This method can be used to calculate the height - of the window, so that the content of the item - can be displayed. - --------------------------------------------------------------------------- - -Tips and tricks: - -1) ContextMenu -If a context sensitive PopupMenu should be shown, the command -handler must be overlaid. Using GetItemId() and when passing the -mouse position, it can be determined whether the mouse click has been -carried out over an item resp. over which item the mouse click has been -carried out. - -2) last item -If ButtonStyle has been set, it looks better, if an empty item is -set at the end which takes up the remaining space. -In order to do that, you can insert an item with an empty string and -pass HEADERBAR_FULLSIZE as size. For such an item, you should not set -HeaderBarItemBits::CLICKABLE, but HeaderBarItemBits::FIXEDPOS. - -*************************************************************************/ - -class Accelerator; -class ImplHeadItem; - -#define WB_BOTTOMBORDER (WinBits(0x0400)) -#define WB_BUTTONSTYLE (WinBits(0x0800)) -#define WB_STDHEADERBAR (WB_BUTTONSTYLE | WB_BOTTOMBORDER) - -enum class HeaderBarItemBits -{ - NONE = 0x0000, - LEFT = 0x0001, - CENTER = 0x0002, - RIGHT = 0x0004, - TOP = 0x0008, - VCENTER = 0x0010, - BOTTOM = 0x0020, - LEFTIMAGE = 0x0040, - RIGHTIMAGE = 0x0080, - FIXED = 0x0100, - FIXEDPOS = 0x0200, - CLICKABLE = 0x0400, - FLAT = 0x0800, - DOWNARROW = 0x1000, - UPARROW = 0x2000, - STDSTYLE = LEFT | LEFTIMAGE | VCENTER | CLICKABLE, -}; - -namespace o3tl -{ - template<> struct typed_flags<HeaderBarItemBits> : is_typed_flags<HeaderBarItemBits, 0x3fff> {}; -} - -#define HEADERBAR_APPEND (sal_uInt16(0xFFFF)) -#define HEADERBAR_ITEM_NOTFOUND (sal_uInt16(0xFFFF)) -#define HEADERBAR_FULLSIZE (long(1000000000)) - -#define HEADERBAR_TEXTOFF 2 - -class VCLXHeaderBar; - - -class SVT_DLLPUBLIC HeaderBar : public vcl::Window -{ -private: - std::vector<std::unique_ptr<ImplHeadItem>> mvItemList; - long mnBorderOff1; - long mnBorderOff2; - long mnOffset; - long mnDX; - long mnDY; - long mnDragSize; - long mnStartPos; - long mnDragPos; - long mnMouseOff; - sal_uInt16 mnCurItemId; - sal_uInt16 mnItemDragPos; - bool mbDragable; - bool mbDrag; - bool mbItemDrag; - bool mbOutDrag; - bool mbButtonStyle; - bool mbItemMode; - Link<HeaderBar*,void> maStartDragHdl; - Link<HeaderBar*,void> maDragHdl; - Link<HeaderBar*,void> maEndDragHdl; - Link<HeaderBar*,void> maSelectHdl; - Link<HeaderBar*,void> maCreateAccessibleHdl; - - css::uno::Reference< css::accessibility::XAccessible > - mxAccessible; - - using Window::ImplInit; - SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle ); - SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); - SVT_DLLPRIVATE long ImplGetItemPos( sal_uInt16 nPos ) const; - SVT_DLLPRIVATE tools::Rectangle ImplGetItemRect( sal_uInt16 nPos ) const; - using Window::ImplHitTest; - SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, long& nMouseOff, sal_uInt16& nPos ) const; - SVT_DLLPRIVATE void ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos ); - SVT_DLLPRIVATE void ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, bool bHigh, - const tools::Rectangle& rItemRect, const tools::Rectangle* pRect); - SVT_DLLPRIVATE void ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, bool bHigh, - const tools::Rectangle* pRect); - SVT_DLLPRIVATE void ImplUpdate( sal_uInt16 nPos, - bool bEnd = false ); - SVT_DLLPRIVATE void ImplStartDrag( const Point& rPos, bool bCommand ); - SVT_DLLPRIVATE void ImplDrag( const Point& rPos ); - SVT_DLLPRIVATE void ImplEndDrag( bool bCancel ); - - virtual void ApplySettings(vcl::RenderContext& rRenderContext) override; - -public: - HeaderBar( vcl::Window* pParent, WinBits nWinBits ); - virtual ~HeaderBar() override; - - virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual void MouseMove( const MouseEvent& rMEvt ) override; - virtual void Tracking( const TrackingEvent& rTEvt ) override; - virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; - virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override; - virtual void Resize() override; - virtual void Command( const CommandEvent& rCEvt ) override; - virtual void RequestHelp( const HelpEvent& rHEvt ) override; - virtual void StateChanged( StateChangedType nStateChange ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - - virtual void EndDrag(); - virtual void Select(); - virtual void DoubleClick(); - - void InsertItem( sal_uInt16 nItemId, const OUString& rText, - long nSize, HeaderBarItemBits nBits = HeaderBarItemBits::STDSTYLE, - sal_uInt16 nPos = HEADERBAR_APPEND ); - void RemoveItem( sal_uInt16 nItemId ); - void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ); - void Clear(); - - void SetOffset( long nNewOffset ); - void SetDragSize( long nNewSize ) { mnDragSize = nNewSize; } - - sal_uInt16 GetItemCount() const; - sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const; - sal_uInt16 GetItemId( sal_uInt16 nPos ) const; - sal_uInt16 GetItemId( const Point& rPos ) const; - tools::Rectangle GetItemRect( sal_uInt16 nItemId ) const; - sal_uInt16 GetCurItemId() const { return mnCurItemId; } - long GetDragPos() const { return mnDragPos; } - bool IsItemMode() const { return mbItemMode; } - - void SetItemSize( sal_uInt16 nItemId, long nNewSize ); - long GetItemSize( sal_uInt16 nItemId ) const; - void SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits ); - HeaderBarItemBits GetItemBits( sal_uInt16 nItemId ) const; - - void SetItemText( sal_uInt16 nItemId, const OUString& rText ); - OUString GetItemText( sal_uInt16 nItemId ) const; - - OUString GetHelpText( sal_uInt16 nItemId ) const; - OString GetHelpId( sal_uInt16 nItemId ) const; - - Size CalcWindowSizePixel() const; - - using Window::SetHelpId; - - void SetStartDragHdl( const Link<HeaderBar*,void>& rLink ) { maStartDragHdl = rLink; } - void SetDragHdl( const Link<HeaderBar*,void>& rLink ) { maDragHdl = rLink; } - void SetEndDragHdl( const Link<HeaderBar*,void>& rLink ) { maEndDragHdl = rLink; } - void SetSelectHdl( const Link<HeaderBar*,void>& rLink ) { maSelectHdl = rLink; } - void SetCreateAccessibleHdl( const Link<HeaderBar*,void>& rLink ) { maCreateAccessibleHdl = rLink; } - - bool IsDragable() const { return mbDragable; } - - /** Creates and returns the accessible object of the header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; - void SetAccessible( const css::uno::Reference< css::accessibility::XAccessible >& ); - virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface( bool bCreate = true ) override; - -}; - -#endif // INCLUDED_SVTOOLS_HEADBAR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx index 9f5ff8c1df09..d94b7179ebb3 100644 --- a/include/svtools/simptabl.hxx +++ b/include/svtools/simptabl.hxx @@ -21,8 +21,8 @@ #define INCLUDED_SVTOOLS_SIMPTABL_HXX #include <svtools/svtdllapi.h> -#include <svtools/headbar.hxx> -#include <svtools/svtabbx.hxx> +#include <vcl/headbar.hxx> +#include <vcl/svtabbx.hxx> #include <unotools/intlwrapper.hxx> #include <unotools/collatorwrapper.hxx> #include <vcl/commandevent.hxx> diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx deleted file mode 100644 index c33ccc5993c8..000000000000 --- a/include/svtools/svtabbx.hxx +++ /dev/null @@ -1,248 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SVTOOLS_SVTABBX_HXX -#define INCLUDED_SVTOOLS_SVTABBX_HXX - -#include <svtools/svtdllapi.h> -#include <vcl/treelistbox.hxx> -#include <svtools/accessibletableprovider.hxx> - -#include <memory> -#include <vector> - -enum SvTabJustify -{ - AdjustRight = static_cast<int>(SvLBoxTabFlags::ADJUST_RIGHT), - AdjustLeft = static_cast<int>(SvLBoxTabFlags::ADJUST_LEFT), - AdjustCenter = static_cast<int>(SvLBoxTabFlags::ADJUST_CENTER), - AdjustNumeric = static_cast<int>(SvLBoxTabFlags::ADJUST_NUMERIC) -}; - -struct TabListBoxEventData -{ - SvTreeListEntry* const m_pEntry; - sal_uInt16 const m_nColumn; - OUString const m_sOldText; - - TabListBoxEventData( SvTreeListEntry* pEntry, sal_uInt16 nColumn, const OUString& rOldText ) : - m_pEntry( pEntry ), m_nColumn( nColumn ), m_sOldText( rOldText ) {} -}; - -class SVT_DLLPUBLIC SvTabListBox : public SvTreeListBox -{ -private: - std::vector<SvLBoxTab> mvTabList; - OUString aCurEntry; - -protected: - static OUString GetToken( const OUString &sStr, sal_Int32 &nIndex ); - - virtual void SetTabs() override; - virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind) override; - - OUString GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const; - SvTreeListEntry* GetEntryOnPos( sal_uLong _nEntryPos ) const; - SvTreeListEntry* GetChildOnPos( SvTreeListEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const; - -public: - SvTabListBox( vcl::Window* pParent, WinBits ); - virtual ~SvTabListBox() override; - virtual void dispose() override; - void SetTabs(sal_uInt16 nTabs, long const pTabPositions[], MapUnit = MapUnit::MapAppFont); - sal_uInt16 TabCount() const { return mvTabList.size(); } - using SvTreeListBox::GetTab; - long GetTab( sal_uInt16 nTab ) const; - void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MapUnit::MapAppFont ); - long GetLogicTab( sal_uInt16 nTab ); - - virtual SvTreeListEntry* InsertEntry( const OUString& rText, SvTreeListEntry* pParent = nullptr, - bool bChildrenOnDemand = false, - sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr, - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox ) override; - - virtual SvTreeListEntry* InsertEntry( const OUString& rText, - const Image& rExpandedEntryBmp, - const Image& rCollapsedEntryBmp, - SvTreeListEntry* pParent = nullptr, - bool bChildrenOnDemand = false, - sal_uLong nPos = TREELIST_APPEND, void* pUserData = nullptr, - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox ) override; - - virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, sal_uLong nPos = TREELIST_APPEND, - sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ); - virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, SvTreeListEntry* pParent, - sal_uLong nPos, sal_uInt16 nCol, void* pUserData = nullptr ); - virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, const Image& rExpandedEntryBmp, - const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent, - sal_uLong nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ); - - virtual OUString GetEntryText( SvTreeListEntry* pEntry ) const override; - static OUString GetEntryText( SvTreeListEntry*, sal_uInt16 nCol ); - OUString GetEntryText( sal_uLong nPos, sal_uInt16 nCol = 0xffff ) const; - using SvTreeListBox::SetEntryText; - void SetEntryText(const OUString&, sal_uLong, sal_uInt16 nCol); - void SetEntryText(const OUString&, SvTreeListEntry*, sal_uInt16 nCol=0xffff); - OUString GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const; - sal_uLong GetEntryPos( const OUString&, sal_uInt16 nCol = 0xffff ); - sal_uLong GetEntryPos( const SvTreeListEntry* pEntry ) const; - - void SetTabJustify( sal_uInt16 nTab, SvTabJustify ); -}; - -inline long SvTabListBox::GetTab( sal_uInt16 nTab ) const -{ - DBG_ASSERT( nTab < mvTabList.size(), "GetTabPos:Invalid Tab" ); - return mvTabList[nTab].GetPos(); -} - -// class SvHeaderTabListBox --------------------------------------------------- - -class HeaderBar; -namespace svt { - class IAccessibleTabListBox; - struct SvHeaderTabListBoxImpl; -} - -class SVT_DLLPUBLIC SvHeaderTabListBox : public SvTabListBox, public svt::IAccessibleTableProvider -{ -private: - typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; - - bool m_bFirstPaint; - std::unique_ptr<::svt::SvHeaderTabListBoxImpl> m_pImpl; - ::svt::IAccessibleTabListBox* m_pAccessible; - AccessibleChildren m_aAccessibleChildren; - - DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, SvTreeListBox*, void ); - DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, HeaderBar*, void ); - - void RecalculateAccessibleChildren(); - -public: - SvHeaderTabListBox( vcl::Window* pParent, WinBits nBits ); - virtual ~SvHeaderTabListBox() override; - virtual void dispose() override; - - virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override; - - void InitHeaderBar( HeaderBar* pHeaderBar ); - static bool IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol ); - - virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, sal_uLong nPos = TREELIST_APPEND, - sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ) override; - virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, SvTreeListEntry* pParent, - sal_uLong nPos, sal_uInt16 nCol, void* pUserData = nullptr ) override; - virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, const Image& rExpandedEntryBmp, - const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent, - sal_uLong nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ) override; - virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=TREELIST_APPEND) override; - virtual sal_uLong Insert( SvTreeListEntry* pEntry, sal_uLong nRootPos = TREELIST_APPEND ) override; - void RemoveEntry( SvTreeListEntry const * _pEntry ); - void Clear(); - - // Accessible ------------------------------------------------------------- - - void DisableTransientChildren() { SetChildrenNotTransient(); } - bool IsTransientChildrenDisabled() const { return !AreChildrenTransient(); } - - bool IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriState& _rState ); - - /** @return The count of the rows. */ - virtual long GetRowCount() const override; - /** @return The count of the columns. */ - virtual sal_uInt16 GetColumnCount() const override; - - /** @return The position of the current row. */ - virtual sal_Int32 GetCurrRow() const override; - /** @return The position of the current column. */ - virtual sal_uInt16 GetCurrColumn() const override; - - /** @return The description of a row. - @param _nRow The row which description is in demand. */ - virtual OUString GetRowDescription( sal_Int32 _nRow ) const override; - /** @return The description of a column. - @param _nColumn The column which description is in demand. */ - virtual OUString GetColumnDescription( sal_uInt16 _nColumn ) const override; - - /** @return <TRUE/>, if the object has a row header. */ - virtual bool HasRowHeader() const override; //GetColumnId - /** @return <TRUE/>, if the object can focus a cell. */ - virtual bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) override; - - virtual void SetNoSelection() override; - using SvTabListBox::SelectAll; - virtual void SelectAll() override; - virtual void SelectRow( long _nRow, bool _bSelect = true, bool bExpand = true ) override; - virtual void SelectColumn( sal_uInt16 _nColumn, bool _bSelect = true ) override; - virtual sal_Int32 GetSelectedRowCount() const override; - virtual sal_Int32 GetSelectedColumnCount() const override; - /** @return <TRUE/>, if the row is selected. */ - virtual bool IsRowSelected( long _nRow ) const override; - virtual bool IsColumnSelected( long _nColumn ) const override; - virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const override; - virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const override; - - /** @return <TRUE/>, if the cell is visible. */ - virtual bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const override; - virtual OUString GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const override; - - virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar, bool _bOnScreen = true ) override; - virtual tools::Rectangle calcTableRect( bool _bOnScreen = true ) override; - virtual tools::Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, bool _bIsHeader, bool _bOnScreen = true ) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) override; - - virtual sal_Int32 GetAccessibleControlCount() const override; - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) override; - virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) override; - - virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) override; - virtual bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) override; - virtual bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) override; - - virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const override; - virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const override; - virtual vcl::Window* GetWindowInstance() override; - - virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const override; - virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const override; - virtual void GrabTableFocus() override; - - // OutputDevice - virtual bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, MetricVector& rVector ) override; - - // Window - virtual tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const override; - virtual void GrabFocus() override; - virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override; - virtual vcl::Window* GetAccessibleParentWindow() const override; - - /** Creates and returns the accessible object of the whole BrowseBox. */ - virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; - - virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) override; - virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override; -}; - -#endif // INCLUDED_SVTOOLS_SVTABBX_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |