1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SVTOOLS_SOURCE_UNO_UNOGRIDCOLUMNFACADE_HXX
21 #define INCLUDED_SVTOOLS_SOURCE_UNO_UNOGRIDCOLUMNFACADE_HXX
23 #include "svtools/table/tablemodel.hxx"
24 #include "svtools/table/tablecontrol.hxx"
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>
30 #include <cppuhelper/implbase2.hxx>
31 #include <rtl/ref.hxx>
33 #include <boost/noncopyable.hpp>
35 // .....................................................................................................................
36 namespace svt
{ namespace table
38 // .....................................................................................................................
40 //==================================================================================================================
41 //= UnoGridColumnFacade
42 //==================================================================================================================
43 class ColumnChangeMultiplexer
;
44 class UnoControlTableModel
;
45 class UnoGridColumnFacade
:public IColumnModel
46 ,public ::boost::noncopyable
50 UnoControlTableModel
const & i_owner
,
51 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridColumn
> const & i_gridColumn
53 ~UnoGridColumnFacade();
55 // IColumnModel overridables
56 virtual ::com::sun::star::uno::Any
58 virtual void setID( const ::com::sun::star::uno::Any
& i_ID
);
59 virtual OUString
getName() const;
60 virtual void setName( const OUString
& _rName
);
61 virtual OUString
getHelpText() const;
62 virtual void setHelpText( const OUString
& i_helpText
);
63 virtual bool isResizable() const;
64 virtual void setResizable( bool _bResizable
);
65 virtual sal_Int32
getFlexibility() const;
66 virtual void setFlexibility( sal_Int32
const i_flexibility
);
67 virtual TableMetrics
getWidth() const;
68 virtual void setWidth( TableMetrics _nWidth
);
69 virtual TableMetrics
getMinWidth() const;
70 virtual void setMinWidth( TableMetrics _nMinWidth
);
71 virtual TableMetrics
getMaxWidth() const;
72 virtual void setMaxWidth( TableMetrics _nMaxWidth
);
73 virtual ::com::sun::star::style::HorizontalAlignment
getHorizontalAlign();
74 virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign
);
76 /** disposes the column wrapper
78 Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we
84 getDataColumnIndex() const { return m_nDataColumnIndex
; }
86 // callbacks for the XGridColumnListener
87 void columnChanged( ColumnAttributeGroup
const i_attributeGroup
);
88 void dataColumnIndexChanged();
91 void impl_updateDataColumnIndex_nothrow();
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
;
100 // .....................................................................................................................
102 // .....................................................................................................................
104 #endif // INCLUDED_SVTOOLS_SOURCE_UNO_UNOGRIDCOLUMNFACADE_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */