1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _XMLOFF_ATTRTRANSFORMERACTION_HXX
29 #define _XMLOFF_ATTRTRANSFORMERACTION_HXX
30 
31 #include "TransformerAction.hxx"
32 
33 enum XMLAttrTransformerAction
34 {
35 	XML_ATACTION_EOT=XML_TACTION_EOT,	// uses for initialization only
36 	XML_ATACTION_COPY, 					// copy attr
37 	XML_ATACTION_RENAME, 				// rename attr:
38 										// - param1: namespace +
39 										// 			 token of local name
40 	XML_ATACTION_REMOVE, 				// remove attr
41 	XML_ATACTION_IN2INCH,				// replace "in" with "inch"
42 	XML_ATACTION_INS2INCHS,				// replace "in" with "inch"
43 										// multiple times
44 	XML_ATACTION_IN2TWIPS,				// replace "in" with "inch" and
45 										// convert value from inch to twips
46 										// but only for writer documents
47 	XML_ATACTION_RENAME_IN2INCH,		// replace "in" with "inch" and rename
48 										// attr:
49 										// - param1: namespace +
50 										// 			 token of local name
51 	XML_ATACTION_INCH2IN,				// replace "inch" with "in"
52 	XML_ATACTION_INCHS2INS,				// replace "inch" with "in"
53 										// multiple times
54 	XML_ATACTION_TWIPS2IN,				// replace "inch" with "in" and for writer
55 										// documents convert measure value from twips
56 										// to inch
57 	XML_ATACTION_RENAME_INCH2IN,		// replace "inch" with "in" and rename
58 										// attr:
59 										// - param1: namespace +
60 										// 			 token of local name
61 	XML_ATACTION_STYLE_FAMILY,			// NOP, used for style:family
62 	XML_ATACTION_DECODE_STYLE_NAME,		// NOP, used for style:name
63 										// - param1: style family
64 	XML_ATACTION_STYLE_DISPLAY_NAME,	// NOP, used for style:display_name
65 										// - param1: style family
66 	XML_ATACTION_DECODE_STYLE_NAME_REF,	// NOP, used for style:name reference
67 										// - param1: style family
68 	XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF,	// NOP, used for style:name
69 										// - param1: namespace +
70 										// 			 token of local name
71 	XML_ATACTION_ENCODE_STYLE_NAME,		// NOP, used for style:name
72 	XML_ATACTION_ENCODE_STYLE_NAME_REF,	// NOP, used for style:name
73 	XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF,	// NOP, used for style:name
74 										// - param1: namespace +
75 										// 			 token of local name
76 										// - param2: style family
77 	XML_ATACTION_MOVE_TO_ELEM,			// turn attr into an elem
78 										// - param1: namespace +
79 										// 			 token of local name
80 	XML_ATACTION_MOVE_FROM_ELEM,		// turn elem into an attr:
81 										// - param1: namespace +
82 										// 			 token of local name
83 	XML_ATACTION_NEG_PERCENT,			// replace % val with 100-%
84 	XML_ATACTION_RENAME_NEG_PERCENT,	// replace % val with 100-%, rename attr
85 										// - param1: namespace +
86 										// 			 token of local name
87 	XML_ATACTION_HREF,					// xmlink:href
88 	XML_ATACTION_ADD_NAMESPACE_PREFIX,	// add a namespace prefix
89 										// - param1: prefix
90 	XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,	// add a namespace prefix
91 										// - param1: default prefix
92 	XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX,	// add a namespace prefix
93 										// - param1: namespace +
94 										// 			 token of local name
95 										// - param2: prefix
96 	XML_ATACTION_REMOVE_NAMESPACE_PREFIX,// remove a namespace prefix
97 										// - param1: prefix
98 	XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX,// remove any namespace prefix
99 	XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,// remove a namespace prefix
100 										// - param1: namespace +
101 										// 			 token of local name
102 										// - param2: prefix
103 	XML_ATACTION_EVENT_NAME,
104 	XML_ATACTION_MACRO_NAME,
105 	XML_ATACTION_MACRO_LOCATION,
106 	XML_ATACTION_DLG_BORDER,
107 	XML_ATACTION_URI_OOO,				 // an URI in OOo notation
108 										 // - param1: pacakage URI are supported
109 	XML_ATACTION_URI_OASIS,				 // an URI in OASIS notation
110 										 // - param1: pacakage URI are supported
111     XML_ATACTION_RENAME_ATTRIBUTE,       // rename up to 3 different possible values of an attrbiute
112                                          // - param1: token of old attribute value (lower 16 bit)
113                                          //           + token of new attribute value (upper 16 bit)
114                                          // - param2: token of old attribute value
115                                          //           + token of new attribute value
116                                          // - param3: token of old attribute value
117                                          //           + token of new attribute value
118                                          // if param2 or param3 are unused they must contain
119                                          // XML_TOKEN_INVALID
120     XML_ATACTION_RNG2ISO_DATETIME,       // converts . into , in datetimes
121     XML_ATACTION_RENAME_RNG2ISO_DATETIME,// converts . into , in datetimes and renames the attribute
122                                          // - param1: namespace +
123                                          //           token of local name
124 	XML_ATACTION_MOVE_FROM_ELEM_RNG2ISO_DATETIME, // turn elem into an attr and convert . to , in datetimes
125 										// - param1: namespace +
126 										// 			 token of local name
127 	XML_ATACTION_SVG_WIDTH_HEIGHT_OOO,	 // replace "inch" with "in" and subtracts 1/100th mm
128 	XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS, // replace "in" with "inch" and adds 1/100th mm
129     XML_ATACTION_DRAW_MIRROR_OOO,        // renames draw:mirror to style:mirror and adapts values
130     // --> OD 2005-05-12 #i49139#
131     XML_ATACTION_STYLE_MIRROR_OOO,        // adapts style:mirror values
132     // <--
133 	XML_ATACTION_DRAW_MIRROR_OASIS,		 // renames style:mirror to draw:mirror and adapts values
134 	XML_ATACTION_GAMMA_OASIS,			 // converts percentage to double value
135 	XML_ATACTION_GAMMA_OOO,				 // converts double value to percentage
136 	XML_ATACTION_DECODE_ID,				 // converts strings with non numeric characters to only numeric character ids
137 	XML_ATACTION_OPACITY_FIX,			 // converts transparency to opacity and back
138 	XML_ATACTION_SHAPEID,				 // convert shape id
139 	XML_ATACTION_USER_DEFINED=0x40000000,// user defined actions start here
140 	XML_ATACTION_END=XML_TACTION_END
141 };
142 
143 #endif	//  _XMLOFF_ATTRTRANSFORMERACTION_HXX
144