Updated core
[LibreOffice.git] / toolkit / source / controls / grid / defaultgridcolumnmodel.hxx
blob859235e3f8d38a119e9437b21a5d3bf58de9c2e2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/awt/grid/XGridColumnModel.hpp>
21 #include <com/sun/star/awt/grid/XGridColumn.hpp>
22 #include <com/sun/star/lang/XEventListener.hpp>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/lang/XUnoTunnel.hpp>
25 #include <com/sun/star/style/VerticalAlignment.hpp>
26 #include <com/sun/star/util/Color.hpp>
28 #include <cppuhelper/basemutex.hxx>
29 #include <cppuhelper/compbase2.hxx>
30 #include <comphelper/componentcontext.hxx>
31 #include <vector>
33 namespace toolkit
36 typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::awt::grid::XGridColumnModel
37 , ::com::sun::star::lang::XServiceInfo
38 > DefaultGridColumnModel_Base;
40 class DefaultGridColumnModel :public ::cppu::BaseMutex
41 ,public DefaultGridColumnModel_Base
43 public:
44 DefaultGridColumnModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
45 DefaultGridColumnModel( DefaultGridColumnModel const & i_copySource );
46 virtual ~DefaultGridColumnModel();
48 // XGridColumnModel
49 virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
50 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL createColumn( ) throw (::com::sun::star::uno::RuntimeException);
51 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);
52 virtual void SAL_CALL removeColumn( ::sal_Int32 i_columnIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
53 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);
54 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);
55 virtual void SAL_CALL setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException);
57 // XServiceInfo
58 virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
59 virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
60 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
62 // XContainer
63 virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
64 virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
66 // XCloneable
67 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
69 // OComponentHelper
70 virtual void SAL_CALL disposing();
72 private:
73 typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > Columns;
75 ::comphelper::ComponentContext m_aContext;
76 ::cppu::OInterfaceContainerHelper m_aContainerListeners;
77 Columns m_aColumns;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */