1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ScriptingContext.hxx,v $
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 _FRAMEWORK_SCRIPT_PROTOCOLHANDLER_SCRIPTING_CONTEXT_HXX_
32 #define _FRAMEWORK_SCRIPT_PROTOCOLHANDLER_SCRIPTING_CONTEXT_HXX_
35 #include <osl/mutex.hxx>
36 #include <rtl/ustring.hxx>
37 #include <cppuhelper/implbase1.hxx>
38 #include <comphelper/uno3.hxx>
39 #include <comphelper/propertycontainer.hxx>
40 #include <comphelper/proparrhlp.hxx>
42 #include <cppuhelper/implbase1.hxx>
43 #include <cppuhelper/weak.hxx>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/uno/RuntimeException.hpp>
46 #include <com/sun/star/uno/RuntimeException.hpp>
47 #include <com/sun/star/beans/XPropertySet.hpp>
48 #include <comphelper/broadcasthelper.hxx>
49 namespace func_provider
52 #define css ::com::sun::star
55 //=============================================================================
56 //typedef ::cppu::WeakImplHelper1< css::beans::XPropertySet > ScriptingContextImpl_BASE;
58 class ScriptingContext
: public ::comphelper::OMutexAndBroadcastHelper
, public ::comphelper::OPropertyContainer
,
59 public ::comphelper::OPropertyArrayUsageHelper
< ScriptingContext
>, public css::lang::XTypeProvider
, public ::cppu::OWeakObject
63 ScriptingContext( const css::uno::Reference
< css::uno::XComponentContext
> & xContext
);
67 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
)
68 throw( css::uno::RuntimeException
)
70 css::uno::Any
aRet( OPropertySetHelper::queryInterface( rType
) );
71 return (aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
));
73 void SAL_CALL
acquire() throw() { ::cppu::OWeakObject::acquire(); }
74 void SAL_CALL
release() throw() { ::cppu::OWeakObject::release(); }
76 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( )
77 throw ( css::uno::RuntimeException
);
79 DECLARE_XTYPEPROVIDER( )
84 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper( );
86 // OPropertyArrayUsageHelper
87 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const;
89 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
94 #endif //_FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_