xref: /trunk/main/cppu/inc/uno/current_context.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _UNO_CURRENT_CONTEXT_H_
28 #define _UNO_CURRENT_CONTEXT_H_
29 
30 #include <rtl/ustring.h>
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 /** Gets the current task's context.
38 	@attention
39     Don't spread the returned interface around to other threads.  Every thread has its own
40     current context.
41 
42 	@param ppCurrentContext  inout param current context of type com.sun.star.uno.XCurrentContext
43 	@param pEnvDcp           descriptor of returned interface's environment
44 	@param pEnvContext       context of returned interface's environment (commonly 0)
45     @return                  true, if context ref was transferred (even if null ref)
46 */
47 sal_Bool SAL_CALL uno_getCurrentContext(
48 	void ** ppCurrentContext,
49 	rtl_uString * pEnvDcp, void * pEnvContext )
50 	SAL_THROW_EXTERN_C();
51 
52 /** Sets the current task's context.
53 
54 	@param pCurrentContext  in param current context of type com.sun.star.uno.XCurrentContext
55 	@param pEnvDcp          descriptor of interface's environment
56 	@param pEnvContext      context of interface's environment (commonly 0)
57     @return                 true, if context ref was transferred (even if null ref)
58 */
59 sal_Bool SAL_CALL uno_setCurrentContext(
60 	void * pCurrentContext,
61 	rtl_uString * pEnvDcp, void * pEnvContext )
62 	SAL_THROW_EXTERN_C();
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif
69