1*cdf0e10cSrcweir
2*cdf0e10cSrcweir// ============================================================================
3*cdf0e10cSrcweir
4*cdf0e10cSrcweirconst sal_Int32 TOKEN_MASK      = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 );
5*cdf0e10cSrcweirconst sal_Int32 NMSP_MASK       = static_cast< sal_Int32 >( SAL_MAX_INT16 & ~TOKEN_MASK );
6*cdf0e10cSrcweir
7*cdf0e10cSrcweir/** Returns the raw token identifier without namespace of the passed token. */
8*cdf0e10cSrcweirinline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; }
9*cdf0e10cSrcweir
10*cdf0e10cSrcweir/** Returns the namespace without token identifier of the passed token. */
11*cdf0e10cSrcweirinline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
12*cdf0e10cSrcweir
13*cdf0e10cSrcweir
14*cdf0e10cSrcweir// defines for tokens with specific namespaces
15*cdf0e10cSrcweir#define OOX_TOKEN( namespace, token ) (::oox::NMSP_##namespace | ::oox::XML_##token)
16*cdf0e10cSrcweir
17*cdf0e10cSrcweir#define A_TOKEN( token )        OOX_TOKEN( dml, token )
18*cdf0e10cSrcweir#define AX_TOKEN( token )       OOX_TOKEN( ax, token )
19*cdf0e10cSrcweir#define C_TOKEN( token )        OOX_TOKEN( dmlChart, token )
20*cdf0e10cSrcweir#define CDR_TOKEN( token )      OOX_TOKEN( dmlChartDr, token )
21*cdf0e10cSrcweir#define DGM_TOKEN( token )      OOX_TOKEN( dmlDiagram, token )
22*cdf0e10cSrcweir#define O_TOKEN( token )        OOX_TOKEN( vmlOffice, token )
23*cdf0e10cSrcweir#define PC_TOKEN( token )       OOX_TOKEN( packageContentTypes, token )
24*cdf0e10cSrcweir#define PPT_TOKEN( token )      OOX_TOKEN( ppt, token )
25*cdf0e10cSrcweir#define PR_TOKEN( token )       OOX_TOKEN( packageRel, token )
26*cdf0e10cSrcweir#define R_TOKEN( token )        OOX_TOKEN( officeRel, token )
27*cdf0e10cSrcweir#define VML_TOKEN( token )      OOX_TOKEN( vml, token )
28*cdf0e10cSrcweir#define VMLX_TOKEN( token )     OOX_TOKEN( vmlExcel, token )
29*cdf0e10cSrcweir#define XDR_TOKEN( token )      OOX_TOKEN( dmlSpreadDr, token )
30*cdf0e10cSrcweir#define XLS_TOKEN( token )      OOX_TOKEN( xls, token )
31*cdf0e10cSrcweir#define XM_TOKEN( token )       OOX_TOKEN( xm, token )
32*cdf0e10cSrcweir#define XML_TOKEN( token )      OOX_TOKEN( xml, token )
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir// ============================================================================
35*cdf0e10cSrcweir
36*cdf0e10cSrcweir} // namespace oox
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#endif
39