/src/libreoffice/toolkit/source/controls/unogridcolumnfacade.hxx
Line | Count | Source (jump to first uncovered line) |
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 | | #pragma once |
21 | | |
22 | | #include <controls/table/tablemodel.hxx> |
23 | | |
24 | | #include <com/sun/star/awt/grid/XGridColumn.hpp> |
25 | | #include <com/sun/star/style/HorizontalAlignment.hpp> |
26 | | |
27 | | #include <rtl/ref.hxx> |
28 | | |
29 | | |
30 | | namespace svt::table |
31 | | { |
32 | | |
33 | | |
34 | | //= UnoGridColumnFacade |
35 | | |
36 | | class ColumnChangeMultiplexer; |
37 | | class UnoControlTableModel; |
38 | | class UnoGridColumnFacade :public IColumnModel |
39 | | { |
40 | | public: |
41 | | UnoGridColumnFacade( |
42 | | UnoControlTableModel const & i_owner, |
43 | | css::uno::Reference< css::awt::grid::XGridColumn > const & i_gridColumn |
44 | | ); |
45 | | virtual ~UnoGridColumnFacade() override; |
46 | | UnoGridColumnFacade(const UnoGridColumnFacade&) = delete; |
47 | | UnoGridColumnFacade& operator=(const UnoGridColumnFacade&) = delete; |
48 | | |
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; |
59 | | |
60 | | /** disposes the column wrapper |
61 | | |
62 | | Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we |
63 | | do not own it. |
64 | | */ |
65 | | void dispose(); |
66 | | |
67 | | sal_Int32 |
68 | 0 | getDataColumnIndex() const { return m_nDataColumnIndex; } |
69 | | |
70 | | // callbacks for the XGridColumnListener |
71 | | void columnChanged( ColumnAttributeGroup const i_attributeGroup ); |
72 | | void dataColumnIndexChanged(); |
73 | | |
74 | | private: |
75 | | void impl_updateDataColumnIndex_nothrow(); |
76 | | |
77 | | private: |
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; |
82 | | }; |
83 | | |
84 | | |
85 | | } // svt::table |
86 | | |
87 | | |
88 | | |
89 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |