Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SVTOOLS_SOURCE_UNO_UNOGRIDCOLUMNFACADE_HXX
21 : #define INCLUDED_SVTOOLS_SOURCE_UNO_UNOGRIDCOLUMNFACADE_HXX
22 :
23 : #include <svtools/table/tablemodel.hxx>
24 : #include "table/tablecontrol.hxx"
25 :
26 : #include <com/sun/star/awt/grid/XGridColumn.hpp>
27 : #include <com/sun/star/style/VerticalAlignment.hpp>
28 : #include <com/sun/star/style/HorizontalAlignment.hpp>
29 :
30 : #include <cppuhelper/implbase2.hxx>
31 : #include <rtl/ref.hxx>
32 :
33 : #include <boost/noncopyable.hpp>
34 :
35 :
36 : namespace svt { namespace table
37 : {
38 :
39 :
40 :
41 : //= UnoGridColumnFacade
42 :
43 : class ColumnChangeMultiplexer;
44 : class UnoControlTableModel;
45 : class UnoGridColumnFacade :public IColumnModel
46 : ,public ::boost::noncopyable
47 : {
48 : public:
49 : UnoGridColumnFacade(
50 : UnoControlTableModel const & i_owner,
51 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_gridColumn
52 : );
53 : virtual ~UnoGridColumnFacade();
54 :
55 : // IColumnModel overridables
56 : virtual ::com::sun::star::uno::Any
57 : getID() const SAL_OVERRIDE;
58 : virtual void setID( const ::com::sun::star::uno::Any& i_ID ) SAL_OVERRIDE;
59 : virtual OUString getName() const SAL_OVERRIDE;
60 : virtual void setName( const OUString& _rName ) SAL_OVERRIDE;
61 : virtual OUString getHelpText() const SAL_OVERRIDE;
62 : virtual void setHelpText( const OUString& i_helpText ) SAL_OVERRIDE;
63 : virtual bool isResizable() const SAL_OVERRIDE;
64 : virtual void setResizable( bool _bResizable ) SAL_OVERRIDE;
65 : virtual sal_Int32 getFlexibility() const SAL_OVERRIDE;
66 : virtual void setFlexibility( sal_Int32 const i_flexibility ) SAL_OVERRIDE;
67 : virtual TableMetrics getWidth() const SAL_OVERRIDE;
68 : virtual void setWidth( TableMetrics _nWidth ) SAL_OVERRIDE;
69 : virtual TableMetrics getMinWidth() const SAL_OVERRIDE;
70 : virtual void setMinWidth( TableMetrics _nMinWidth ) SAL_OVERRIDE;
71 : virtual TableMetrics getMaxWidth() const SAL_OVERRIDE;
72 : virtual void setMaxWidth( TableMetrics _nMaxWidth ) SAL_OVERRIDE;
73 : virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() SAL_OVERRIDE;
74 : virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) SAL_OVERRIDE;
75 :
76 : /** disposes the column wrapper
77 :
78 : Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we
79 : do not own it.
80 : */
81 : void dispose();
82 :
83 : sal_Int32
84 0 : getDataColumnIndex() const { return m_nDataColumnIndex; }
85 :
86 : // callbacks for the XGridColumnListener
87 : void columnChanged( ColumnAttributeGroup const i_attributeGroup );
88 : void dataColumnIndexChanged();
89 :
90 : private:
91 : void impl_updateDataColumnIndex_nothrow();
92 :
93 : private:
94 : UnoControlTableModel const * m_pOwner;
95 : sal_Int32 m_nDataColumnIndex;
96 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > m_xGridColumn;
97 : ::rtl::Reference< ColumnChangeMultiplexer > m_pChangeMultiplexer;
98 : };
99 :
100 :
101 : } } // svt::table
102 :
103 :
104 : #endif // INCLUDED_SVTOOLS_SOURCE_UNO_UNOGRIDCOLUMNFACADE_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|