1*63bba73cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*63bba73cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*63bba73cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*63bba73cSAndrew Rist  * distributed with this work for additional information
6*63bba73cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*63bba73cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*63bba73cSAndrew Rist  * "License"); you may not use this file except in compliance
9*63bba73cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*63bba73cSAndrew Rist  *
11*63bba73cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*63bba73cSAndrew Rist  *
13*63bba73cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*63bba73cSAndrew Rist  * software distributed under the License is distributed on an
15*63bba73cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*63bba73cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*63bba73cSAndrew Rist  * specific language governing permissions and limitations
18*63bba73cSAndrew Rist  * under the License.
19*63bba73cSAndrew Rist  *
20*63bba73cSAndrew Rist  *************************************************************/
21*63bba73cSAndrew Rist 
22*63bba73cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
26cdf0e10cSrcweir #include "PageMasterPropHdlFactory.hxx"
27cdf0e10cSrcweir #include <xmloff/xmltypes.hxx>
28cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
29cdf0e10cSrcweir #include "xmlbahdl.hxx"
30cdf0e10cSrcweir #include <xmloff/NamedBoolPropertyHdl.hxx>
31cdf0e10cSrcweir #ifndef _XMLOFF_XMLTEXTCOLUMNSPPROPERTYHANDLER_HXX
32cdf0e10cSrcweir #include "XMLTextColumnsPropertyHandler.hxx"
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <xmloff/XMLConstantsPropertyHandler.hxx>
35cdf0e10cSrcweir #include "PageMasterPropHdl.hxx"
36cdf0e10cSrcweir #ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
37cdf0e10cSrcweir #include <xmloff/PageMasterStyleMap.hxx>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #include <com/sun/star/text/TextGridMode.hpp>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 
42cdf0e10cSrcweir using ::rtl::OUString;
43cdf0e10cSrcweir using ::rtl::OUStringBuffer;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir using namespace ::xmloff::token;
46cdf0e10cSrcweir using namespace ::com::sun::star;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 
49cdf0e10cSrcweir SvXMLEnumMapEntry aXML_TextGridMode_ConstantMap[] =
50cdf0e10cSrcweir {
51cdf0e10cSrcweir 	{ XML_NONE,         text::TextGridMode::NONE },
52cdf0e10cSrcweir 	{ XML_LINE,	        text::TextGridMode::LINES },
53cdf0e10cSrcweir 	{ XML_BOTH,         text::TextGridMode::LINES_AND_CHARS },
54cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
55cdf0e10cSrcweir };
56cdf0e10cSrcweir 
57cdf0e10cSrcweir //______________________________________________________________________________
58cdf0e10cSrcweir 
XMLPageMasterPropHdlFactory()59cdf0e10cSrcweir XMLPageMasterPropHdlFactory::XMLPageMasterPropHdlFactory() :
60cdf0e10cSrcweir 	XMLPropertyHandlerFactory()
61cdf0e10cSrcweir {
62cdf0e10cSrcweir }
63cdf0e10cSrcweir 
~XMLPageMasterPropHdlFactory()64cdf0e10cSrcweir XMLPageMasterPropHdlFactory::~XMLPageMasterPropHdlFactory()
65cdf0e10cSrcweir {
66cdf0e10cSrcweir }
67cdf0e10cSrcweir 
GetPropertyHandler(sal_Int32 nType) const68cdf0e10cSrcweir const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_Int32 nType ) const
69cdf0e10cSrcweir {
70cdf0e10cSrcweir 	nType &= MID_FLAG_MASK;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	XMLPropertyHandler* pHdl = (XMLPropertyHandler*) XMLPropertyHandlerFactory::GetPropertyHandler( nType );
73cdf0e10cSrcweir 	if( !pHdl )
74cdf0e10cSrcweir 	{
75cdf0e10cSrcweir 		switch( nType )
76cdf0e10cSrcweir 		{
77cdf0e10cSrcweir 			case XML_PM_TYPE_PAGESTYLELAYOUT:
78cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_PageStyleLayout();
79cdf0e10cSrcweir 			break;
80cdf0e10cSrcweir 			case XML_PM_TYPE_NUMFORMAT:
81cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_NumFormat();
82cdf0e10cSrcweir 			break;
83cdf0e10cSrcweir 			case XML_PM_TYPE_NUMLETTERSYNC:
84cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_NumLetterSync();
85cdf0e10cSrcweir 			break;
86cdf0e10cSrcweir 			case XML_PM_TYPE_PAPERTRAYNUMBER:
87cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_PaperTrayNumber();
88cdf0e10cSrcweir 			break;
89cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTORIENTATION:
90cdf0e10cSrcweir 				pHdl = new XMLNamedBoolPropertyHdl(
91cdf0e10cSrcweir                     GetXMLToken( XML_LANDSCAPE ),
92cdf0e10cSrcweir 					GetXMLToken( XML_PORTRAIT ) );
93cdf0e10cSrcweir 			break;
94cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTANNOTATIONS:
95cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_ANNOTATIONS );
96cdf0e10cSrcweir 			break;
97cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTCHARTS:
98cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_CHARTS );
99cdf0e10cSrcweir 			break;
100cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTDRAWING:
101cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_DRAWINGS );
102cdf0e10cSrcweir 			break;
103cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTFORMULAS:
104cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_FORMULAS );
105cdf0e10cSrcweir 			break;
106cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTGRID:
107cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_GRID );
108cdf0e10cSrcweir 			break;
109cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTHEADERS:
110cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_HEADERS );
111cdf0e10cSrcweir 			break;
112cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTOBJECTS:
113cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_OBJECTS );
114cdf0e10cSrcweir 			break;
115cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTZEROVALUES:
116cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_Print( XML_ZERO_VALUES );
117cdf0e10cSrcweir 			break;
118cdf0e10cSrcweir 			case XML_PM_TYPE_PRINTPAGEORDER:
119cdf0e10cSrcweir 				pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_TTB ),
120cdf0e10cSrcweir                                                     GetXMLToken( XML_LTR ) );
121cdf0e10cSrcweir 			break;
122cdf0e10cSrcweir 			case XML_PM_TYPE_FIRSTPAGENUMBER:
123cdf0e10cSrcweir 				pHdl = new XMLNumberNonePropHdl( XML_CONTINUE, 2 );
124cdf0e10cSrcweir 			break;
125cdf0e10cSrcweir 			case XML_PM_TYPE_CENTER_HORIZONTAL:
126cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_CenterHorizontal();
127cdf0e10cSrcweir 			break;
128cdf0e10cSrcweir 			case XML_PM_TYPE_CENTER_VERTICAL:
129cdf0e10cSrcweir 				pHdl = new XMLPMPropHdl_CenterVertical();
130cdf0e10cSrcweir 			break;
131cdf0e10cSrcweir 			case XML_TYPE_TEXT_COLUMNS:
132cdf0e10cSrcweir 				pHdl = new XMLTextColumnsPropertyHandler;
133cdf0e10cSrcweir 			break;
134cdf0e10cSrcweir             case XML_TYPE_LAYOUT_GRID_MODE:
135cdf0e10cSrcweir                 pHdl = new XMLConstantsPropertyHandler(
136cdf0e10cSrcweir                     aXML_TextGridMode_ConstantMap, XML_NONE );
137cdf0e10cSrcweir             break;
138cdf0e10cSrcweir 		}
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 		if( pHdl )
141cdf0e10cSrcweir 			PutHdlCache( nType, pHdl );
142cdf0e10cSrcweir 	}
143cdf0e10cSrcweir 	return pHdl;
144cdf0e10cSrcweir }
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 
147