LibreOffice Module xmloff (master)  1
PageMasterPropHdlFactory.cxx
Go to the documentation of this file.
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 
21 #include <enummaps.hxx>
22 #include <xmloff/xmlement.hxx>
23 #include <xmloff/xmltypes.hxx>
24 #include <xmloff/xmltoken.hxx>
25 #include "xmlbahdl.hxx"
29 #include "PageMasterPropHdl.hxx"
30 #include <PageMasterStyleMap.hxx>
31 #include <com/sun/star/text/TextGridMode.hpp>
33 #include <osl/diagnose.h>
36 #include <com/sun/star/drawing/BitmapMode.hpp>
39 
40 using namespace ::xmloff::token;
41 using namespace ::com::sun::star;
42 using namespace ::com::sun::star::drawing;
43 
45 {
46  { XML_NONE, text::TextGridMode::NONE },
47  { XML_LINE, text::TextGridMode::LINES },
48  { XML_BOTH, text::TextGridMode::LINES_AND_CHARS },
49  { XML_TOKEN_INVALID, 0 }
50 };
51 
54 {
55 }
56 
58 {
59 }
60 
62 {
63  nType &= MID_FLAG_MASK;
64 
66  if( !pHdl )
67  {
68  switch( nType )
69  {
72  break;
74  pHdl = new XMLPMPropHdl_NumFormat;
75  break;
77  pHdl = new XMLPMPropHdl_NumLetterSync;
78  break;
81  break;
83  pHdl = new XMLNamedBoolPropertyHdl(
86  break;
88  pHdl = new XMLPMPropHdl_Print( XML_ANNOTATIONS );
89  break;
91  pHdl = new XMLPMPropHdl_Print( XML_CHARTS );
92  break;
94  pHdl = new XMLPMPropHdl_Print( XML_DRAWINGS );
95  break;
97  pHdl = new XMLPMPropHdl_Print( XML_FORMULAS );
98  break;
100  pHdl = new XMLPMPropHdl_Print( XML_GRID );
101  break;
103  pHdl = new XMLPMPropHdl_Print( XML_HEADERS );
104  break;
106  pHdl = new XMLPMPropHdl_Print( XML_OBJECTS );
107  break;
109  pHdl = new XMLPMPropHdl_Print( XML_ZERO_VALUES );
110  break;
113  GetXMLToken( XML_LTR ) );
114  break;
116  pHdl = new XMLNumberNonePropHdl( XML_CONTINUE, 2 );
117  break;
120  break;
122  pHdl = new XMLPMPropHdl_CenterVertical;
123  break;
126  break;
128  pHdl = new XMLConstantsPropertyHandler(
129  aXML_TextGridMode_ConstantMap, XML_NONE );
130  break;
131 
134  break;
137  break;
140  break;
143  break;
146  break;
149  break;
153  break;
155  pHdl = new XMLRtlGutterPropertyHandler();
156  break;
157 
158  default:
159  {
160  OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
161  break;
162  }
163  }
164 
165  if( pHdl )
166  PutHdlCache( nType, pHdl );
167  }
168  return pHdl;
169 }
170 
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define XML_PM_TYPE_PRINTFORMULAS
#define XML_SW_TYPE_FILLBITMAPSIZE
Definition: xmltypes.hxx:285
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const
This method retrieves a PropertyHandler for the given XML-type.
Definition: prhdlfac.cxx:138
#define XML_PM_TYPE_CENTER_HORIZONTAL
#define XML_PM_TYPE_PAPERTRAYNUMBER
#define XML_SW_TYPE_BITMAP_REFPOINT
Definition: xmltypes.hxx:287
SvXMLEnumMapEntry< drawing::RectanglePoint > const aXML_RefPoint_EnumMap[]
Definition: sdpropls.cxx:554
PropertyHandler for the XML-data-type:
SvXMLEnumMapEntry< sal_uInt16 > const aXML_TextGridMode_ConstantMap[]
#define XML_SW_TYPE_BITMAPREPOFFSETX
Definition: xmltypes.hxx:289
#define XML_SW_TYPE_LOGICAL_SIZE
Definition: xmltypes.hxx:286
#define XML_SW_TYPE_FILLSTYLE
Definition: xmltypes.hxx:284
Abstract base-class for different XML-types.
This class is a base-class to create XMLPropertyHandler.
Definition: prhdlfac.hxx:40
PropertyHandler for a named xml bool type:
#define XML_PM_TYPE_PRINTORIENTATION
PropertyHandler for a generic xml enumeration type:
SvXMLEnumMapEntry< drawing::FillStyle > const aXML_FillStyle_EnumMap[]
Definition: sdpropls.cxx:408
#define XML_PM_TYPE_PRINTZEROVALUES
#define XML_SW_TYPE_BITMAPREPOFFSETY
Definition: xmltypes.hxx:290
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const override
This method retrieves a PropertyHandler for the given XML-type.
#define XML_PM_TYPE_PRINTOBJECTS
#define XML_PM_TYPE_NUMLETTERSYNC
virtual ~XMLPageMasterPropHdlFactory() override
Abstract base-class for different XML-types.
#define XML_PM_TYPE_PRINTCHARTS
#define XML_PM_TYPE_PAGESTYLELAYOUT
#define XML_PM_TYPE_PRINTANNOTATIONS
#define XML_PM_TYPE_CENTER_VERTICAL
#define XML_PM_TYPE_FIRSTPAGENUMBER
PropertyHandler for the XML-data-type: XML_TYPE_NUMBER_NONE.
Definition: xmlbahdl.hxx:44
#define XML_SW_TYPE_BITMAP_MODE
Definition: xmltypes.hxx:288
#define XML_TYPE_LAYOUT_GRID_MODE
Definition: xmltypes.hxx:251
SvXMLEnumMapEntry< drawing::BitmapMode > const aXML_BitmapMode_EnumMap[]
Definition: sdpropls.cxx:505
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3425
#define MID_FLAG_MASK
Definition: xmltypes.hxx:36
#define XML_SW_TYPE_PRESPAGE_BACKSIZE
Definition: xmltypes.hxx:294
Handling of tokens in XML:
#define XML_TYPE_TEXT_COLUMNS
Definition: xmltypes.hxx:203
#define XML_PM_TYPE_PRINTGRID
Abstract base-class for different XML-types.
#define XML_PM_TYPE_PRINTHEADERS
#define XML_PM_TYPE_NUMFORMAT
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:35
#define XML_PM_TYPE_PRINTDRAWING
#define XML_SW_TYPE_RTLGUTTER
Definition: xmltypes.hxx:295
Abstract base-class for different XML-types.
#define XML_PM_TYPE_PRINTPAGEORDER
void PutHdlCache(sal_Int32 nType, const XMLPropertyHandler *pHdl) const
Puts a PropertyHandler into the internal cache.
Definition: prhdlfac.cxx:156