summaryrefslogtreecommitdiff
path: root/svtools/inc/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/inc/svtools')
-rw-r--r--svtools/inc/svtools/accessiblefactory.hxx6
-rwxr-xr-xsvtools/inc/svtools/accessibletable.hxx185
-rw-r--r--svtools/inc/svtools/hyperlabel.hxx11
-rw-r--r--svtools/inc/svtools/solar.hrc15
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx86
-rw-r--r--svtools/inc/svtools/table/tablemodel.hxx4
6 files changed, 284 insertions, 23 deletions
diff --git a/svtools/inc/svtools/accessiblefactory.hxx b/svtools/inc/svtools/accessiblefactory.hxx
index f7cad847edda..f4d8a03ef872 100644
--- a/svtools/inc/svtools/accessiblefactory.hxx
+++ b/svtools/inc/svtools/accessiblefactory.hxx
@@ -40,6 +40,7 @@
#endif
#include "AccessibleBrowseBoxObjType.hxx"
#include "accessibletableprovider.hxx"
+#include "accessibletable.hxx"
namespace com { namespace sun { namespace star {
namespace accessibility {
@@ -89,6 +90,11 @@ namespace svt
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
IAccessibleTableProvider& _rBrowseBox
) const = 0;
+ virtual table::IAccessibleTableControl*
+ createAccessibleTableControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ table::IAccessibleTable& _rTable
+ ) const = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
createAccessibleIconChoiceCtrl(
diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx
new file mode 100755
index 000000000000..0e3f08bfc568
--- /dev/null
+++ b/svtools/inc/svtools/accessibletable.hxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * 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: accessibletable.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 _SVTOOLS_ACCESSIBLETABLE_HXX
+#define _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 AccessibleTableType
+{
+ /** Child index of the column header bar (first row). */
+ TCINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). */
+ TCINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ TCINDEX_TABLE = 2
+};
+
+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.
+};
+
+// ============================================================================
+
+#define XACC ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+
+/** 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;
+ /** Creates and returns the accessible object of the whole GridControl. */
+ virtual XACC CreateAccessible()= 0;
+ virtual XACC CreateAccessibleControl( sal_Int32 _nIndex )= 0;
+ virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0;
+ virtual sal_Bool HasColHeader() = 0;
+ virtual sal_Bool HasRowHeader() = 0;
+
+ /** return the description of the specified object.
+ @param eObjType
+ The type to ask for
+ @param _nPosition
+ The position of a tablecell (index position), header bar colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) 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 Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) = 0;
+ virtual void GrabFocus()= 0;
+ virtual XACC GetAccessible( BOOL bCreate = TRUE )= 0;
+ virtual Window* GetAccessibleParentWindow() const= 0;
+ virtual Window* GetWindowInstance()= 0;
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0;
+ virtual long GetRowCount() const= 0;
+ virtual long GetColumnCount() const= 0;
+ virtual sal_Bool HasRowHeader() const= 0;
+ virtual sal_Int32 GetSelectedRowCount() const= 0;
+ virtual bool IsRowSelected( long _nRow ) const= 0;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE ) = 0;
+ virtual 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 ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const = 0;
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+ virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
+ virtual ::rtl::OUString GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+ virtual std::vector<sal_Int32>& GetSelectedRows() = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+/** interface for an implementation of a table control's Accesible 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 ::com::sun::star::uno::Reference< ::com::sun::star::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 sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getTableHeader( ::svt::table::AccessibleTableControlObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getTable() = 0;
+
+ ///** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue
+ ) = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+// ============================================================================
+} // namespace table
+} // namespace svt
+
+// ============================================================================
+
+#endif // _SVTOOLS_ACCESSIBLETABLE_HXX
+
diff --git a/svtools/inc/svtools/hyperlabel.hxx b/svtools/inc/svtools/hyperlabel.hxx
index c11568816158..939b1799c0de 100644
--- a/svtools/inc/svtools/hyperlabel.hxx
+++ b/svtools/inc/svtools/hyperlabel.hxx
@@ -75,26 +75,25 @@ namespace svt
void SetIndex( sal_Int32 _Index );
sal_Int32 GetIndex() const;
- void SetLabelAndSize( ::rtl::OUString _rText, const Size& rNewSize);
- void SetLabel( ::rtl::OUString _rText );
+ void SetLabel( const ::rtl::OUString& _rText );
sal_Int32 GetLogicWidth();
::rtl::OUString GetLabel( );
- void SetHyperLabelPosition(sal_uInt16 XPos, sal_uInt16 YPos);
- Point GetLogicalPosition();
-
void ToggleBackgroundColor( const Color& _rGBColor );
void SetInteractive( sal_Bool _bInteractive );
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+
private:
DECL_LINK(ImplClickHdl, HyperLabel*);
- sal_Bool ImplCalcMinimumSize(const Size& _rCompSize );
+ private:
+ using FixedText::CalcMinimumSize;
};
}
diff --git a/svtools/inc/svtools/solar.hrc b/svtools/inc/svtools/solar.hrc
index 348422ef6477..00211573f876 100644
--- a/svtools/inc/svtools/solar.hrc
+++ b/svtools/inc/svtools/solar.hrc
@@ -132,6 +132,8 @@
#define RID_FILTER_START (RID_LIB_START+10200)
#define RID_FILTER_END (RID_LIB_START+10299)
+// do *NOT* add more ranges here, RID_LIB_END is (RID_LIB_START + 10000)
+
#define RID_APP_START 20000
#define RID_APP_END 31999
@@ -144,12 +146,6 @@
#define RID_SD_START (27000)
#define RID_SD_END (27999)
-#define RID_Sa_START (28000)
-#define RID_Sa_END (28999)
-
-#define RID_Sb_START (29000)
-#define RID_Sb_END (29999)
-
#define RID_OBJ_START (30000)
#define RID_OBJ_END (32767)
@@ -191,8 +187,7 @@
#define HID_WIZARD_END (HID_LIB_START+999)
//please note: There is also HID_WIZARD2 below
-#define HID_EXTENSIONS_START (HID_LIB_START+1000)
-#define HID_EXTENSIONS_END (HID_LIB_START+1099)
+// FREE
#define HID_SO2_START (HID_LIB_START+1100)
#define HID_SO2_END (HID_LIB_START+1149)
@@ -308,5 +303,9 @@
#define HID_FORMULA_START (HID_OBJ_START+2081)
#define HID_FORMULA_END (HID_OBJ_START+2280)
+#define HID_EXTENSIONS_START (HID_OBJ_START+2281)
+#define HID_EXTENSIONS_END (HID_OBJ_START+2800)
+
+
#endif
diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx
index 98fddcb7d9e1..e3edd0b681ae 100644
--- a/svtools/inc/svtools/table/tablecontrol.hxx
+++ b/svtools/inc/svtools/table/tablecontrol.hxx
@@ -30,6 +30,8 @@
#include <vcl/ctrl.hxx>
#include <vcl/seleng.hxx>
#include <svtools/table/tabledatawindow.hxx>
+#include <svtools/accessibletable.hxx>
+#include "svtaccessiblefactory.hxx"
//........................................................................
namespace svt { namespace table
@@ -38,6 +40,8 @@ namespace svt { namespace table
class TableControl_Impl;
class TableDataWindow;
+ class AccessibleTableControl_Impl;
+
//====================================================================
//= TableControl
//====================================================================
@@ -55,10 +59,11 @@ namespace svt { namespace table
The control supports the concept of a <em>current</em> (or <em>active</em>
cell).
+ The control supports accessibility, this is encapsulated in IAccessibleTable
// TODO: scrolling?
*/
- class TableControl : public Control
+ class TableControl : public Control, public IAccessibleTable
{
private:
DECL_LINK( ImplMouseButtonDownHdl, MouseEvent* );
@@ -66,6 +71,8 @@ namespace svt { namespace table
TableControl_Impl* m_pImpl;
public:
+ ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable;
+
TableControl( Window* _pParent, WinBits _nStyle );
~TableControl();
@@ -88,11 +95,11 @@ namespace svt { namespace table
if there is no active cell, e.g. because the table does
not contain any rows or columns.
*/
- RowPos GetCurrentRow() const;
+ sal_Int32 GetCurrentRow() const;
/** returns the row, which contains the input point*/
- RowPos GetCurrentRow (const Point& rPoint);
+ ColPos GetCurrentRow (const Point& rPoint);
/** retrieves the current column
@@ -103,7 +110,7 @@ namespace svt { namespace table
if there is no active cell, e.g. because the table does
not contain any rows or columns.
*/
- ColPos GetCurrentColumn() const;
+ sal_Int32 GetCurrentColumn() const;
/** activates the cell at the given position
@@ -113,7 +120,7 @@ namespace svt { namespace table
or impossibility to execute the move at all (for instance because
of invalid coordinates).
*/
- bool GoTo( ColPos _nColumn, RowPos _nRow );
+ bool GoTo( ColPos _nColumnPos, RowPos _nRow);
/** moves the active cell to the given column, by keeping the active row
@@ -147,26 +154,91 @@ namespace svt { namespace table
void InvalidateDataWindow(RowPos _nRowStart, bool _bRemoved);
/**gets the vector, which contains the selected rows
*/
- std::vector<RowPos> getSelectedRows();
+ std::vector<sal_Int32>& GetSelectedRows();
/**after removing a row, updates the vector which contains the selected rows
if the row, which should be removed, is selected, it will be erased from the vector
*/
void removeSelectedRow(RowPos _nRowPos);
SelectionEngine* getSelEngine();
TableDataWindow* getDataWindow();
- // protected:
+
// Window overridables
virtual void GetFocus();
virtual void LoseFocus();
virtual void KeyInput( const KeyEvent& rKEvt );
//virtual long Notify(NotifyEvent& rNEvt);
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual XACC CreateAccessible();
+ virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
+ virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const;
+
+ //// Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow );
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( BOOL bCreate = TRUE );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+ virtual long GetRowCount() const;
+ virtual long GetColumnCount() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual bool IsRowSelected( long _nRow ) const;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE );
+ virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE );
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
+ virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const;
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const;
+ virtual ::rtl::OUString GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual sal_Bool isAccessibleAlive( ) const;
+ virtual void commitGridControlEvent( sal_Int16 _nEventId, const com::sun::star::uno::Any& _rNewValue, const com::sun::star::uno::Any& _rOldValue );
+
+
+ protected:
+ /// retrieves the XAccessible implementation associated with the GridControl instance
+ ::svt::IAccessibleFactory& getAccessibleFactory();
+
private:
TableControl(); // never implemented
TableControl( const TableControl& ); // never implemented
TableControl& operator=( const TableControl& ); // never implemented
};
+ class AccessibleTableControl_Impl
+ {
+ public:
+ AccessibleFactoryAccess m_aFactoryAccess;
+ IAccessibleTableControl* m_pAccessible;
+
+ public:
+ AccessibleTableControl_Impl() : m_pAccessible(NULL)
+ {
+ }
+
+
+ /// @see AccessibleTableControl::getTableRowHeader
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessibleTableHeader( AccessibleTableControlObjType _eObjType );
+ /// @see AccessibleTableControl::getTable
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessibleTable( );
+
+ };
+
//........................................................................
} } // namespace svt::table
//........................................................................
diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx
index a1af1e1750ed..6e74d35b8586 100644
--- a/svtools/inc/svtools/table/tablemodel.hxx
+++ b/svtools/inc/svtools/table/tablemodel.hxx
@@ -434,13 +434,13 @@ namespace svt { namespace table
virtual void setCellContent(std::vector<std::vector<rtl::OUString> > cellContent)=0;
/** gets the content of the cells
*/
- virtual std::vector<std::vector<rtl::OUString> > getCellContent() = 0;
+ virtual std::vector<std::vector<rtl::OUString> >& getCellContent() = 0;
/**sets title of header rows
*/
virtual void setRowHeaderName(std::vector<rtl::OUString> cellColumnContent)=0;
/** gets title of header rows
*/
- virtual std::vector<rtl::OUString> getRowHeaderName() = 0;
+ virtual std::vector<rtl::OUString>& getRowHeaderName() = 0;
/// destroys the table model instance
virtual ~ITableModel() { }