1*50e6b072SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*50e6b072SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*50e6b072SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*50e6b072SAndrew Rist * distributed with this work for additional information 6*50e6b072SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*50e6b072SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*50e6b072SAndrew Rist * "License"); you may not use this file except in compliance 9*50e6b072SAndrew Rist * with the License. You may obtain a copy of the License at 10*50e6b072SAndrew Rist * 11*50e6b072SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*50e6b072SAndrew Rist * 13*50e6b072SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*50e6b072SAndrew Rist * software distributed under the License is distributed on an 15*50e6b072SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*50e6b072SAndrew Rist * KIND, either express or implied. See the License for the 17*50e6b072SAndrew Rist * specific language governing permissions and limitations 18*50e6b072SAndrew Rist * under the License. 19*50e6b072SAndrew Rist * 20*50e6b072SAndrew Rist *************************************************************/ 21*50e6b072SAndrew Rist 22*50e6b072SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir /** === begin UNO includes === **/ 25cdf0e10cSrcweir #include <com/sun/star/awt/grid/XGridColumnModel.hpp> 26cdf0e10cSrcweir #include <com/sun/star/awt/grid/XGridColumn.hpp> 27cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp> 28cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 29cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 30cdf0e10cSrcweir #include <com/sun/star/style/VerticalAlignment.hpp> 31cdf0e10cSrcweir #include <com/sun/star/util/Color.hpp> 32cdf0e10cSrcweir /** === end UNO includes === **/ 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 35cdf0e10cSrcweir #include <cppuhelper/compbase2.hxx> 36cdf0e10cSrcweir #include <comphelper/componentcontext.hxx> 37cdf0e10cSrcweir #include <vector> 38cdf0e10cSrcweir 39cdf0e10cSrcweir namespace comphelper 40cdf0e10cSrcweir { 41cdf0e10cSrcweir class ComponentGuard; 42cdf0e10cSrcweir } 43cdf0e10cSrcweir 44cdf0e10cSrcweir namespace toolkit 45cdf0e10cSrcweir { 46cdf0e10cSrcweir 47cdf0e10cSrcweir //enum broadcast_type { column_added, column_removed, column_changed}; 48cdf0e10cSrcweir 49cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::awt::grid::XGridColumnModel 50cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 51cdf0e10cSrcweir > DefaultGridColumnModel_Base; 52cdf0e10cSrcweir 53cdf0e10cSrcweir class DefaultGridColumnModel :public ::cppu::BaseMutex 54cdf0e10cSrcweir ,public DefaultGridColumnModel_Base 55cdf0e10cSrcweir { 56cdf0e10cSrcweir public: 57cdf0e10cSrcweir DefaultGridColumnModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); 58cdf0e10cSrcweir DefaultGridColumnModel( DefaultGridColumnModel const & i_copySource ); 59cdf0e10cSrcweir virtual ~DefaultGridColumnModel(); 60cdf0e10cSrcweir 61cdf0e10cSrcweir // XGridColumnModel 62cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException); 63cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL createColumn( ) throw (::com::sun::star::uno::RuntimeException); 64cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException); 65cdf0e10cSrcweir virtual void SAL_CALL removeColumn( ::sal_Int32 i_columnIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); 66cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL getColumns() throw (::com::sun::star::uno::RuntimeException); 67cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 68cdf0e10cSrcweir virtual void SAL_CALL setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException); 69cdf0e10cSrcweir 70cdf0e10cSrcweir // XServiceInfo 71cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 72cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 73cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir 75cdf0e10cSrcweir // XContainer 76cdf0e10cSrcweir virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir 79cdf0e10cSrcweir // XCloneable 80cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir 82cdf0e10cSrcweir // OComponentHelper 83cdf0e10cSrcweir virtual void SAL_CALL disposing(); 84cdf0e10cSrcweir 85cdf0e10cSrcweir private: 86cdf0e10cSrcweir typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > Columns; 87cdf0e10cSrcweir 88cdf0e10cSrcweir ::comphelper::ComponentContext m_aContext; 89cdf0e10cSrcweir ::cppu::OInterfaceContainerHelper m_aContainerListeners; 90cdf0e10cSrcweir Columns m_aColumns; 91cdf0e10cSrcweir }; 92cdf0e10cSrcweir 93cdf0e10cSrcweir } 94