xref: /aoo41x/main/svx/source/table/tablerow.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVX_TABLEROW_HXX_
25 #define _SVX_TABLEROW_HXX_
26 
27 #include <com/sun/star/table/XCellRange.hpp>
28 #include <com/sun/star/container/XNamed.hpp>
29 #include <cppuhelper/implbase2.hxx>
30 
31 #include "propertyset.hxx"
32 #include "tablemodel.hxx"
33 
34 // -----------------------------------------------------------------------------
35 
36 namespace sdr { namespace table {
37 
38 // -----------------------------------------------------------------------------
39 // TableRow
40 // -----------------------------------------------------------------------------
41 
42 typedef ::cppu::ImplInheritanceHelper2< ::comphelper::FastPropertySet, ::com::sun::star::table::XCellRange, ::com::sun::star::container::XNamed > TableRowBase;
43 
44 class TableRow : public TableRowBase
45 {
46 	friend class TableModel;
47 	friend class TableRowUndo;
48 public:
49 	TableRow( const TableModelRef& xTableModel, sal_Int32 nRow, sal_Int32 nColumns );
50 	virtual ~TableRow();
51 
52 	void dispose();
53 	void throwIfDisposed() const throw (::com::sun::star::uno::RuntimeException);
54 
55 	TableRow& operator=( const TableRow& );
56 
57 	void insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::iterator* pIter = 0 );
58 	void removeColumns( sal_Int32 nIndex, sal_Int32 nCount );
59 
60 	// XCellRange
61     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
62     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
63 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw (::com::sun::star::uno::RuntimeException);
64 
65 	// XNamed
66 	virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException);
67 	virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
68 
69     // XFastPropertySet
70     virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
71     virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
72 
73 private:
74 	static rtl::Reference< ::comphelper::FastPropertySetInfo > getStaticPropertySetInfo();
75 
76 	TableModelRef mxTableModel;
77 	CellVector	maCells;
78 	sal_Int32	mnRow;
79 	sal_Int32	mnHeight;
80 	sal_Bool	mbOptimalHeight;
81 	sal_Bool	mbIsVisible;
82 	sal_Bool	mbIsStartOfNewPage;
83 	::rtl::OUString maName;
84 };
85 
86 } }
87 
88 #endif
89