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 #ifndef INCLUDED_PAGEBORDERSHANDLER_HXX
23 #define INCLUDED_PAGEBORDERSHANDLER_HXX
24 
25 #include "BorderHandler.hxx"
26 #include "PropertyMap.hxx"
27 
28 #include <WriterFilterDllApi.hxx>
29 #include <resourcemodel/LoggedResources.hxx>
30 #include <boost/shared_ptr.hpp>
31 
32 #include <com/sun/star/table/BorderLine.hpp>
33 
34 #include <vector>
35 
36 
37 namespace writerfilter {
38 namespace dmapper {
39 
40 class _PgBorder
41 {
42 public:
43     com::sun::star::table::BorderLine m_rLine;
44     sal_Int32   m_nDistance;
45     BorderPosition m_ePos;
46 
47     _PgBorder( );
48     ~_PgBorder( );
49 };
50 
51 class WRITERFILTER_DLLPRIVATE PageBordersHandler : public LoggedProperties
52 {
53 private:
54 
55     // See implementation of SectionPropertyMap::ApplyBorderToPageStyles
56     sal_Int32 m_nDisplay;
57     sal_Int32 m_nOffset;
58     vector<_PgBorder> m_aBorders;
59 
60     // Properties
61     virtual void lcl_attribute( Id eName, Value& rVal );
62     virtual void lcl_sprm( Sprm& rSprm );
63 
64 public:
65     PageBordersHandler( );
66     ~PageBordersHandler( );
67 
GetDisplayOffset()68     inline sal_Int32 GetDisplayOffset( )
69     {
70         return ( m_nOffset << 5 ) + m_nDisplay;
71     };
72     void SetBorders( SectionPropertyMap* pSectContext );
73 };
74 typedef boost::shared_ptr< PageBordersHandler > PageBordersHandlerPtr;
75 
76 } }
77 
78 #endif
79