sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / javacontext.hxx
blobf8df0b40ed5c0ef08f759ab375fb853a87851066
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: javacontext.hxx,v $
10 * $Revision: 1.3 $
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 ************************************************************************/
31 #ifndef _SVTOOLS_JAVACONTEXT_HXX_
32 #define _SVTOOLS_JAVACONTEXT_HXX_
34 #ifndef INCLUDED_SVTDLLAPI_H
35 #include "bf_svtools/svtdllapi.h"
36 #endif
37 #ifndef _OSL_MUTEX_HXX_
38 #include <osl/mutex.hxx>
39 #endif
41 #include <com/sun/star/task/XInteractionHandler.hpp>
42 #include <com/sun/star/task/XInteractionRequest.hpp>
43 #include <com/sun/star/uno/XCurrentContext.hpp>
46 namespace binfilter
48 // We cannot derive from cppu::WeakImplHelper because we would export the inline
49 //generated class. This conflicts with other libraries if they use the same inline
50 //class.
51 class JavaContext :
52 public com::sun::star::uno::XCurrentContext
55 public:
56 JavaContext( const com::sun::star::uno::Reference<
57 com::sun::star::uno::XCurrentContext> & ctx);
59 /** The parameter bShowErrorsOnce controls whether a message box is
60 only displayed once for a reocurring Java error. That is only
61 the first time JavaInteractionHandler.handle is called with a
62 particular Request then the message box is shown. Afterwards
63 nothing happens.
65 JavaContext( const com::sun::star::uno::Reference<
66 com::sun::star::uno::XCurrentContext> & ctx,
67 bool bReportErrorOnce);
68 virtual ~JavaContext();
70 // XInterface
71 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
72 const ::com::sun::star::uno::Type& aType )
73 throw (::com::sun::star::uno::RuntimeException);
75 virtual void SAL_CALL acquire() throw ();
77 virtual void SAL_CALL release() throw ();
79 // XCurrentContext
80 virtual com::sun::star::uno::Any SAL_CALL getValueByName( const rtl::OUString& Name )
81 throw (com::sun::star::uno::RuntimeException);
83 private:
84 JavaContext(); //not implemented
85 JavaContext(JavaContext&); //not implemented
86 JavaContext& operator = (JavaContext&); //not implemented
88 oslInterlockedCount m_aRefCount;
90 com::sun::star::uno::Reference<
91 com::sun::star::uno::XCurrentContext > m_xNextContext;
92 com::sun::star::uno::Reference<
93 com::sun::star::task::XInteractionHandler> m_xHandler;
94 bool m_bShowErrorsOnce;
98 #endif