summaryrefslogtreecommitdiff
path: root/svtools/inc/svtools/table/tablecontrol.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/inc/svtools/table/tablecontrol.hxx')
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx165
1 files changed, 74 insertions, 91 deletions
diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx
index 28ac3583bd5a..8afc2209227c 100644
--- a/svtools/inc/svtools/table/tablecontrol.hxx
+++ b/svtools/inc/svtools/table/tablecontrol.hxx
@@ -28,13 +28,16 @@
#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
#include "svtools/svtdllapi.h"
-#include <svtools/table/tablemodel.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/accessibletable.hxx"
+#include "svtools/accessiblefactory.hxx"
+
#include <vcl/ctrl.hxx>
#include <vcl/seleng.hxx>
-#include <svtools/table/tabledatawindow.hxx>
-#include <svtools/accessibletable.hxx>
-#include <com/sun/star/util/Color.hpp>
-#include <svtools/accessiblefactory.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace svt { namespace table
@@ -42,8 +45,6 @@ namespace svt { namespace table
//........................................................................
class TableControl_Impl;
- class TableDataWindow;
- class AccessibleTableControl_Impl;
//====================================================================
//= TableControl
@@ -63,31 +64,19 @@ 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 SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
{
private:
- DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
- DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+ ::boost::shared_ptr< TableControl_Impl > m_pImpl;
- DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
- TableControl_Impl* m_pImpl;
- ::com::sun::star::uno::Sequence< sal_Int32 > m_nCols;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aText;
- Link m_aSelectHdl;
- bool m_bSelectionChanged;
- bool m_bTooltip;
public:
- ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable;
-
TableControl( Window* _pParent, WinBits _nStyle );
~TableControl();
/// sets a new table model
- SVT_DLLPRIVATE void SetModel( PTableModel _pModel );
+ void SetModel( PTableModel _pModel );
/// retrieves the current table model
PTableModel GetModel() const;
@@ -107,9 +96,8 @@ namespace svt { namespace table
*/
sal_Int32 GetCurrentRow() const;
- /** returns the row, which contains the input point*/
-
- ColPos GetCurrentRow (const Point& rPoint);
+ ITableControl&
+ getTableControlInterface();
/** retrieves the current column
@@ -125,7 +113,7 @@ namespace svt { namespace table
/** activates the cell at the given position
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -135,7 +123,7 @@ namespace svt { namespace table
/** moves the active cell to the given column, by keeping the active row
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -148,7 +136,7 @@ namespace svt { namespace table
/** moves the active cell to the given row, by keeping the active column
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -157,22 +145,17 @@ namespace svt { namespace table
{
return GoTo( GetCurrentColumn(), _nRow );
}
- SVT_DLLPRIVATE virtual void Resize();
- virtual void Select();
- SVT_DLLPRIVATE void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return m_aSelectHdl; }
- /**invalidates the table if table has been changed e.g. new row added
- */
- void InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved);
- /**gets the vector, which contains the selected rows
- */
- 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
- */
- SelectionEngine* getSelEngine();
- TableDataWindow* getDataWindow();
+ SVT_DLLPRIVATE virtual void Resize();
+ virtual void Select();
+ void SetSelectHdl( const Link& rLink );
+ const Link& GetSelectHdl() const;
+
+ /**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
+ */
+ SelectionEngine* getSelEngine();
+ Window& getDataWindow();
// Window overridables
virtual void GetFocus();
@@ -180,55 +163,55 @@ namespace svt { namespace table
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void StateChanged( StateChangedType i_nStateChange );
- /** Creates and returns the accessible object of the whole GridControl. */
- SVT_DLLPRIVATE virtual XACC CreateAccessible();
- SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
- SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
- SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
- SVT_DLLPRIVATE 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 ) const;
- virtual void GrabFocus();
- virtual XACC GetAccessible( sal_Bool bCreate = sal_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, sal_Bool _bOnScreen = sal_True );
- virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_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 ::com::sun::star::uno::Any 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 );
- virtual void RemoveSelectedRow(RowPos _nRowPos);
- virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
- ::com::sun::star::uno::Sequence< sal_Int32 >& getColumnsForTooltip();
- ::com::sun::star::uno::Sequence< ::rtl::OUString >& getTextForTooltip();
- void setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols);
- void clearSelection();
- void selectionChanged(bool _bChanged);
- bool isTooltip();
-
- protected:
- /// retrieves the XAccessible implementation associated with the GridControl instance
- ::svt::IAccessibleFactory& getAccessibleFactory();
+ /** Creates and returns the accessible object of the whole GridControl. */
+ SVT_DLLPRIVATE virtual XACC CreateAccessible();
+ SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const;
+
+ // .............................................................................................................
+ // IAccessibleTable
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_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_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_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 ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select );
+ virtual void SelectAllRows( bool const i_select );
+ // .............................................................................................................
+
+ private:
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
private:
TableControl(); // never implemented