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_BORDERHANDLER_HXX
20 : #define INCLUDED_BORDERHANDLER_HXX
21 :
22 : #include <vector>
23 : #include <WriterFilterDllApi.hxx>
24 : #include <resourcemodel/LoggedResources.hxx>
25 : #include <boost/shared_ptr.hpp>
26 : #include <com/sun/star/table/BorderLine2.hpp>
27 : #include <com/sun/star/beans/PropertyValue.hpp>
28 :
29 : namespace writerfilter {
30 : namespace dmapper
31 : {
32 : class PropertyMap;
33 : class BorderHandler : public LoggedProperties
34 : {
35 : public:
36 : //todo: order is a guess
37 : enum BorderPosition
38 : {
39 : BORDER_TOP,
40 : BORDER_LEFT,
41 : BORDER_BOTTOM,
42 : BORDER_RIGHT,
43 : BORDER_HORIZONTAL,
44 : BORDER_VERTICAL,
45 : BORDER_COUNT
46 : };
47 :
48 : private:
49 : sal_Int8 m_nCurrentBorderPosition;
50 : //values of the current border
51 : sal_Int32 m_nLineWidth;
52 : sal_Int32 m_nLineType;
53 : sal_Int32 m_nLineColor;
54 : sal_Int32 m_nLineDistance;
55 : bool m_bShadow;
56 : bool m_bOOXML;
57 :
58 : bool m_aFilledLines[BORDER_COUNT];
59 : ::com::sun::star::table::BorderLine2 m_aBorderLines[BORDER_COUNT];
60 : OUString m_aInteropGrabBagName;
61 : std::vector<beans::PropertyValue> m_aInteropGrabBag;
62 : void appendGrabBag(const OUString& aKey, const OUString& aValue);
63 :
64 : // Properties
65 : virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE;
66 : virtual void lcl_sprm(Sprm & sprm) SAL_OVERRIDE;
67 :
68 : public:
69 : BorderHandler( bool bOOXML );
70 : virtual ~BorderHandler();
71 :
72 : ::boost::shared_ptr<PropertyMap> getProperties();
73 : ::com::sun::star::table::BorderLine2 getBorderLine();
74 596 : sal_Int32 getLineDistance() const { return m_nLineDistance;}
75 : bool getShadow();
76 : void enableInteropGrabBag(const OUString& aName);
77 : beans::PropertyValue getInteropGrabBag(const OUString& aName = OUString());
78 : };
79 : typedef boost::shared_ptr< BorderHandler > BorderHandlerPtr;
80 : }}
81 :
82 : #endif
83 :
84 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|