summaryrefslogtreecommitdiff
path: root/svtools/inc
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/inc')
-rw-r--r--svtools/inc/docmspasswdrequest.hxx72
-rw-r--r--svtools/inc/pch/precompiled_svtools.hxx1
-rw-r--r--svtools/inc/svtools/optionsdrawinglayer.hxx9
-rw-r--r--svtools/inc/svtools/svlbox.hxx3
-rw-r--r--svtools/inc/svtools/table/abstracttablecontrol.hxx130
-rw-r--r--svtools/inc/svtools/table/defaultinputhandler.hxx67
-rw-r--r--svtools/inc/svtools/table/gridtablerenderer.hxx103
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx174
-rw-r--r--svtools/inc/svtools/table/tabledatawindow.hxx75
-rw-r--r--svtools/inc/svtools/table/tableinputhandler.hxx77
-rw-r--r--svtools/inc/svtools/table/tablemodel.hxx454
-rw-r--r--svtools/inc/svtools/table/tablerenderer.hxx241
-rw-r--r--svtools/inc/svtools/table/tabletypes.hxx75
13 files changed, 1481 insertions, 0 deletions
diff --git a/svtools/inc/docmspasswdrequest.hxx b/svtools/inc/docmspasswdrequest.hxx
new file mode 100644
index 000000000000..684bffe71760
--- /dev/null
+++ b/svtools/inc/docmspasswdrequest.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009.
+ * Copyright 2009 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: docmspasswdrequest.hxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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 INCLUDED_SVTOOLS_DOCMSPASSWDREQUEST_HXX
+#define INCLUDED_SVTOOLS_DOCMSPASSWDREQUEST_HXX
+
+#include "svtools/svldllapi.h"
+#include <com/sun/star/task/DocumentMSPasswordRequest.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <rtl/ustring.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+class MSAbortContinuation;
+class MSPasswordContinuation;
+
+class SVL_DLLPUBLIC RequestMSDocumentPassword : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest >
+{
+ ::com::sun::star::uno::Any m_aRequest;
+
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >
+ > m_lContinuations;
+
+ MSAbortContinuation* m_pAbort;
+ MSPasswordContinuation* m_pPassword;
+
+public:
+ RequestMSDocumentPassword( ::com::sun::star::task::PasswordRequestMode nMode, ::rtl::OUString aName );
+
+ sal_Bool isAbort();
+ sal_Bool isPassword();
+
+ ::rtl::OUString getPassword();
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >
+ > SAL_CALL getContinuations()
+ throw( ::com::sun::star::uno::RuntimeException );
+};
+
+#endif /* INCLUDED_SVTOOLS_DOCMSPASSWDREQUEST_HXX */
diff --git a/svtools/inc/pch/precompiled_svtools.hxx b/svtools/inc/pch/precompiled_svtools.hxx
index 440bd04dce36..cab81cac04ec 100644
--- a/svtools/inc/pch/precompiled_svtools.hxx
+++ b/svtools/inc/pch/precompiled_svtools.hxx
@@ -227,6 +227,7 @@
#include <com/sun/star/system/XProxySettings.hpp>
#include <com/sun/star/system/XSystemShellExecute.hpp>
#include <com/sun/star/task/DocumentPasswordRequest.hpp>
+#include <com/sun/star/task/DocumentMSPasswordRequest.hpp>
#include <com/sun/star/task/MasterPasswordRequest.hpp>
#include <com/sun/star/task/NoMasterException.hpp>
#include <com/sun/star/task/PasswordRequestMode.hpp>
diff --git a/svtools/inc/svtools/optionsdrawinglayer.hxx b/svtools/inc/svtools/optionsdrawinglayer.hxx
index e0b287002f34..120cccfa4232 100644
--- a/svtools/inc/svtools/optionsdrawinglayer.hxx
+++ b/svtools/inc/svtools/optionsdrawinglayer.hxx
@@ -190,6 +190,15 @@ class SVL_DLLPUBLIC SvtOptionsDrawinglayer
void SetQuadratic3DRenderLimit(sal_uInt32 nNew);
void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew);
+ // #i97672# selection settings
+ sal_Bool IsTransparentSelection() const;
+ sal_uInt16 GetTransparentSelectionPercent() const;
+ sal_uInt16 GetSelectionMaximumLuminancePercent() const;
+
+ void SetTransparentSelection( sal_Bool bState );
+ void SetTransparentSelectionPercent( sal_uInt16 nPercent );
+ void SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent );
+
//-------------------------------------------------------------------------------------------------------------
// private methods
//-------------------------------------------------------------------------------------------------------------
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx
index ba119263eff8..7371c2feee05 100644
--- a/svtools/inc/svtools/svlbox.hxx
+++ b/svtools/inc/svtools/svlbox.hxx
@@ -328,6 +328,9 @@ protected:
// wird an der Target-View aufgerufen (im Drop-Handler)
virtual void ReadDragServerInfo( const Point&,SvLBoxDDInfo* );
+ // invalidate children on enable/disable
+ virtual void StateChanged( StateChangedType );
+
virtual ULONG Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,ULONG nPos=LIST_APPEND);
virtual ULONG Insert( SvLBoxEntry* pEntry,ULONG nRootPos = LIST_APPEND );
void InsertTree( SvLBoxEntry* pTree, SvLBoxEntry* pTarget) {pModel->InsertTree( pTree, pTarget ); }
diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx
new file mode 100644
index 000000000000..03bc0a999f7a
--- /dev/null
+++ b/svtools/inc/svtools/table/abstracttablecontrol.hxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+#include <sal/types.h>
+#include <vcl/event.hxx>
+#include <vcl/seleng.hxx>
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom,
+
+
+ /// invalid and final enumeration value, not to be actually used
+ invalidTableControlAction
+ };
+
+ //====================================================================
+ //= IAbstractTableControl
+ //====================================================================
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE IAbstractTableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @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;
+
+ virtual ~IAbstractTableControl() {};
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/defaultinputhandler.hxx b/svtools/inc/svtools/table/defaultinputhandler.hxx
new file mode 100644
index 000000000000..eb1c14b43a85
--- /dev/null
+++ b/svtools/inc/svtools/table/defaultinputhandler.hxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+
+#include <svtools/table/tableinputhandler.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ struct DefaultInputHandler_Impl;
+
+ //====================================================================
+ //= DefaultInputHandler
+ //====================================================================
+ class DefaultInputHandler : public ITableInputHandler
+ {
+ friend class TableDataWindow;
+ private:
+ DefaultInputHandler_Impl* m_pImpl;
+
+ public:
+ DefaultInputHandler();
+ ~DefaultInputHandler();
+
+ virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt );
+ virtual bool GetFocus ( IAbstractTableControl& _rControl );
+ virtual bool LoseFocus ( IAbstractTableControl& _rControl );
+ virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt );
+ virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt );
+ virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx
new file mode 100644
index 000000000000..a935f6b7386e
--- /dev/null
+++ b/svtools/inc/svtools/table/gridtablerenderer.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_GRIDTABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+
+#include <svtools/table/tablemodel.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ struct GridTableRenderer_Impl;
+
+ //====================================================================
+ //= GridTableRenderer
+ //====================================================================
+ /** a default implementation for the ->ITableRenderer interface
+
+ This class is able to paint a table grid, table headers, and cell
+ backgrounds according to the selected/active state of cells.
+
+ TODO update the documentation when it's decided whether this renderer
+ also does value handling
+ */
+ class GridTableRenderer : public ITableRenderer
+ {
+ private:
+ GridTableRenderer_Impl* m_pImpl;
+
+ public:
+ /** creates a table renderer associated with the given model
+
+ @param _rModel
+ the model which should be rendered. The caller is responsible
+ for lifetime control, that is, the model instance must live
+ at least as long as the renderer instance lives
+ */
+ GridTableRenderer( ITableModel& _rModel );
+ ~GridTableRenderer();
+
+ /** returns the index of the row currently being painted
+
+ According to the ->ITableRenderer interface, one call is made
+ to the renderer with a row to prepare (->PrepareRow()), and subsequent
+ calls do not carry the row index anymore, but are relative to the
+ row which has previously been prepared.
+
+ This method returns the index of the last row which has been prepared
+ */
+ RowPos getCurrentRow();
+
+ protected:
+ // ITableRenderer overridables
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintRowHeader(
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText );
+ virtual void PaintCell( 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);
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx
new file mode 100644
index 000000000000..98fddcb7d9e1
--- /dev/null
+++ b/svtools/inc/svtools/table/tablecontrol.hxx
@@ -0,0 +1,174 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_TABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+
+#include <svtools/table/tablemodel.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+#include <svtools/table/tabledatawindow.hxx>
+//........................................................................
+
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+ class TableDataWindow;
+ //====================================================================
+ //= TableControl
+ //====================================================================
+ /** a basic control which manages table-like data, i.e. a number of cells
+ organized in <code>m</code> rows and <code>n</code> columns.
+
+ The control itself does not do any assumptions about the concrete data
+ it displays, this is encapsulated in an instance supporting the
+ ->ITableModel interface.
+
+ Also, the control does not do any assumptions about how the model's
+ content is rendered. This is the responsibility of a component
+ supporting the ->ITableRenderer interface (the renderer is obtained from
+ the model).
+
+ The control supports the concept of a <em>current</em> (or <em>active</em>
+ cell).
+
+ // TODO: scrolling?
+ */
+ class TableControl : public Control
+ {
+ private:
+ DECL_LINK( ImplMouseButtonDownHdl, MouseEvent* );
+ DECL_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+
+ TableControl_Impl* m_pImpl;
+ public:
+ TableControl( Window* _pParent, WinBits _nStyle );
+ ~TableControl();
+
+ /// sets a new table model
+ void SetModel( PTableModel _pModel );
+ /// retrieves the current table model
+ PTableModel GetModel() const;
+
+ /// returns the top row, i.e. the first visible row
+ RowPos GetTopRow() const;
+ /// sets a new top row. The top row is the first visible row in the control
+ void SetTopRow( RowPos _nRow );
+
+ /** retrieves the current row
+
+ The current row is the one which contains the active cell.
+
+ @return
+ the row index of the active cell, or ->ROW_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ RowPos GetCurrentRow() const;
+
+ /** returns the row, which contains the input point*/
+
+ RowPos GetCurrentRow (const Point& rPoint);
+
+ /** retrieves the current column
+
+ The current col is the one which contains the active cell.
+
+ @return
+ the column index of the active cell, or ->COL_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ ColPos GetCurrentColumn() const;
+
+ /** activates the cell at the given position
+
+ @return
+ <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).
+ */
+ bool GoTo( ColPos _nColumn, RowPos _nRow );
+
+ /** moves the active cell to the given column, by keeping the active row
+
+ @return
+ <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).
+ */
+ inline bool GoToColumn( ColPos _nColumn )
+ {
+ return GoTo( _nColumn, GetCurrentRow() );
+ }
+
+ /** moves the active cell to the given row, by keeping the active column
+
+ @return
+ <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).
+ */
+ bool GoToRow( RowPos _nRow )
+ {
+ return GoTo( GetCurrentColumn(), _nRow );
+ }
+ virtual void Resize();
+
+ /**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<RowPos> 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);
+
+ private:
+ TableControl(); // never implemented
+ TableControl( const TableControl& ); // never implemented
+ TableControl& operator=( const TableControl& ); // never implemented
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx
new file mode 100644
index 000000000000..fddbfdcd4a3c
--- /dev/null
+++ b/svtools/inc/svtools/table/tabledatawindow.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+#define SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#include <vcl/seleng.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+ class TableFunctionSet;
+
+
+ //====================================================================
+ //= TableDataWindow
+ //====================================================================
+ /** the window containing the content area (including headers) of
+ a table control
+ */
+ class TableDataWindow : public Window
+ {
+ friend class TableFunctionSet;
+ private:
+ TableControl_Impl& m_rTableControl;
+ Link m_aMouseButtonDownHdl;
+ Link m_aMouseButtonUpHdl;
+
+ 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; }
+
+ // 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);
+
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
diff --git a/svtools/inc/svtools/table/tableinputhandler.hxx b/svtools/inc/svtools/table/tableinputhandler.hxx
new file mode 100644
index 000000000000..c0d3a2b5c18a
--- /dev/null
+++ b/svtools/inc/svtools/table/tableinputhandler.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_TABLEINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+
+#include <boost/shared_ptr.hpp>
+
+class MouseEvent;
+class KeyEvent;
+class HelpEvent;
+class CommandEvent;
+class NotifyEvent;
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class IAbstractTableControl;
+
+ //====================================================================
+ //= ITableInputHandler
+ //====================================================================
+ /** interface for components handling input in a ->TableControl
+ */
+ class ITableInputHandler
+ {
+ public:
+ // all those methods have the same semantics as the equal-named methods of ->Window,
+ // with the additional option to return a boolean value indicating whether
+ // the event should be further processed by the ->Window implementations (<FALSE/>),
+ // or whether it has been sufficiently handled by the ->ITableInputHandler instance
+ // (<FALSE/>).
+
+ virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( IAbstractTableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( IAbstractTableControl& _rControl ) = 0;
+ virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt ) = 0;
+ virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt ) = 0;
+ virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+
+ virtual ~ITableInputHandler() { }
+ };
+ typedef ::boost::shared_ptr< ITableInputHandler > PTableInputHandler;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx
new file mode 100644
index 000000000000..a1af1e1750ed
--- /dev/null
+++ b/svtools/inc/svtools/table/tablemodel.hxx
@@ -0,0 +1,454 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_TABLEMODEL_HXX
+#define SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+
+#include <svtools/table/tabletypes.hxx>
+#include <svtools/table/tablerenderer.hxx>
+#include <svtools/table/tableinputhandler.hxx>
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+
+ //====================================================================
+ //= cell data
+ //====================================================================
+ struct CellEntryType
+ {
+ String m_aStr;
+ //Image m_aImage;
+ //Control m_aControl;
+ CellEntryType( const String& _rStr ) :
+ m_aStr( _rStr )
+ {}
+ };
+
+ //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
+ //====================================================================
+ enum ScrollbarVisibility
+ {
+ /** enumeration value denoting that a scrollbar should never be visible, even
+ if needed normally
+ */
+ ScrollbarShowNever,
+ /** enumeration value denoting that a scrollbar should be visible when needed only
+ */
+ ScrollbarShowSmart,
+ /** enumeration value denoting that a scrollbar should always be visible, even
+ if not needed normally
+ */
+ ScrollbarShowAlways
+ };
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
+ /** declares an interface to be implemented by components interested in
+ changes in an ->ITableModel
+ */
+ class SAL_NO_VTABLE ITableModelListener
+ {
+ public:
+ //virtual void onTableModelChanged(PTableModel pTableModel) = 0;
+ /** notifies the listener that one or more rows have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsInserted( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more rows have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsRemoved( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void columnsInserted( ColPos first, ColPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void columnsRemoved( ColPos first, ColPos last ) = 0;
+
+ /** notifies the listener that a column in the table has moved
+
+ @param oldIndex
+ the old index of the column within the model
+ @param newIndex
+ the new index of the column within the model
+ */
+ virtual void columnMoved( ColPos oldIndex, ColPos newIndex ) = 0;
+
+ /** notifies the listener that a rectangular cell range in the table
+ has been updated
+
+ Listeners are required to discard any possibly cached information
+ they have about the cells in question, in particular any possibly
+ cached cell values.
+ */
+ virtual void cellsUpdated( ColPos firstCol, ColPos lastCol, RowPos firstRow, RowPos lastRow ) = 0;
+
+ /// deletes the listener instance
+ virtual ~ITableModelListener(){};
+ };
+ typedef ::boost::shared_ptr< ITableModelListener > PTableModelListener;
+
+ //====================================================================
+ //= IColumnModel
+ //====================================================================
+ /** interface to be implemented by table column models
+ */
+ class SAL_NO_VTABLE IColumnModel
+ {
+ public:
+ /** retrieves the ID of the column
+
+ The semantics of a column id is not defined. It's up to the
+ implementor of the ->IColumnModel, respectively the ->ITableModel
+ which provides the column models, to define such a semantics.
+
+ @return
+ the ID of the column. May be 0 if the table which the column
+ belongs to does not need and support column ids.
+
+ @see setID
+ */
+ virtual ColumnID getID() const = 0;
+
+ /** sets a new column ID
+
+ @return
+ <TRUE/> if setting the new ID was successfull. A possible error
+ conditions is if you try to set an ID which is already used
+ by another column within the same table.
+
+ @see getID
+ */
+ virtual bool setID( const ColumnID _nID ) = 0;
+
+ /** returns the name of the column
+
+ Column names should be human-readable, but not necessarily unique
+ within a given table.
+
+ @see setName
+ */
+ virtual String getName() const = 0;
+
+ /** sets a new name for the column
+
+ @see getName
+ */
+ virtual void setName( const String& _rName ) = 0;
+
+ /** determines whether the column can be resized
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual bool isResizable() const = 0;
+
+ /** declares the column as resizable or fixed in width
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual void setResizable( bool _bResizable ) = 0;
+
+ /** returns the width of the column, in 1/100 millimeters
+
+ The returned value must be a positive ->TableMetrics value.
+
+ It can also be COLWIDTH_FIT_TO_VIEW, to indicate that the width of the column
+ should automatically be adjusted to completely fit the view. For instance, a
+ model's last column could return this value, to indicate that it is to occupy
+ all horizontal space remaining in the view, after all other columns have been
+ layouted.
+
+ If there is more than one column with width COLWIDTH_FIT_TO_VIEW in a model,
+ they're all layouted equal-width.
+
+ If the columns with a read width (i.e. other than COLWIDTH_FIT_TO_VIEW) are,
+ in sum, wider than the view, then the view is free to choose a real width for any
+ columns which return COLWIDTH_FIT_TO_VIEW here.
+
+ @see setWidth
+ @see getMinWidth
+ @see getMaxWidth
+ @see COLWIDTH_FIT_TO_VIEW
+ */
+ virtual TableMetrics getWidth() const = 0;
+
+ /** sets a new width for the column
+
+ @param _nWidth
+ the new width, in 1/100 millimeters
+
+ @see getWidth
+ */
+ virtual void setWidth( TableMetrics _nWidth ) = 0;
+
+ /** returns the minimum width of the column, in 1/100 millimeters, or 0 if the column
+ does not have a minimal width
+
+ @see setMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMinWidth() const = 0;
+
+ /** sets the minimum width of the column, in 1/100 millimeters
+
+ @see getMinWidth
+ @see setMaxWidth
+ @see setWidth
+ */
+ virtual void setMinWidth( TableMetrics _nMinWidth ) = 0;
+
+ /** returns the maximum width of the column, in 1/100 millimeters, or 0 if the column
+ does not have a minimal width
+
+ @see setMaxWidth
+ @see getMinWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMaxWidth() const = 0;
+
+ /** sets the maximum width of the column, in 1/100 millimeters
+
+ @see getMaxWidth
+ @see setMinWidth
+ @see setWidth
+ */
+ virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0;
+
+
+ /// deletes the column model instance
+ virtual ~IColumnModel() { }
+ };
+ typedef ::boost::shared_ptr< IColumnModel > PColumnModel;
+
+ //====================================================================
+ //= ITableModel
+ //====================================================================
+ /** declares the interface to implement by an abtract table model
+ */
+ class SAL_NO_VTABLE ITableModel
+ {
+ public:
+ /** returns the number of columns in the table
+ */
+ virtual TableSize getColumnCount() const = 0;
+
+ /** returns the number of rows in the table
+ */
+ virtual TableSize getRowCount() const = 0;
+
+ virtual void setColumnCount(TableSize _nColCount) = 0;
+ virtual void setRowCount(TableSize _nRowCount) = 0;
+
+ /** determines whether the table has column headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render column headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasColumnHeaders() const = 0;
+ /** sets whether the table should have row headers
+ @see IColumnRenderer
+ */
+ virtual void setRowHeaders( bool rowHeaders) = 0;
+
+ /** sets whether the table should have column headers
+ @see IColumnRenderer
+ */
+ virtual void setColumnHeaders( bool columnHeaders) = 0;
+
+ /** determines whether the table has row headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render row headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasRowHeaders() const = 0;
+
+ /** determines whether the given cell is editable
+
+ @see ICellEditor
+ @todo
+ */
+ virtual bool isCellEditable( ColPos col, RowPos row ) const = 0;
+
+ /** adds the given listener to the list of ->ITableModelListener's
+ */
+ virtual void addTableModelListener( const PTableModelListener& listener ) = 0;
+
+ /** revokes the given listener from the list of ->ITableModelListener's
+ */
+ virtual void removeTableModelListener( const PTableModelListener& listener ) = 0;
+
+ /** returns a model for a certain column
+
+ @param column
+ the index of the column in question. Must be greater than or
+ equal 0, and smaller than the return value of ->getColumnCount()
+
+ @return
+ the model of the column in question. Must not be <NULL/>
+
+ @see getColumnModelByID
+ */
+ virtual PColumnModel getColumnModel( ColPos column ) = 0;
+
+ /** finds a column model by ID
+
+ @param id
+ the id of the column which is to be looked up
+ @return
+ the column model with the given ID, or <NULL/> if there is
+ no such column
+ */
+ virtual PColumnModel getColumnModelByID( ColumnID id ) = 0;
+
+ /** returns a renderer which is able to paint the table represented
+ by this table model
+
+ @return the renderer to use. Must not be <NULL/>
+ */
+ virtual PTableRenderer getRenderer() const = 0;
+
+ /** returns the component handling input in a view associated with the model
+ */
+ virtual PTableInputHandler getInputHandler() const = 0;
+
+ /** determines the height of rows in the table.
+
+ @return
+ the logical height of rows in the table, in 1/100 millimeters. The height must be
+ greater 0.
+ */
+ virtual TableMetrics getRowHeight() const = 0;
+
+ virtual void setRowHeight(TableMetrics _nRowHeight) = 0;
+
+ /** determines the height of the column header row
+
+ This method is not to be called if ->hasColumnHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical height of the column header row, in 1/100 millimeters.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getColumnHeaderHeight() const = 0;
+
+ /** determines the width of the row header column
+
+ This method is not to be called if ->hasRowHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical width of the row header column, in 1/100 millimeters.
+ Must be greater than 0.
+ */
+ 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
+ @param actHeight the given height of the table
+ */
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight,int actHeight) const = 0;
+
+ /** determines the visibility of the horizontal scrollbar of the table control
+ @param overAllWidth the width of the table with all columns
+ @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;
+
+ /// destroys the table model instance
+ virtual ~ITableModel() { }
+ };
+ typedef ::boost::shared_ptr< ITableModel > PTableModel;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEMODEL_HXX
diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx
new file mode 100644
index 000000000000..eb645ad574c4
--- /dev/null
+++ b/svtools/inc/svtools/table/tablerenderer.hxx
@@ -0,0 +1,241 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_TABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+
+#include <svtools/table/tabletypes.hxx>
+
+#include <vcl/outdev.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ //====================================================================
+ //= ITableRenderer
+ //====================================================================
+ /** interface to implement by components rendering a ->TableControl
+ */
+ class SAL_NO_VTABLE ITableRenderer
+ {
+ public:
+ /** paints a (part of) header area
+
+ There are two header areas in a table control:
+ <ul><li>The row containing all column headers, i.e. <em>above</em> all rows containing the data</li>
+ <li>The column containing all row headers. i.e. <em>left of</em> all columns containing the data</li>
+ </ul>
+
+ A header area is more than the union of the single column/row headers.
+
+ First, there might be less columns than fit into the view - in this case, right
+ beside the right-most column, there's still room which belongs to the column header
+ area, but is not occupied by any particular column header.<br/>
+ An equivalent statement holds for the row header area, if there are less rows than
+ fit into the view.
+
+ Second, if the table control has both a row header and a column header,
+ the intersection between those both belongs to both the column header area and the
+ row header area, but not to any particular column or row header.
+
+ There are two flags specifying whether the to-be-painted area is part of the column
+ and/or row header area.
+ <ul><li>If both are <TRUE/>, the intersection of both areas is to be painted.</li>
+ <li>If ->_bIsColHeaderArea is <TRUE/> and ->_bIsRowHeaderArea is <FALSE/>,
+ then ->_rArea denotes the column header area <em>excluding</em> the
+ intersection between row and column header area.</li>
+ <li>Equivalently for ->_bIsColHeaderArea being <FALSE/> and ->_bIsRowHeaderArea
+ being <TRUE/></li>
+ </ul>
+ Note that it's not possible for both ->_bIsColHeaderArea and ->_bIsRowHeaderArea
+ to be <FALSE/> at the same time.
+
+ @param _rDevice
+ the device to paint onto
+ @param _rArea
+ the area to paint into
+ @param _bIsColHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the column header area.
+ @param _bIsRowHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the row header area.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header for a given column
+
+ @param _nCol
+ the index of the column to paint
+ @param _bActive
+ <TRUE/> if and only if the column whose column is to be painted
+ contains the active cell.
+ @param _bSelected
+ <TRUE/> if and only if the column whose column is to be painted
+ is selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the column header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** prepares a row for painting
+
+ Painting a table means painting rows as necessary, in an increasing
+ order. The assumption is that retrieving data for two different rows
+ is (potentially) more expensive than retrieving data for two different
+ columns. Thus, the renderer will get the chance to "seek" to a certain
+ row, and then has to render all cells in this row, before another
+ row is going to be painted.
+
+ @param _nRow
+ the row which is going to be painted. The renderer should
+ at least remember this row, since subsequent calls to
+ ->PaintRowHeader(), ->PaintCell(), and ->FinishRow() will
+ not pass this parameter again.
+
+ However, the renderer is also allowed to render any
+ cell-independent content of this row.
+
+ @param _bActive
+ <TRUE/> if and only if the row to be painted contains the
+ currently active cell.
+ @param _bSelected
+ <TRUE/> if and only if the row to be prepared is
+ selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rRowArea
+ the are into which the row should be painted. This excludes
+ the row header area, if applicable.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header of a row
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bActive
+ <TRUE/> if and only if the row to be painted contains the
+ currently active cell.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _bSelected
+ <TRUE/> if and only if the row whose header cell is to be
+ painted is selected currently.
+ <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 row header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ @param _rText
+ the title of the header row
+ */
+ virtual void PaintRowHeader(
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText ) = 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,
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+
+ /** draws a cell cursor in the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /** hides the cell cursor previously drawn into the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /// deletes the renderer instance
+ virtual ~ITableRenderer() { }
+ };
+ typedef ::boost::shared_ptr< ITableRenderer > PTableRenderer;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLERENDERER_HXX
diff --git a/svtools/inc/svtools/table/tabletypes.hxx b/svtools/inc/svtools/table/tabletypes.hxx
new file mode 100644
index 000000000000..167e49cfd521
--- /dev/null
+++ b/svtools/inc/svtools/table/tabletypes.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* 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_INC_TABLE_TABLETYPES_HXX
+#define SVTOOLS_INC_TABLE_TABLETYPES_HXX
+
+#include <sal/types.h>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+ /// a value denoting the size of a table
+ typedef sal_Int32 TableSize;
+
+ /// a value denoting a column position within a table
+ typedef sal_Int32 ColPos;
+ /// a value denoting a row position within a table
+ typedef sal_Int32 RowPos;
+
+ /** a value denoting an arbitrary coordinate value of a position within
+ a table
+
+ Values of this type are guaranteed to be large enough to hold column
+ positions as well as row positions.
+ */
+ typedef sal_Int32 AnyPos;
+
+ /// the ID of a column in a table
+ typedef sal_Int32 ColumnID;
+
+ typedef sal_Int32 TableMetrics;
+/** special column width value which indicates that the column should be
+ automatically resized to fit the view
+*/
+#define COLWIDTH_FIT_TO_VIEW ((TableMetrics)-1)
+
+/// denotes the column containing the row headers
+#define COL_ROW_HEADERS ((ColPos)-1)
+/// denotes the row containing the column headers
+#define ROW_COL_HEADERS ((RowPos)-1)
+
+/// denotes an invalid column index
+#define COL_INVALID ((ColPos)-2)
+/// denotes an invalid row index
+#define ROW_INVALID ((RowPos)-2)
+
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLETYPES_HXX