1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "PageMasterPropHdlFactory.hxx"
21 #include <xmloff/xmltypes.hxx>
22 #include <xmloff/xmltoken.hxx>
23 #include "xmlbahdl.hxx"
24 #include <xmloff/NamedBoolPropertyHdl.hxx>
25 #include "XMLTextColumnsPropertyHandler.hxx"
26 #include <xmloff/XMLConstantsPropertyHandler.hxx>
27 #include "PageMasterPropHdl.hxx"
28 #include <xmloff/PageMasterStyleMap.hxx>
29 #include <com/sun/star/text/TextGridMode.hpp>
33 using namespace ::xmloff::token
;
34 using namespace ::com::sun::star
;
37 SvXMLEnumMapEntry aXML_TextGridMode_ConstantMap
[] =
39 { XML_NONE
, text::TextGridMode::NONE
},
40 { XML_LINE
, text::TextGridMode::LINES
},
41 { XML_BOTH
, text::TextGridMode::LINES_AND_CHARS
},
42 { XML_TOKEN_INVALID
, 0 }
45 //______________________________________________________________________________
47 XMLPageMasterPropHdlFactory::XMLPageMasterPropHdlFactory() :
48 XMLPropertyHandlerFactory()
52 XMLPageMasterPropHdlFactory::~XMLPageMasterPropHdlFactory()
56 const XMLPropertyHandler
* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_Int32 nType
) const
58 nType
&= MID_FLAG_MASK
;
60 XMLPropertyHandler
* pHdl
= (XMLPropertyHandler
*) XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
65 case XML_PM_TYPE_PAGESTYLELAYOUT
:
66 pHdl
= new XMLPMPropHdl_PageStyleLayout();
68 case XML_PM_TYPE_NUMFORMAT
:
69 pHdl
= new XMLPMPropHdl_NumFormat();
71 case XML_PM_TYPE_NUMLETTERSYNC
:
72 pHdl
= new XMLPMPropHdl_NumLetterSync();
74 case XML_PM_TYPE_PAPERTRAYNUMBER
:
75 pHdl
= new XMLPMPropHdl_PaperTrayNumber();
77 case XML_PM_TYPE_PRINTORIENTATION
:
78 pHdl
= new XMLNamedBoolPropertyHdl(
79 GetXMLToken( XML_LANDSCAPE
),
80 GetXMLToken( XML_PORTRAIT
) );
82 case XML_PM_TYPE_PRINTANNOTATIONS
:
83 pHdl
= new XMLPMPropHdl_Print( XML_ANNOTATIONS
);
85 case XML_PM_TYPE_PRINTCHARTS
:
86 pHdl
= new XMLPMPropHdl_Print( XML_CHARTS
);
88 case XML_PM_TYPE_PRINTDRAWING
:
89 pHdl
= new XMLPMPropHdl_Print( XML_DRAWINGS
);
91 case XML_PM_TYPE_PRINTFORMULAS
:
92 pHdl
= new XMLPMPropHdl_Print( XML_FORMULAS
);
94 case XML_PM_TYPE_PRINTGRID
:
95 pHdl
= new XMLPMPropHdl_Print( XML_GRID
);
97 case XML_PM_TYPE_PRINTHEADERS
:
98 pHdl
= new XMLPMPropHdl_Print( XML_HEADERS
);
100 case XML_PM_TYPE_PRINTOBJECTS
:
101 pHdl
= new XMLPMPropHdl_Print( XML_OBJECTS
);
103 case XML_PM_TYPE_PRINTZEROVALUES
:
104 pHdl
= new XMLPMPropHdl_Print( XML_ZERO_VALUES
);
106 case XML_PM_TYPE_PRINTPAGEORDER
:
107 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_TTB
),
108 GetXMLToken( XML_LTR
) );
110 case XML_PM_TYPE_FIRSTPAGENUMBER
:
111 pHdl
= new XMLNumberNonePropHdl( XML_CONTINUE
, 2 );
113 case XML_PM_TYPE_CENTER_HORIZONTAL
:
114 pHdl
= new XMLPMPropHdl_CenterHorizontal();
116 case XML_PM_TYPE_CENTER_VERTICAL
:
117 pHdl
= new XMLPMPropHdl_CenterVertical();
119 case XML_TYPE_TEXT_COLUMNS
:
120 pHdl
= new XMLTextColumnsPropertyHandler
;
122 case XML_TYPE_LAYOUT_GRID_MODE
:
123 pHdl
= new XMLConstantsPropertyHandler(
124 aXML_TextGridMode_ConstantMap
, XML_NONE
);
129 PutHdlCache( nType
, pHdl
);
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */