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_TBLSTYLEPRHANDLER_HXX
23 #define INCLUDED_TBLSTYLEPRHANDLER_HXX
24 
25 #include "TablePropertiesHandler.hxx"
26 
27 #include <dmapper/DomainMapper.hxx>
28 #include <WriterFilterDllApi.hxx>
29 #include <resourcemodel/LoggedResources.hxx>
30 #include <boost/shared_ptr.hpp>
31 
32 namespace writerfilter {
33 namespace dmapper {
34 
35 class DomainMapper;
36 class PropertyMap;
37 
38 enum TblStyleType
39 {
40     TBL_STYLE_UNKNOWN,
41     TBL_STYLE_WHOLETABLE,
42     TBL_STYLE_FIRSTROW,
43     TBL_STYLE_LASTROW,
44     TBL_STYLE_FIRSTCOL,
45     TBL_STYLE_LASTCOL,
46     TBL_STYLE_BAND1VERT,
47     TBL_STYLE_BAND2VERT,
48     TBL_STYLE_BAND1HORZ,
49     TBL_STYLE_BAND2HORZ,
50     TBL_STYLE_NECELL,
51     TBL_STYLE_NWCELL,
52     TBL_STYLE_SECELL,
53     TBL_STYLE_SWCELL
54 };
55 
56 class WRITERFILTER_DLLPRIVATE TblStylePrHandler : public LoggedProperties
57 {
58 private:
59     DomainMapper &              m_rDMapper;
60     TablePropertiesHandler *    m_pTablePropsHandler;
61 
62     TblStyleType                m_nType;
63     PropertyMapPtr              m_pProperties;
64 
65     // Properties
66     virtual void lcl_attribute(Id Name, Value & val);
67     virtual void lcl_sprm(Sprm & sprm);
68 
69 public:
70     TblStylePrHandler( DomainMapper & rDMapper );
71     virtual ~TblStylePrHandler( );
72 
getProperties()73     inline PropertyMapPtr       getProperties() { return m_pProperties; };
getType()74     inline TblStyleType         getType() { return m_nType; };
75 
76 private:
77 
78     void resolveSprmProps(Sprm & rSprm);
79 };
80 
81 typedef boost::shared_ptr< TblStylePrHandler > TblStylePrHandlerPtr;
82 
83 }}
84 
85 #endif
86