summaryrefslogtreecommitdiffstats
path: root/oox/source/token/namespaces.hxx.tail
blob: 34513e850fe50301090b48d67a5085b6948b638a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */



const sal_Int32 TOKEN_MASK          = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 );
const sal_Int32 NMSP_MASK           = static_cast< sal_Int32 >( SAL_MAX_INT32 & ~TOKEN_MASK );

/** Returns the raw token identifier without namespace of the passed token. */
inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; }

/** Returns the namespace without token identifier of the passed token. */
inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }


// defines for tokens with specific namespaces
#define OOX_TOKEN( namespace, token ) (::oox::NMSP_##namespace | ::oox::XML_##token)
#define OOX_NS( namespace ) (::oox::NMSP_##namespace)

#define A_TOKEN( token )        OOX_TOKEN( dml, token )
#define AX_TOKEN( token )       OOX_TOKEN( ax, token )
#define C_TOKEN( token )        OOX_TOKEN( dmlChart, token )
#define CDR_TOKEN( token )      OOX_TOKEN( dmlChartDr, token )
#define DGM_TOKEN( token )      OOX_TOKEN( dmlDiagram, token )
#define MCE_TOKEN( token )      OOX_TOKEN( mce, token)
#define O_TOKEN( token )        OOX_TOKEN( vmlOffice, token )
#define PC_TOKEN( token )       OOX_TOKEN( packageContentTypes, token )
#define PPT_TOKEN( token )      OOX_TOKEN( ppt, token )
#define P14_TOKEN( token )      OOX_TOKEN( p14, token )
#define P15_TOKEN( token )      OOX_TOKEN( p15, token )
#define C15_TOKEN( token )      OOX_TOKEN( c15, token )
#define PR_TOKEN( token )       OOX_TOKEN( packageRel, token )
#define R_TOKEN( token )        OOX_TOKEN( officeRel, token )
#define VML_TOKEN( token )      OOX_TOKEN( vml, token )
#define VMLX_TOKEN( token )     OOX_TOKEN( vmlExcel, token )
#define X12AC_TOKEN( token )    OOX_TOKEN( x12ac, token )
#define XDR_TOKEN( token )      OOX_TOKEN( dmlSpreadDr, token )
#define XLS_TOKEN( token )      OOX_TOKEN( xls, token )
#define XLS14_TOKEN( token )    OOX_TOKEN( xls14Lst, token )
#define XM_TOKEN( token )       OOX_TOKEN( xm, token )
#define XML_TOKEN( token )      OOX_TOKEN( xml, token )
#define VMLPPT_TOKEN( token )   OOX_TOKEN( vmlPowerpoint, token )
#define DSP_TOKEN( token )      OOX_TOKEN( dsp, token )
#define LC_TOKEN( token )       OOX_TOKEN( dmlLockedCanvas, token )
#define WPS_TOKEN( token )      OOX_TOKEN( wps, token )
#define WPG_TOKEN( token )      OOX_TOKEN( wpg, token )
#define W_TOKEN( token )        OOX_TOKEN( doc, token )
#define LOEXT_TOKEN( token )    OOX_TOKEN( loext, token )
#define M_TOKEN(token)          OOX_TOKEN(officeMath, token)
#define XR2_TOKEN(token)        OOX_TOKEN(xr2, token)
#define WPC_TOKEN(token)        OOX_TOKEN(wpc, token)


} // namespace oox

#endif