2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 const sal_Int32 TOKEN_MASK = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 );
22 const sal_Int32 NMSP_MASK = static_cast< sal_Int32 >( SAL_MAX_INT32 & ~TOKEN_MASK );
24 /** Returns the raw token identifier without namespace of the passed token. */
25 inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; }
27 /** Returns the namespace without token identifier of the passed token. */
28 inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
31 // defines for tokens with specific namespaces
32 #define OOX_TOKEN( namespace, token ) (::oox::NMSP_##namespace | ::oox::XML_##token)
33 #define OOX_NS( namespace ) (::oox::NMSP_##namespace)
35 #define A_TOKEN( token ) OOX_TOKEN( dml, token )
36 #define AX_TOKEN( token ) OOX_TOKEN( ax, token )
37 #define C_TOKEN( token ) OOX_TOKEN( dmlChart, token )
38 #define CDR_TOKEN( token ) OOX_TOKEN( dmlChartDr, token )
39 #define DGM_TOKEN( token ) OOX_TOKEN( dmlDiagram, token )
40 #define MCE_TOKEN( token ) OOX_TOKEN( mce, token)
41 #define O_TOKEN( token ) OOX_TOKEN( vmlOffice, token )
42 #define PC_TOKEN( token ) OOX_TOKEN( packageContentTypes, token )
43 #define PPT_TOKEN( token ) OOX_TOKEN( ppt, token )
44 #define P14_TOKEN( token ) OOX_TOKEN( p14, token )
45 #define P15_TOKEN( token ) OOX_TOKEN( p15, token )
46 #define PR_TOKEN( token ) OOX_TOKEN( packageRel, token )
47 #define R_TOKEN( token ) OOX_TOKEN( officeRel, token )
48 #define VML_TOKEN( token ) OOX_TOKEN( vml, token )
49 #define VMLX_TOKEN( token ) OOX_TOKEN( vmlExcel, token )
50 #define X12AC_TOKEN( token ) OOX_TOKEN( x12ac, token )
51 #define XDR_TOKEN( token ) OOX_TOKEN( dmlSpreadDr, token )
52 #define XLS_TOKEN( token ) OOX_TOKEN( xls, token )
53 #define XLS14_TOKEN( token ) OOX_TOKEN( xls14Lst, token )
54 #define XM_TOKEN( token ) OOX_TOKEN( xm, token )
55 #define XML_TOKEN( token ) OOX_TOKEN( xml, token )
56 #define VMLPPT_TOKEN( token ) OOX_TOKEN( vmlPowerpoint, token )
57 #define DSP_TOKEN( token ) OOX_TOKEN( dsp, token )
58 #define LC_TOKEN( token ) OOX_TOKEN( dmlLockedCanvas, token )
59 #define WPS_TOKEN( token ) OOX_TOKEN( wps, token )
60 #define WPG_TOKEN( token ) OOX_TOKEN( wpg, token )
61 #define W_TOKEN( token ) OOX_TOKEN( doc, token )
62 #define LOEXT_TOKEN( token ) OOX_TOKEN( loext, token )
63 #define M_TOKEN(token) OOX_TOKEN(officeMath, token)