1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_JAVACONTEXT_HXX
21 #define INCLUDED_SVTOOLS_JAVACONTEXT_HXX
23 #include <svtools/svtdllapi.h>
24 #include <osl/mutex.hxx>
26 #include <com/sun/star/task/XInteractionHandler.hpp>
27 #include <com/sun/star/task/XInteractionRequest.hpp>
28 #include <com/sun/star/uno/XCurrentContext.hpp>
33 // We cannot derive from cppu::WeakImplHelper because we would export the inline
34 //generated class. This conflicts with other libraries if they use the same inline
36 class SVT_DLLPUBLIC JavaContext
:
37 public com::sun::star::uno::XCurrentContext
41 /** The parameter bShowErrorsOnce controls whether a message box is
42 only displayed once for a reocurring Java error. That is only
43 the first time JavaInteractionHandler.handle is called with a
44 particular Request then the message box is shown. Afterwards
47 JavaContext( const com::sun::star::uno::Reference
<
48 com::sun::star::uno::XCurrentContext
> & ctx
,
49 bool bReportErrorOnce
= true );
50 virtual ~JavaContext();
53 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
54 const ::com::sun::star::uno::Type
& aType
)
55 throw (::com::sun::star::uno::RuntimeException
);
57 virtual void SAL_CALL
acquire() throw ();
59 virtual void SAL_CALL
release() throw ();
62 virtual com::sun::star::uno::Any SAL_CALL
getValueByName( const OUString
& Name
)
63 throw (com::sun::star::uno::RuntimeException
);
66 SVT_DLLPRIVATE
JavaContext(); //not implemented
67 SVT_DLLPRIVATE
JavaContext(JavaContext
&); //not implemented
68 SVT_DLLPRIVATE JavaContext
& operator = (JavaContext
&); //not implemented
70 oslInterlockedCount m_aRefCount
;
72 com::sun::star::uno::Reference
<
73 com::sun::star::uno::XCurrentContext
> m_xNextContext
;
74 com::sun::star::uno::Reference
<
75 com::sun::star::task::XInteractionHandler
> m_xHandler
;
76 bool m_bShowErrorsOnce
;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */