1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XMLOFF_ATTRTRANSFORMERACTION_HXX
25 #define _XMLOFF_ATTRTRANSFORMERACTION_HXX
26 
27 #include "TransformerAction.hxx"
28 
29 enum XMLAttrTransformerAction
30 {
31 	XML_ATACTION_EOT=XML_TACTION_EOT,	// uses for initialization only
32 	XML_ATACTION_COPY, 					// copy attr
33 	XML_ATACTION_RENAME, 				// rename attr:
34 										// - param1: namespace +
35 										// 			 token of local name
36 	XML_ATACTION_REMOVE, 				// remove attr
37 	XML_ATACTION_IN2INCH,				// replace "in" with "inch"
38 	XML_ATACTION_INS2INCHS,				// replace "in" with "inch"
39 										// multiple times
40 	XML_ATACTION_IN2TWIPS,				// replace "in" with "inch" and
41 										// convert value from inch to twips
42 										// but only for writer documents
43 	XML_ATACTION_RENAME_IN2INCH,		// replace "in" with "inch" and rename
44 										// attr:
45 										// - param1: namespace +
46 										// 			 token of local name
47 	XML_ATACTION_INCH2IN,				// replace "inch" with "in"
48 	XML_ATACTION_INCHS2INS,				// replace "inch" with "in"
49 										// multiple times
50 	XML_ATACTION_TWIPS2IN,				// replace "inch" with "in" and for writer
51 										// documents convert measure value from twips
52 										// to inch
53 	XML_ATACTION_RENAME_INCH2IN,		// replace "inch" with "in" and rename
54 										// attr:
55 										// - param1: namespace +
56 										// 			 token of local name
57 	XML_ATACTION_STYLE_FAMILY,			// NOP, used for style:family
58 	XML_ATACTION_DECODE_STYLE_NAME,		// NOP, used for style:name
59 										// - param1: style family
60 	XML_ATACTION_STYLE_DISPLAY_NAME,	// NOP, used for style:display_name
61 										// - param1: style family
62 	XML_ATACTION_DECODE_STYLE_NAME_REF,	// NOP, used for style:name reference
63 										// - param1: style family
64 	XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF,	// NOP, used for style:name
65 										// - param1: namespace +
66 										// 			 token of local name
67 	XML_ATACTION_ENCODE_STYLE_NAME,		// NOP, used for style:name
68 	XML_ATACTION_ENCODE_STYLE_NAME_REF,	// NOP, used for style:name
69 	XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF,	// NOP, used for style:name
70 										// - param1: namespace +
71 										// 			 token of local name
72 										// - param2: style family
73 	XML_ATACTION_MOVE_TO_ELEM,			// turn attr into an elem
74 										// - param1: namespace +
75 										// 			 token of local name
76 	XML_ATACTION_MOVE_FROM_ELEM,		// turn elem into an attr:
77 										// - param1: namespace +
78 										// 			 token of local name
79 	XML_ATACTION_NEG_PERCENT,			// replace % val with 100-%
80 	XML_ATACTION_RENAME_NEG_PERCENT,	// replace % val with 100-%, rename attr
81 										// - param1: namespace +
82 										// 			 token of local name
83 	XML_ATACTION_HREF,					// xmlink:href
84 	XML_ATACTION_ADD_NAMESPACE_PREFIX,	// add a namespace prefix
85 										// - param1: prefix
86 	XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,	// add a namespace prefix
87 										// - param1: default prefix
88 	XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX,	// add a namespace prefix
89 										// - param1: namespace +
90 										// 			 token of local name
91 										// - param2: prefix
92 	XML_ATACTION_REMOVE_NAMESPACE_PREFIX,// remove a namespace prefix
93 										// - param1: prefix
94 	XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX,// remove any namespace prefix
95 	XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,// remove a namespace prefix
96 										// - param1: namespace +
97 										// 			 token of local name
98 										// - param2: prefix
99 	XML_ATACTION_EVENT_NAME,
100 	XML_ATACTION_MACRO_NAME,
101 	XML_ATACTION_MACRO_LOCATION,
102 	XML_ATACTION_DLG_BORDER,
103 	XML_ATACTION_URI_OOO,				 // an URI in OOo notation
104 										 // - param1: pacakage URI are supported
105 	XML_ATACTION_URI_OASIS,				 // an URI in OASIS notation
106 										 // - param1: pacakage URI are supported
107     XML_ATACTION_RENAME_ATTRIBUTE,       // rename up to 3 different possible values of an attrbiute
108                                          // - param1: token of old attribute value (lower 16 bit)
109                                          //           + token of new attribute value (upper 16 bit)
110                                          // - param2: token of old attribute value
111                                          //           + token of new attribute value
112                                          // - param3: token of old attribute value
113                                          //           + token of new attribute value
114                                          // if param2 or param3 are unused they must contain
115                                          // XML_TOKEN_INVALID
116     XML_ATACTION_RNG2ISO_DATETIME,       // converts . into , in datetimes
117     XML_ATACTION_RENAME_RNG2ISO_DATETIME,// converts . into , in datetimes and renames the attribute
118                                          // - param1: namespace +
119                                          //           token of local name
120 	XML_ATACTION_MOVE_FROM_ELEM_RNG2ISO_DATETIME, // turn elem into an attr and convert . to , in datetimes
121 										// - param1: namespace +
122 										// 			 token of local name
123 	XML_ATACTION_SVG_WIDTH_HEIGHT_OOO,	 // replace "inch" with "in" and subtracts 1/100th mm
124 	XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS, // replace "in" with "inch" and adds 1/100th mm
125     XML_ATACTION_DRAW_MIRROR_OOO,        // renames draw:mirror to style:mirror and adapts values
126     // --> OD 2005-05-12 #i49139#
127     XML_ATACTION_STYLE_MIRROR_OOO,        // adapts style:mirror values
128     // <--
129 	XML_ATACTION_DRAW_MIRROR_OASIS,		 // renames style:mirror to draw:mirror and adapts values
130 	XML_ATACTION_GAMMA_OASIS,			 // converts percentage to double value
131 	XML_ATACTION_GAMMA_OOO,				 // converts double value to percentage
132 	XML_ATACTION_DECODE_ID,				 // converts strings with non numeric characters to only numeric character ids
133 	XML_ATACTION_OPACITY_FIX,			 // converts transparency to opacity and back
134 	XML_ATACTION_SHAPEID,				 // convert shape id
135 	XML_ATACTION_USER_DEFINED=0x40000000,// user defined actions start here
136 	XML_ATACTION_END=XML_TACTION_END
137 };
138 
139 #endif	//  _XMLOFF_ATTRTRANSFORMERACTION_HXX
140