Update ooo320-m1
[ooovba.git] / scripting / source / inc / util / scriptingconstants.hxx
blobcd4d6c83f0468426f8c3dc1e545b8bcf116803e5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: scriptingconstants.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _COM_SUN_STAR_SCRIPTING_UTIL_SCRIPTINGCONSTANTS_HXX_
31 #define _COM_SUN_STAR_SCRIPTING_UTIL_SCRIPTINGCONSTANTS_HXX_
33 namespace scripting_constants
36 class ScriptingConstantsPool
38 public:
39 const ::rtl::OUString DOC_REF;
40 const ::rtl::OUString DOC_STORAGE_ID;
41 const ::rtl::OUString DOC_URI;
42 const ::rtl::OUString RESOLVED_STORAGE_ID;
43 const ::rtl::OUString SCRIPT_INFO;
44 const ::rtl::OUString SCRIPTSTORAGEMANAGER_SERVICE;
45 const sal_Int32 SHARED_STORAGE_ID;
46 const sal_Int32 USER_STORAGE_ID;
47 const sal_Int32 DOC_STORAGE_ID_NOT_SET;
49 static ScriptingConstantsPool& instance()
51 static ScriptingConstantsPool *pPool = 0;
52 if( ! pPool )
54 ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
55 if( ! pPool )
57 static ScriptingConstantsPool pool;
58 pPool = &pool;
61 return *pPool;
63 private:
64 ScriptingConstantsPool( const ScriptingConstantsPool & );
65 ScriptingConstantsPool& operator = ( const ScriptingConstantsPool & );
66 ScriptingConstantsPool()
67 : DOC_REF( RTL_CONSTASCII_USTRINGPARAM( "SCRIPTING_DOC_REF" ) ),
68 DOC_STORAGE_ID( RTL_CONSTASCII_USTRINGPARAM(
69 "SCRIPTING_DOC_STORAGE_ID" ) ),
70 DOC_URI( RTL_CONSTASCII_USTRINGPARAM( "SCRIPTING_DOC_URI" ) ),
71 RESOLVED_STORAGE_ID( RTL_CONSTASCII_USTRINGPARAM(
72 "SCRIPTING_RESOLVED_STORAGE_ID" ) ),
73 SCRIPT_INFO( RTL_CONSTASCII_USTRINGPARAM( "SCRIPT_INFO" ) ),
74 SCRIPTSTORAGEMANAGER_SERVICE( RTL_CONSTASCII_USTRINGPARAM(
75 "/singletons/com.sun.star.script.framework.storage.theScriptStorageManager" ) ),
76 SHARED_STORAGE_ID( 0 ), USER_STORAGE_ID( 1 ),
77 DOC_STORAGE_ID_NOT_SET( -1 )
82 #endif