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 SVTOOLS_GRIDCOLUMNFACADE_HXX
21 : #define SVTOOLS_GRIDCOLUMNFACADE_HXX
22 :
23 : #include "svtools/table/tablemodel.hxx"
24 : #include "svtools/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 : ~UnoGridColumnFacade();
54 :
55 : // IColumnModel overridables
56 : virtual ::com::sun::star::uno::Any
57 : getID() const;
58 : virtual void setID( const ::com::sun::star::uno::Any& i_ID );
59 : virtual String getName() const;
60 : virtual void setName( const String& _rName );
61 : virtual String getHelpText() const;
62 : virtual void setHelpText( const String& 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);
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 // SVTOOLS_GRIDCOLUMNFACADE_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|