Commits

Anonymous committed d235363

export TableControl for usage in VCLTestTool

  • Participants
  • Parent commits c6a239d

Comments (0)

Files changed (6)

svtools/inc/svtools/table/tablecontrol.hxx

 #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
 
         // TODO: scrolling?
     */
-    class TableControl : public Control, public IAccessibleTable
+    class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
 	{
     private:
-	DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
+        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;
+    	::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;
+    	::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable;
 
         TableControl( Window* _pParent, WinBits _nStyle );
         ~TableControl();
 
         /// sets a new table model
-        void        SetModel( PTableModel _pModel );
+        SVT_DLLPRIVATE void        SetModel( PTableModel _pModel );
         /// retrieves the current table model
         PTableModel GetModel() const;
 
         {
             return GoTo( GetCurrentColumn(), _nRow );
         }
-	virtual void	Resize();
+	SVT_DLLPRIVATE virtual void	Resize();
 	virtual void    Select();
-	void		SetSelectHdl( const Link& rLink )	{ m_aSelectHdl = rLink; }
+	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
 	//virtual long		Notify(NotifyEvent& rNEvt);
 	
 	/** Creates and returns the accessible object of the whole GridControl. */
-	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;
+	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;
         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
 //........................................................................

svtools/inc/svtools/table/tablemodel.hxx

 #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>
 	//====================================================================
     /** 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
         */
         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
 
 		/** 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
 
 
         /** 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
 
 
             @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
         */
                 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
 
                 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
 
                 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
 	virtual std::vector< std::vector< ::com::sun::star::uno::Any > >&	getCellContent() = 0;
 	/**sets title of header rows
 	*/
-	virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)=0;
+	SVT_DLLPRIVATE virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)=0;
 	/** gets title of header rows
 	*/
 	virtual std::vector<rtl::OUString>&   getRowHeaderName() = 0;
-	virtual ::com::sun::star::util::Color getLineColor() = 0;
-	virtual void setLineColor(::com::sun::star::util::Color _rColor) = 0;
-	virtual ::com::sun::star::util::Color getHeaderBackgroundColor() = 0;
-	virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
-	virtual ::com::sun::star::util::Color getTextColor() = 0;
-	virtual void setTextColor(::com::sun::star::util::Color _rColor) = 0;
-	virtual ::com::sun::star::util::Color getOddRowBackgroundColor() = 0;
-	virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
-	virtual ::com::sun::star::util::Color getEvenRowBackgroundColor() = 0;
-	virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
-	virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() = 0;
-	virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _xAlign) = 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() { }

svtools/prj/d.lst

 mkdir: %COMMON_DEST%\bin%_EXT%\hid
 mkdir: %COMMON_DEST%\res%_EXT%
 mkdir: %_DEST%\inc%_EXT%\svtools
+mkdir: %_DEST%\inc%_EXT%\svtools\table
 
 ..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
 ..\%__SRC%\srs\ehdl.srs %_DEST%\res%_EXT%\svtools.srs
 ..\inc\svtools\*.hxx %_DEST%\inc%_EXT%\svtools\*.hxx
 ..\inc\svtools\*.h %_DEST%\inc%_EXT%\svtools\*.h
 ..\inc\svtools\*.hrc %_DEST%\inc%_EXT%\svtools\*.hrc
+..\inc\svtools\table\*.hxx %_DEST%\inc%_EXT%\svtools\table\*.hxx
 ..\inc\*.hxx %_DEST%\inc%_EXT%\svtools\*.hxx
 ..\inc\*.h %_DEST%\inc%_EXT%\svtools\*.h
 ..\inc\*.hrc %_DEST%\inc%_EXT%\svtools\*.hrc

svtools/source/inc/accessibletableimp.hxx

+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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_INC_ACCESSIBLETABLEIMP_HXX
+#define SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+
+#include "svtaccessiblefactory.hxx"
+
+namespace svt { namespace table
+{
+//........................................................................
+
+
+	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
+//........................................................................
+
+#endif // SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX

svtools/source/table/tablecontrol.cxx

 #include "svtools/table/tablecontrol.hxx"
 #include "tablegeometry.hxx"
 #include "tablecontrol_impl.hxx"
+#include "accessibletableimp.hxx"
 #include "svtools/table/tabledatawindow.hxx"
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleRole.hpp>

svtools/source/uno/svtxgridcontrol.cxx

 #include "precompiled_svtools.hxx"
 
 #include "svtxgridcontrol.hxx"
+#include "accessibletableimp.hxx"
 #include <com/sun/star/view/SelectionType.hpp>
 #include "svtools/table/gridtablerenderer.hxx"
 #include "svtools/table/defaultinputhandler.hxx"