xref: /aoo41x/main/cppu/inc/uno/current_context.h (revision 24f6443d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _UNO_CURRENT_CONTEXT_H_
24 #define _UNO_CURRENT_CONTEXT_H_
25 
26 #include <rtl/ustring.h>
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 /** Gets the current task's context.
34 	@attention
35     Don't spread the returned interface around to other threads.  Every thread has its own
36     current context.
37 
38 	@param ppCurrentContext  inout param current context of type com.sun.star.uno.XCurrentContext
39 	@param pEnvDcp           descriptor of returned interface's environment
40 	@param pEnvContext       context of returned interface's environment (commonly 0)
41     @return                  true, if context ref was transferred (even if null ref)
42 */
43 sal_Bool SAL_CALL uno_getCurrentContext(
44 	void ** ppCurrentContext,
45 	rtl_uString * pEnvDcp, void * pEnvContext )
46 	SAL_THROW_EXTERN_C();
47 
48 /** Sets the current task's context.
49 
50 	@param pCurrentContext  in param current context of type com.sun.star.uno.XCurrentContext
51 	@param pEnvDcp          descriptor of interface's environment
52 	@param pEnvContext      context of interface's environment (commonly 0)
53     @return                 true, if context ref was transferred (even if null ref)
54 */
55 sal_Bool SAL_CALL uno_setCurrentContext(
56 	void * pCurrentContext,
57 	rtl_uString * pEnvDcp, void * pEnvContext )
58 	SAL_THROW_EXTERN_C();
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif
65