diff options
Diffstat (limited to 'svtools/inc/svtools')
-rwxr-xr-x[-rw-r--r--] | svtools/inc/svtools/accessibletable.hxx | 9 | ||||
-rw-r--r-- | svtools/inc/svtools/table/abstracttablecontrol.hxx | 18 | ||||
-rw-r--r-- | svtools/inc/svtools/table/defaultinputhandler.hxx | 1 | ||||
-rw-r--r-- | svtools/inc/svtools/table/gridtablerenderer.hxx | 8 | ||||
-rw-r--r-- | svtools/inc/svtools/table/tablecontrol.hxx | 152 | ||||
-rw-r--r-- | svtools/inc/svtools/table/tabledatawindow.hxx | 12 | ||||
-rw-r--r-- | svtools/inc/svtools/table/tablemodel.hxx | 108 | ||||
-rw-r--r-- | svtools/inc/svtools/table/tablerenderer.hxx | 44 | ||||
-rw-r--r-- | svtools/inc/svtools/table/tabletypes.hxx | 10 |
9 files changed, 215 insertions, 147 deletions
diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx index b08a7f04f1da..7098d2b0d4ef 100644..100755 --- a/svtools/inc/svtools/accessibletable.hxx +++ b/svtools/inc/svtools/accessibletable.hxx @@ -94,9 +94,8 @@ public: 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, + the accessible object), depending on the specified object type. */ + virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet, AccessibleTableControlObjType eObjType ) const= 0; // Window @@ -122,8 +121,10 @@ public: 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 ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; virtual std::vector<sal_Int32>& GetSelectedRows() = 0; + virtual void RemoveSelectedRow(sal_Int32 _nRowPos) = 0; + virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) = 0; }; // ---------------------------------------------------------------------------- diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx index 8e92abc6c04c..2b3951f6aaf3 100644 --- a/svtools/inc/svtools/table/abstracttablecontrol.hxx +++ b/svtools/inc/svtools/table/abstracttablecontrol.hxx @@ -30,6 +30,7 @@ #include <sal/types.h> #include <vcl/event.hxx> #include <vcl/seleng.hxx> +#include "tabletypes.hxx" //........................................................................ namespace svt { namespace table { @@ -112,14 +113,15 @@ namespace svt { namespace table @see TableControlAction */ virtual bool dispatchAction( TableControlAction _eAction ) = 0; - /** to be called on mouse button up/down - @return - <TRUE/> if the click was in the visible area of the table control, - <FALSE/> otherwise.*/ - virtual bool isClickInVisibleArea( const Point& _rPoint ) = 0; - /** returns selection engine*/ - virtual SelectionEngine* getSelEngine() = 0; - virtual void setCursorAtCurrentCell(const Point& rPoint) = 0; + /** returns selection engine*/ + virtual SelectionEngine* getSelEngine() = 0; + virtual void setCursorAtCurrentCell(const Point& rPoint) = 0; + virtual rtl::OUString& setTooltip(const Point& rPoint ) = 0; + virtual RowPos getCurrentRow(const Point& rPoint ) = 0; + virtual void resizeColumn(const Point& rPoint ) = 0; + virtual bool startResizeColumn(const Point& rPoint) = 0; + virtual bool endResizeColumn(const Point& rPoint) = 0; + virtual bool isRowSelected(RowPos _nRow) = 0; virtual ~IAbstractTableControl() {}; }; diff --git a/svtools/inc/svtools/table/defaultinputhandler.hxx b/svtools/inc/svtools/table/defaultinputhandler.hxx index b9e2db31ca01..ca760896d539 100644 --- a/svtools/inc/svtools/table/defaultinputhandler.hxx +++ b/svtools/inc/svtools/table/defaultinputhandler.hxx @@ -44,6 +44,7 @@ namespace svt { namespace table friend class TableDataWindow; private: DefaultInputHandler_Impl* m_pImpl; + bool m_bResize; public: DefaultInputHandler(); diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx index 13d44617d523..e474306c0423 100644 --- a/svtools/inc/svtools/table/gridtablerenderer.hxx +++ b/svtools/inc/svtools/table/gridtablerenderer.hxx @@ -90,10 +90,14 @@ namespace svt { namespace table bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, rtl::OUString& _rText ); - virtual void PaintCell( ColPos _nColumn, + virtual void PaintCellImage( ColPos _nColumn, bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, - const StyleSettings& _rStyle, rtl::OUString& _rText ); + const StyleSettings& _rStyle, Image* _pCellData ); + virtual void PaintCellString( ColPos _nColumn, + bool _bActive, bool _bSelected, + OutputDevice& _rDevice, const Rectangle& _rArea, + const StyleSettings& _rStyle, rtl::OUString& _rText ); virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect); virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect); }; diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx index c1381e3b3c0b..313b2b7b7735 100644 --- a/svtools/inc/svtools/table/tablecontrol.hxx +++ b/svtools/inc/svtools/table/tablecontrol.hxx @@ -27,12 +27,14 @@ #ifndef SVTOOLS_INC_TABLE_TABLECONTROL_HXX #define SVTOOLS_INC_TABLE_TABLECONTROL_HXX +#include "svtools/svtdllapi.h" #include <svtools/table/tablemodel.hxx> #include <vcl/ctrl.hxx> #include <vcl/seleng.hxx> #include <svtools/table/tabledatawindow.hxx> #include <svtools/accessibletable.hxx> -#include "svtaccessiblefactory.hxx" +#include <com/sun/star/util/Color.hpp> +#include <svtools/accessiblefactory.hxx> //........................................................................ namespace svt { namespace table @@ -64,13 +66,19 @@ namespace svt { namespace table // TODO: scrolling? */ - class TableControl : public Control, public IAccessibleTable + class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable { private: - DECL_LINK( ImplMouseButtonDownHdl, MouseEvent* ); - DECL_LINK( ImplMouseButtonUpHdl, MouseEvent* ); + DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* ); + DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* ); + + 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; public: ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable; @@ -78,7 +86,7 @@ namespace svt { namespace table ~TableControl(); /// sets a new table model - void SetModel( PTableModel _pModel ); + SVT_DLLPRIVATE void SetModel( PTableModel _pModel ); /// retrieves the current table model PTableModel GetModel() const; @@ -148,65 +156,72 @@ namespace svt { namespace table { return GoTo( GetCurrentColumn(), _nRow ); } - virtual void Resize(); + 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, 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 - */ - void removeSelectedRow(RowPos _nRowPos); - SelectionEngine* getSelEngine(); - TableDataWindow* getDataWindow(); + /**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(); // 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 ); + //virtual long Notify(NotifyEvent& rNEvt); + + /** 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 ); + 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 ::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); + ::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 selectionChanged(bool _bChanged); protected: @@ -219,27 +234,6 @@ namespace svt { namespace table 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/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx index d14a25289c99..c9f96483d943 100644 --- a/svtools/inc/svtools/table/tabledatawindow.hxx +++ b/svtools/inc/svtools/table/tabledatawindow.hxx @@ -53,21 +53,27 @@ namespace svt { namespace table private: TableControl_Impl& m_rTableControl; Link m_aMouseButtonDownHdl; - Link m_aMouseButtonUpHdl; - + Link m_aMouseButtonUpHdl; + Link m_aSelectHdl; + RowPos m_nRowAlreadySelected; public: TableDataWindow( TableControl_Impl& _rTableControl ); inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; } inline const Link& GetMouseButtonDownHdl() const { return m_aMouseButtonDownHdl; } inline void SetMouseButtonUpHdl( const Link& rLink ) { m_aMouseButtonUpHdl = rLink; } inline const Link& GetMouseButtonUpHdl() const { return m_aMouseButtonUpHdl; } + inline void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; } + inline const Link& GetSelectHdl() const { return m_aSelectHdl; } // Window overridables virtual void Paint( const Rectangle& rRect ); virtual void MouseMove( const MouseEvent& rMEvt); virtual void MouseButtonDown( const MouseEvent& rMEvt); virtual void MouseButtonUp( const MouseEvent& rMEvt); - + virtual void SetPointer( const Pointer& rPointer ); + virtual void CaptureMouse(); + virtual void ReleaseMouse(); + virtual long Notify(NotifyEvent& rNEvt); }; //........................................................................ } } // namespace svt::table diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx index 34a89cb03e6b..3da396d9d86c 100644 --- a/svtools/inc/svtools/table/tablemodel.hxx +++ b/svtools/inc/svtools/table/tablemodel.hxx @@ -27,13 +27,16 @@ #ifndef SVTOOLS_INC_TABLE_TABLEMODEL_HXX #define SVTOOLS_INC_TABLE_TABLEMODEL_HXX +#include "svtools/svtdllapi.h" #include <svtools/table/tabletypes.hxx> #include <svtools/table/tablerenderer.hxx> #include <svtools/table/tableinputhandler.hxx> - +#include <rtl/ref.hxx> #include <sal/types.h> - +#include <com/sun/star/util/Color.hpp> #include <boost/shared_ptr.hpp> +#include <com/sun/star/style/VerticalAlignment.hpp> +#include <com/sun/star/style/HorizontalAlignment.hpp> //........................................................................ namespace svt { namespace table @@ -44,21 +47,16 @@ namespace svt { namespace table //==================================================================== //= cell data //==================================================================== - struct CellEntryType + struct TableContentType { - String m_aStr; - //Image m_aImage; - //Control m_aControl; - CellEntryType( const String& _rStr ) : - m_aStr( _rStr ) - {} + ::rtl::OUString sContent; + Image* pImage; + TableContentType() : + sContent(), + pImage( ) + { + } }; - - //typedef ::std::vector<CellEntryType*> CellColumnContent; - //vector, which contains text data for each cell - typedef ::std::vector<String> CellColumnContent; - //vector, which contains data for rows - typedef ::std::vector<CellColumnContent> CellContent; //==================================================================== //= ScrollbarVisibility //==================================================================== @@ -285,7 +283,24 @@ namespace svt { namespace table */ virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0; + /** returns the preferred width of the column, or 0 if the column + does not have a preferred width. + + @see setMaxWidth + @see getMinWidth + @see getWidth + */ + virtual TableMetrics getPreferredWidth() const = 0; + /** sets the preferred width of the column, to be used when user resizes column + + @see getMaxWidth + @see setMinWidth + @see setWidth + */ + virtual void setPreferredWidth( TableMetrics _nPrefWidth ) = 0; + virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0; + virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) = 0; /// deletes the column model instance virtual ~IColumnModel() { } }; @@ -296,7 +311,7 @@ namespace svt { namespace table //==================================================================== /** declares the interface to implement by an abtract table model */ - class SAL_NO_VTABLE ITableModel + class SAL_NO_VTABLE SVT_DLLPUBLIC ITableModel { public: /** returns the number of columns in the table @@ -307,8 +322,8 @@ namespace svt { namespace table */ virtual TableSize getRowCount() const = 0; - virtual void setColumnCount(TableSize _nColCount) = 0; - virtual void setRowCount(TableSize _nRowCount) = 0; + SVT_DLLPRIVATE virtual void setColumnCount(TableSize _nColCount) = 0; + SVT_DLLPRIVATE virtual void setRowCount(TableSize _nRowCount) = 0; /** determines whether the table has column headers @@ -321,12 +336,12 @@ namespace svt { namespace table /** sets whether the table should have row headers @see IColumnRenderer */ - virtual void setRowHeaders( bool rowHeaders) = 0; + SVT_DLLPRIVATE virtual void setRowHeaders( bool rowHeaders) = 0; /** sets whether the table should have column headers @see IColumnRenderer */ - virtual void setColumnHeaders( bool columnHeaders) = 0; + SVT_DLLPRIVATE virtual void setColumnHeaders( bool columnHeaders) = 0; /** determines whether the table has row headers @@ -346,11 +361,11 @@ namespace svt { namespace table /** adds the given listener to the list of ->ITableModelListener's */ - virtual void addTableModelListener( const PTableModelListener& listener ) = 0; + SVT_DLLPRIVATE virtual void addTableModelListener( const PTableModelListener& listener ) = 0; /** revokes the given listener from the list of ->ITableModelListener's */ - virtual void removeTableModelListener( const PTableModelListener& listener ) = 0; + SVT_DLLPRIVATE virtual void removeTableModelListener( const PTableModelListener& listener ) = 0; /** returns a model for a certain column @@ -380,7 +395,7 @@ namespace svt { namespace table @return the renderer to use. Must not be <NULL/> */ - virtual PTableRenderer getRenderer() const = 0; + SVT_DLLPRIVATE virtual PTableRenderer getRenderer() const = 0; /** returns the component handling input in a view associated with the model */ @@ -392,9 +407,9 @@ namespace svt { namespace table the logical height of rows in the table, in 1/100 millimeters. The height must be greater 0. */ - virtual TableMetrics getRowHeight() const = 0; + SVT_DLLPRIVATE virtual TableMetrics getRowHeight() const = 0; - virtual void setRowHeight(TableMetrics _nRowHeight) = 0; + SVT_DLLPRIVATE virtual void setRowHeight(TableMetrics _nRowHeight) = 0; /** determines the height of the column header row @@ -405,7 +420,7 @@ namespace svt { namespace table the logical height of the column header row, in 1/100 millimeters. Must be greater than 0. */ - virtual TableMetrics getColumnHeaderHeight() const = 0; + SVT_DLLPRIVATE virtual TableMetrics getColumnHeaderHeight() const = 0; /** determines the width of the row header column @@ -416,7 +431,7 @@ namespace svt { namespace table the logical width of the row header column, in 1/100 millimeters. Must be greater than 0. */ - virtual TableMetrics getRowHeaderWidth() const = 0; + SVT_DLLPRIVATE virtual TableMetrics getRowHeaderWidth() const = 0; /** determines the visibility of the vertical scrollbar of the table control @param overAllHeight the height of the table with all rows @@ -429,19 +444,32 @@ namespace svt { namespace table @param actWidth the given width of the table */ virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const = 0; - - /** fills cells with content - */ - 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; - /**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 bool hasVerticalScrollbar() =0; + virtual bool hasHorizontalScrollbar() = 0; + /** fills cells with content + */ + virtual void setCellContent(const std::vector< std::vector< ::com::sun::star::uno::Any > >& cellContent)=0; + /** gets the content of the cells + */ + virtual std::vector< std::vector< ::com::sun::star::uno::Any > >& getCellContent() = 0; + /**sets title of header rows + */ + SVT_DLLPRIVATE virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)=0; + /** gets title of header rows + */ + virtual std::vector<rtl::OUString>& getRowHeaderName() = 0; + SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getLineColor() = 0; + SVT_DLLPRIVATE virtual void setLineColor(::com::sun::star::util::Color _rColor) = 0; + SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getHeaderBackgroundColor() = 0; + SVT_DLLPRIVATE virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor) = 0; + SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getTextColor() = 0; + SVT_DLLPRIVATE virtual void setTextColor(::com::sun::star::util::Color _rColor) = 0; + SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getOddRowBackgroundColor() = 0; + SVT_DLLPRIVATE virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0; + SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getEvenRowBackgroundColor() = 0; + SVT_DLLPRIVATE virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0; + SVT_DLLPRIVATE virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() = 0; + SVT_DLLPRIVATE virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _xAlign) = 0; /// destroys the table model instance virtual ~ITableModel() { } diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx index cf8cd20680c2..f81771dd22e6 100644 --- a/svtools/inc/svtools/table/tablerenderer.hxx +++ b/svtools/inc/svtools/table/tablerenderer.hxx @@ -45,7 +45,7 @@ namespace svt { namespace table */ class SAL_NO_VTABLE ITableRenderer { - public: + public: /** paints a (part of) header area There are two header areas in a table control: @@ -178,10 +178,9 @@ namespace svt { namespace table @param _rText the title of the header row */ - virtual void PaintRowHeader( - bool _bActive, bool _bSelected, + virtual void PaintRowHeader( bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, - const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0; + const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0; /** paints a certain cell @@ -208,13 +207,46 @@ namespace svt { namespace table the are into which the cell should be painted @param _rStyle the style to be used for drawing + @param _pCellData + the content of the cell + */ + virtual void PaintCellImage( ColPos _nColumn, + bool _bActive, bool _bSelected, + OutputDevice& _rDevice, const Rectangle& _rArea, + const StyleSettings& _rStyle, Image* _pCellData ) = 0; + + /** paints a certain cell + + The row to be painted is denoted by the most recent call to + ->PrepareRow. + + @param _bSelected + <TRUE/> if and only if the cell to be painted is + selected currently. This is the case if either + the row or the column of the cell is currently selected. + <br/> + Note that this flag is equal to the respective flag in the + previous ->PrepareRow call, it's passed here for convinience + only. + @param _bActive + <TRUE/> if the cell is currently active. + <br/> + Note that this flag is equal to the respective flag in the + previous ->PrepareRow call, it's passed here for convinience + only. + @param _rDevice + denotes the device to paint onto + @param _rArea + the are into which the cell should be painted + @param _rStyle + the style to be used for drawing @param _rText the content of the cell */ - virtual void PaintCell( ColPos _nColumn, + virtual void PaintCellString( ColPos _nColumn, bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, - const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0; + const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0; /** draws a cell cursor in the given rectangle diff --git a/svtools/inc/svtools/table/tabletypes.hxx b/svtools/inc/svtools/table/tabletypes.hxx index f423b64c2faa..645120e30d4b 100644 --- a/svtools/inc/svtools/table/tabletypes.hxx +++ b/svtools/inc/svtools/table/tabletypes.hxx @@ -56,17 +56,17 @@ namespace svt { namespace table /** special column width value which indicates that the column should be automatically resized to fit the view */ -#define COLWIDTH_FIT_TO_VIEW ((TableMetrics)-1) +#define COLWIDTH_FIT_TO_VIEW ((::svt::table::TableMetrics)-1) /// denotes the column containing the row headers -#define COL_ROW_HEADERS ((ColPos)-1) +#define COL_ROW_HEADERS ((::svt::table::ColPos)-1) /// denotes the row containing the column headers -#define ROW_COL_HEADERS ((RowPos)-1) +#define ROW_COL_HEADERS ((::svt::table::RowPos)-1) /// denotes an invalid column index -#define COL_INVALID ((ColPos)-2) +#define COL_INVALID ((::svt::table::ColPos)-2) /// denotes an invalid row index -#define ROW_INVALID ((RowPos)-2) +#define ROW_INVALID ((::svt::table::RowPos)-2) //........................................................................ |