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>
38 
39 using namespace ::xmloff::token;
40 using namespace ::com::sun::star;
41 using namespace ::com::sun::star::drawing;
42 
44 {
45  { XML_NONE, text::TextGridMode::NONE },
46  { XML_LINE, text::TextGridMode::LINES },
47  { XML_BOTH, text::TextGridMode::LINES_AND_CHARS },
48  { XML_TOKEN_INVALID, 0 }
49 };
50 
53 {
54 }
55 
57 {
58 }
59 
61 {
62  nType &= MID_FLAG_MASK;
63 
65  if( !pHdl )
66  {
67  switch( nType )
68  {
71  break;
73  pHdl = new XMLPMPropHdl_NumFormat;
74  break;
76  pHdl = new XMLPMPropHdl_NumLetterSync;
77  break;
80  break;
82  pHdl = new XMLNamedBoolPropertyHdl(
85  break;
87  pHdl = new XMLPMPropHdl_Print( XML_ANNOTATIONS );
88  break;
90  pHdl = new XMLPMPropHdl_Print( XML_CHARTS );
91  break;
93  pHdl = new XMLPMPropHdl_Print( XML_DRAWINGS );
94  break;
96  pHdl = new XMLPMPropHdl_Print( XML_FORMULAS );
97  break;
99  pHdl = new XMLPMPropHdl_Print( XML_GRID );
100  break;
102  pHdl = new XMLPMPropHdl_Print( XML_HEADERS );
103  break;
105  pHdl = new XMLPMPropHdl_Print( XML_OBJECTS );
106  break;
108  pHdl = new XMLPMPropHdl_Print( XML_ZERO_VALUES );
109  break;
112  GetXMLToken( XML_LTR ) );
113  break;
115  pHdl = new XMLNumberNonePropHdl( XML_CONTINUE, 2 );
116  break;
119  break;
121  pHdl = new XMLPMPropHdl_CenterVertical;
122  break;
125  break;
127  pHdl = new XMLConstantsPropertyHandler(
128  aXML_TextGridMode_ConstantMap, XML_NONE );
129  break;
130 
133  break;
136  break;
139  break;
142  break;
145  break;
148  break;
152  break;
153 
154  default:
155  {
156  OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
157  break;
158  }
159  }
160 
161  if( pHdl )
162  PutHdlCache( nType, pHdl );
163  }
164  return pHdl;
165 }
166 
167 /* 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:564
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:418
#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:45
#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:515
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3405
#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
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