tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / xmloff / source / style / PageMasterPropHdlFactory.cxx
blob378160ec68d064dbf5beb957188a8ce5b0b587bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <enummaps.hxx>
22 #include <xmloff/xmlement.hxx>
23 #include <xmloff/xmltypes.hxx>
24 #include <xmloff/xmltoken.hxx>
25 #include <xmlbahdl.hxx>
26 #include <xmloff/NamedBoolPropertyHdl.hxx>
27 #include <XMLTextColumnsPropertyHandler.hxx>
28 #include <xmloff/XMLConstantsPropertyHandler.hxx>
29 #include "PageMasterPropHdl.hxx"
30 #include <PageMasterStyleMap.hxx>
31 #include <com/sun/star/text/TextGridMode.hpp>
32 #include <xmloff/EnumPropertyHdl.hxx>
33 #include <osl/diagnose.h>
34 #include <XMLFillBitmapSizePropertyHandler.hxx>
35 #include <XMLBitmapLogicalSizePropertyHandler.hxx>
36 #include <XMLBitmapRepeatOffsetPropertyHandler.hxx>
37 #include <XMLRtlGutterPropertyHandler.hxx>
39 using namespace ::xmloff::token;
40 using namespace ::com::sun::star;
42 SvXMLEnumMapEntry<sal_uInt16> const aXML_TextGridMode_ConstantMap[] =
44 { XML_NONE, text::TextGridMode::NONE },
45 { XML_LINE, text::TextGridMode::LINES },
46 { XML_BOTH, text::TextGridMode::LINES_AND_CHARS },
47 { XML_TOKEN_INVALID, 0 }
50 XMLPageMasterPropHdlFactory::XMLPageMasterPropHdlFactory()
54 XMLPageMasterPropHdlFactory::~XMLPageMasterPropHdlFactory()
58 const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_Int32 nType ) const
60 nType &= MID_FLAG_MASK;
62 XMLPropertyHandler* pHdl = const_cast<XMLPropertyHandler*>(XMLPropertyHandlerFactory::GetPropertyHandler( nType ));
63 if( !pHdl )
65 switch( nType )
67 case XML_PM_TYPE_PAGESTYLELAYOUT:
68 pHdl = new XMLPMPropHdl_PageStyleLayout;
69 break;
70 case XML_PM_TYPE_NUMFORMAT:
71 pHdl = new XMLPMPropHdl_NumFormat;
72 break;
73 case XML_PM_TYPE_NUMLETTERSYNC:
74 pHdl = new XMLPMPropHdl_NumLetterSync;
75 break;
76 case XML_PM_TYPE_PAPERTRAYNUMBER:
77 pHdl = new XMLPMPropHdl_PaperTrayNumber;
78 break;
79 case XML_PM_TYPE_PRINTORIENTATION:
80 pHdl = new XMLNamedBoolPropertyHdl(
81 GetXMLToken( XML_LANDSCAPE ),
82 GetXMLToken( XML_PORTRAIT ) );
83 break;
84 case XML_PM_TYPE_PRINTANNOTATIONS:
85 pHdl = new XMLPMPropHdl_Print( XML_ANNOTATIONS );
86 break;
87 case XML_PM_TYPE_PRINTCHARTS:
88 pHdl = new XMLPMPropHdl_Print( XML_CHARTS );
89 break;
90 case XML_PM_TYPE_PRINTDRAWING:
91 pHdl = new XMLPMPropHdl_Print( XML_DRAWINGS );
92 break;
93 case XML_PM_TYPE_PRINTFORMULAS:
94 pHdl = new XMLPMPropHdl_Print( XML_FORMULAS );
95 break;
96 case XML_PM_TYPE_PRINTGRID:
97 pHdl = new XMLPMPropHdl_Print( XML_GRID );
98 break;
99 case XML_PM_TYPE_PRINTHEADERS:
100 pHdl = new XMLPMPropHdl_Print( XML_HEADERS );
101 break;
102 case XML_PM_TYPE_PRINTOBJECTS:
103 pHdl = new XMLPMPropHdl_Print( XML_OBJECTS );
104 break;
105 case XML_PM_TYPE_PRINTZEROVALUES:
106 pHdl = new XMLPMPropHdl_Print( XML_ZERO_VALUES );
107 break;
108 case XML_PM_TYPE_PRINTPAGEORDER:
109 pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_TTB ),
110 GetXMLToken( XML_LTR ) );
111 break;
112 case XML_PM_TYPE_FIRSTPAGENUMBER:
113 pHdl = new XMLNumberNonePropHdl( XML_CONTINUE, 2 );
114 break;
115 case XML_PM_TYPE_CENTER_HORIZONTAL:
116 pHdl = new XMLPMPropHdl_CenterHorizontal;
117 break;
118 case XML_PM_TYPE_CENTER_VERTICAL:
119 pHdl = new XMLPMPropHdl_CenterVertical;
120 break;
121 case XML_TYPE_TEXT_COLUMNS:
122 pHdl = new XMLTextColumnsPropertyHandler;
123 break;
124 case XML_TYPE_LAYOUT_GRID_MODE:
125 pHdl = new XMLConstantsPropertyHandler(
126 aXML_TextGridMode_ConstantMap, XML_NONE );
127 break;
129 case XML_SW_TYPE_FILLSTYLE:
130 pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap );
131 break;
132 case XML_SW_TYPE_PRESPAGE_BACKSIZE:
133 pHdl = new XMLNamedBoolPropertyHdl(GetXMLToken(XML_FULL), GetXMLToken(XML_BORDER));
134 break;
135 case XML_SW_TYPE_FILLBITMAPSIZE:
136 pHdl = new XMLFillBitmapSizePropertyHandler();
137 break;
138 case XML_SW_TYPE_LOGICAL_SIZE:
139 pHdl = new XMLBitmapLogicalSizePropertyHandler();
140 break;
141 case XML_SW_TYPE_BITMAP_REFPOINT:
142 pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap );
143 break;
144 case XML_SW_TYPE_BITMAP_MODE:
145 pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap );
146 break;
147 case XML_SW_TYPE_BITMAPREPOFFSETX:
148 case XML_SW_TYPE_BITMAPREPOFFSETY:
149 pHdl = new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX == nType);
150 break;
151 case XML_SW_TYPE_RTLGUTTER:
152 pHdl = new XMLRtlGutterPropertyHandler();
153 break;
155 default:
157 OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
158 break;
162 if( pHdl )
163 PutHdlCache( nType, pHdl );
165 return pHdl;
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */