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)
34 #define A_TOKEN( token ) OOX_TOKEN( dml, token )
35 #define AX_TOKEN( token ) OOX_TOKEN( ax, token )
36 #define C_TOKEN( token ) OOX_TOKEN( dmlChart, token )
37 #define CDR_TOKEN( token ) OOX_TOKEN( dmlChartDr, token )
38 #define DGM_TOKEN( token ) OOX_TOKEN( dmlDiagram, token )
39 #define MCE_TOKEN( token ) OOX_TOKEN( mce, token)
40 #define O_TOKEN( token ) OOX_TOKEN( vmlOffice, token )
41 #define PC_TOKEN( token ) OOX_TOKEN( packageContentTypes, token )
42 #define PPT_TOKEN( token ) OOX_TOKEN( ppt, token )
43 #define PR_TOKEN( token ) OOX_TOKEN( packageRel, token )
44 #define R_TOKEN( token ) OOX_TOKEN( officeRel, token )
45 #define VML_TOKEN( token ) OOX_TOKEN( vml, token )
46 #define VMLX_TOKEN( token ) OOX_TOKEN( vmlExcel, token )
47 #define XDR_TOKEN( token ) OOX_TOKEN( dmlSpreadDr, token )
48 #define XLS_TOKEN( token ) OOX_TOKEN( xls, token )
49 #define XLS14_TOKEN( token ) OOX_TOKEN( xls14Lst, token )
50 #define XM_TOKEN( token ) OOX_TOKEN( xm, token )
51 #define XML_TOKEN( token ) OOX_TOKEN( xml, token )
52 #define VMLPPT_TOKEN( token ) OOX_TOKEN( vmlPowerpoint, token )
53 #define DSP_TOKEN( token ) OOX_TOKEN( dsp, token )
54 #define LC_TOKEN( token ) OOX_TOKEN( dmlLockedCanvas, token )
55 #define WPS_TOKEN( token ) OOX_TOKEN( wps, token )
56 #define WPG_TOKEN( token ) OOX_TOKEN( wpg, token )
57 #define W_TOKEN( token ) OOX_TOKEN( doc, token )
58 #define LOEXT_TOKEN( token ) OOX_TOKEN( loext, token )