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_BORDERHANDLER_HXX
24 #define INCLUDED_BORDERHANDLER_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 
31 namespace writerfilter {
32 namespace dmapper
33 {
34 class PropertyMap;
35 class WRITERFILTER_DLLPRIVATE BorderHandler : public LoggedProperties
36 {
37 public:
38     //todo: order is a guess
39     enum BorderPosition
40     {
41         BORDER_TOP,
42         BORDER_LEFT,
43         BORDER_BOTTOM,
44         BORDER_RIGHT,
45         BORDER_HORIZONTAL,
46         BORDER_VERTICAL,
47         BORDER_COUNT
48     };
49 
50 private:
51     sal_Int8        m_nCurrentBorderPosition;
52     //values of the current border
53     sal_Int32       m_nLineWidth;
54     sal_Int32       m_nLineType;
55     sal_Int32       m_nLineColor;
56     sal_Int32       m_nLineDistance;
57     bool            m_bOOXML;
58 
59     bool                                        m_aFilledLines[BORDER_COUNT];
60     ::com::sun::star::table::BorderLine         m_aBorderLines[BORDER_COUNT];
61 
62     // Properties
63     virtual void lcl_attribute(Id Name, Value & val);
64     virtual void lcl_sprm(Sprm & sprm);
65 
66 public:
67     BorderHandler( bool bOOXML );
68     virtual ~BorderHandler();
69 
70     ::boost::shared_ptr<PropertyMap>            getProperties();
71     ::com::sun::star::table::BorderLine         getBorderLine();
getLineDistance() const72     sal_Int32                                   getLineDistance() const { return m_nLineDistance;}
73 };
74 typedef boost::shared_ptr< BorderHandler >          BorderHandlerPtr;
75 }}
76 
77 #endif //
78