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