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_OOX_DRAWINGML_TABLE_TABLEPROPERTIES_HXX
21 #define INCLUDED_OOX_DRAWINGML_TABLE_TABLEPROPERTIES_HXX
22 
23 #include <drawingml/table/tablerow.hxx>
24 #include <drawingml/table/tablestyle.hxx>
25 #include <oox/drawingml/color.hxx>
26 
27 #include <memory>
28 #include <vector>
29 
30 namespace oox::drawingml::table {
31 
32 class TableProperties
33 {
34 public:
35 
36     TableProperties();
37 
getTableGrid()38     std::vector< sal_Int32 >&           getTableGrid() { return mvTableGrid; };
getTableRows()39     std::vector< TableRow >&            getTableRows() { return mvTableRows; };
40 
getStyleId()41     OUString&                           getStyleId()    { return maStyleId; };
getTableStyle()42     std::shared_ptr< TableStyle >&      getTableStyle() { return mpTableStyle; };
isFirstRow() const43     bool                                isFirstRow() const  { return mbFirstRow; };
setFirstRow(bool b)44     void                                setFirstRow(bool b) { mbFirstRow = b; };
isFirstCol() const45     bool                                isFirstCol() const  { return mbFirstCol; };
setFirstCol(bool b)46     void                                setFirstCol(bool b) { mbFirstCol = b; };
isLastRow() const47     bool                                isLastRow() const   { return mbLastRow; };
setLastRow(bool b)48     void                                setLastRow(bool b)  { mbLastRow = b; };
isLastCol() const49     bool                                isLastCol() const   { return mbLastCol; };
setLastCol(bool b)50     void                                setLastCol(bool b)  { mbLastCol = b; };
isBandRow() const51     bool                                isBandRow() const   { return mbBandRow; };
setBandRow(bool b)52     void                                setBandRow(bool b)  { mbBandRow = b; };
isBandCol() const53     bool                                isBandCol() const   { return mbBandCol; };
setBandCol(bool b)54     void                                setBandCol(bool b)  { mbBandCol = b; };
getBgColor()55     Color&                              getBgColor(){ return maBgColor; };
56 
57     void pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
58         const css::uno::Reference < css::beans::XPropertySet > & xPropSet,
59         const ::oox::drawingml::TextListStylePtr& pMasterTextListStyle );
60 
61 private:
62 
63     const TableStyle&                   getUsedTableStyle(const ::oox::core::XmlFilterBase& rFilterBase, std::unique_ptr<TableStyle>& rTableStyleToDelete);
64 
65     OUString                            maStyleId;              // either StyleId is available
66     std::shared_ptr< TableStyle >       mpTableStyle;           // or the complete TableStyle
67     std::vector< sal_Int32 >            mvTableGrid;
68     std::vector< TableRow >             mvTableRows;
69     Color                               maBgColor;
70 
71     bool                                mbFirstRow;
72     bool                                mbFirstCol;
73     bool                                mbLastRow;
74     bool                                mbLastCol;
75     bool                                mbBandRow;
76     bool                                mbBandCol;
77 };
78 
79 }
80 
81 #endif // INCLUDED_OOX_DRAWINGML_TABLE_TABLEPROPERTIES_HXX
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
84