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 .
22 #include <controls/table/tablemodel.hxx>
24 #include <com/sun/star/awt/grid/XGridColumn.hpp>
25 #include <com/sun/star/style/HorizontalAlignment.hpp>
27 #include <rtl/ref.hxx>
34 //= UnoGridColumnFacade
36 class ColumnChangeMultiplexer
;
37 class UnoControlTableModel
;
38 class UnoGridColumnFacade
:public IColumnModel
42 UnoControlTableModel
const & i_owner
,
43 css::uno::Reference
< css::awt::grid::XGridColumn
> const & i_gridColumn
45 virtual ~UnoGridColumnFacade() override
;
46 UnoGridColumnFacade(const UnoGridColumnFacade
&) = delete;
47 UnoGridColumnFacade
& operator=(const UnoGridColumnFacade
&) = delete;
49 // IColumnModel overridables
50 virtual OUString
getName() const override
;
51 virtual OUString
getHelpText() const override
;
52 virtual bool isResizable() const override
;
53 virtual sal_Int32
getFlexibility() const override
;
54 virtual TableMetrics
getWidth() const override
;
55 virtual void setWidth( TableMetrics _nWidth
) override
;
56 virtual TableMetrics
getMinWidth() const override
;
57 virtual TableMetrics
getMaxWidth() const override
;
58 virtual css::style::HorizontalAlignment
getHorizontalAlign() override
;
60 /** disposes the column wrapper
62 Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we
68 getDataColumnIndex() const { return m_nDataColumnIndex
; }
70 // callbacks for the XGridColumnListener
71 void columnChanged( ColumnAttributeGroup
const i_attributeGroup
);
72 void dataColumnIndexChanged();
75 void impl_updateDataColumnIndex_nothrow();
78 UnoControlTableModel
const * m_pOwner
;
79 sal_Int32 m_nDataColumnIndex
;
80 css::uno::Reference
< css::awt::grid::XGridColumn
> m_xGridColumn
;
81 ::rtl::Reference
< ColumnChangeMultiplexer
> m_pChangeMultiplexer
;
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */