1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef INCLUDED_TDEFTABLEHANDLER_HXX
24 #define INCLUDED_TDEFTABLEHANDLER_HXX
25 
26 #include <WriterFilterDllApi.hxx>
27 #include <resourcemodel/LoggedResources.hxx>
28 #include <boost/shared_ptr.hpp>
29 #include <com/sun/star/table/BorderLine.hpp>
30 #include <vector>
31 namespace com{ namespace sun{ namespace star{namespace table {
32     struct BorderLine;
33 }}}}
34 
35 namespace writerfilter {
36 namespace dmapper
37 {
38 class PropertyMap;
39 class TablePropertyMap;
40 class WRITERFILTER_DLLPRIVATE TDefTableHandler : public LoggedProperties
41 {
42 public:
43 
44 private:
45     ::std::vector<sal_Int32>                                m_aCellBorderPositions;
46     ::std::vector<sal_Int32>                                m_aCellVertAlign;
47 
48     ::std::vector< ::com::sun::star::table::BorderLine >    m_aLeftBorderLines;
49     ::std::vector< ::com::sun::star::table::BorderLine >    m_aRightBorderLines;
50     ::std::vector< ::com::sun::star::table::BorderLine >    m_aTopBorderLines;
51     ::std::vector< ::com::sun::star::table::BorderLine >    m_aBottomBorderLines;
52     ::std::vector< ::com::sun::star::table::BorderLine >    m_aInsideHBorderLines;
53     ::std::vector< ::com::sun::star::table::BorderLine >    m_aInsideVBorderLines;
54     ::std::vector< ::com::sun::star::table::BorderLine >    m_aTl2brBorderLines;
55     ::std::vector< ::com::sun::star::table::BorderLine >    m_aTr2blBorderLines;
56 
57     //values of the current border
58     sal_Int32                                           m_nLineWidth;
59     sal_Int32                                           m_nLineType;
60     sal_Int32                                           m_nLineColor;
61     sal_Int32                                           m_nLineDistance;
62 
63     bool                                                m_bOOXML;
64 
65     void localResolve(Id Name, writerfilter::Reference<Properties>::Pointer_t pProperties);
66 
67     // Properties
68     virtual void lcl_attribute(Id Name, Value & val);
69     virtual void lcl_sprm(Sprm & sprm);
70 
71 public:
72     TDefTableHandler( bool bOOXML );
73     virtual ~TDefTableHandler();
74 
75     size_t                                      getCellCount() const;
76     void                                        fillCellProperties( size_t nCell, ::boost::shared_ptr< TablePropertyMap > pCellProperties) const;
77     ::boost::shared_ptr<PropertyMap>            getRowProperties() const;
78     sal_Int32                                   getTableWidth() const;
79 };
80 typedef boost::shared_ptr< TDefTableHandler >          TDefTableHandlerPtr;
81 }}
82 
83 #endif //
84