xref: /trunk/main/svx/source/table/tablecolumn.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_TABLECOLUMN_HXX_
25 #define _SVX_TABLECOLUMN_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 // TableColumn
40 // -----------------------------------------------------------------------------
41 
42 typedef ::cppu::ImplInheritanceHelper2< ::comphelper::FastPropertySet, ::com::sun::star::table::XCellRange, ::com::sun::star::container::XNamed > TableColumnBase;
43 
44 class TableColumn : public TableColumnBase
45 {
46 	friend class TableColumnUndo;
47     friend class TableModel;
48 public:
49 	TableColumn( const TableModelRef& xTableModel, sal_Int32 nColumn );
50 	virtual ~TableColumn();
51 
52 	void dispose();
53 	void throwIfDisposed() const throw (::com::sun::star::uno::RuntimeException);
54 
55 	TableColumn& operator=( const TableColumn& );
56 
57 	// XCellRange
58     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);
59     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);
60 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw (::com::sun::star::uno::RuntimeException);
61 
62 	// XNamed
63 	virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException);
64 	virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
65 
66     // XFastPropertySet
67     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);
68     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);
69 
70 private:
71 	static rtl::Reference< ::comphelper::FastPropertySetInfo > getStaticPropertySetInfo();
72 
73 	TableModelRef mxTableModel;
74 	sal_Int32	mnColumn;
75 	sal_Int32	mnWidth;
76 	sal_Bool	mbOptimalWidth;
77 	sal_Bool	mbIsVisible;
78 	sal_Bool	mbIsStartOfNewPage;
79 	::rtl::OUString	maName;
80 };
81 
82 } }
83 
84 #endif
85