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: basmethnode.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 SCRIPTING_BASMETHNODE_HXX
32 #define SCRIPTING_BASMETHNODE_HXX
34 #include "bcholder.hxx"
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/script/XInvocation.hpp>
37 #include <com/sun/star/script/browse/XBrowseNode.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <comphelper/proparrhlp.hxx>
40 #include <comphelper/propertycontainer.hxx>
41 #include <comphelper/uno3.hxx>
42 #include <cppuhelper/implbase2.hxx>
48 //.........................................................................
51 //.........................................................................
53 // ----------------------------------------------------
54 // class BasicMethodNodeImpl
55 // ----------------------------------------------------
57 typedef ::cppu::WeakImplHelper2
<
58 ::com::sun::star::script::browse::XBrowseNode
,
59 ::com::sun::star::script::XInvocation
> BasicMethodNodeImpl_BASE
;
61 class BasicMethodNodeImpl
: public BasicMethodNodeImpl_BASE
,
62 public ::scripting_helper::OMutexHolder
,
63 public ::scripting_helper::OBroadcastHelperHolder
,
64 public ::comphelper::OPropertyContainer
,
65 public ::comphelper::OPropertyArrayUsageHelper
< BasicMethodNodeImpl
>
68 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
69 ::rtl::OUString m_sScriptingContext
;
74 ::rtl::OUString m_sURI
;
79 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper( );
81 // OPropertyArrayUsageHelper
82 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const;
85 BasicMethodNodeImpl( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
,
86 const ::rtl::OUString
& sScriptingContext
,
87 SbMethod
* pMethod
, bool isAppScript
= true );
88 virtual ~BasicMethodNodeImpl();
94 DECLARE_XTYPEPROVIDER()
97 virtual ::rtl::OUString SAL_CALL
getName( )
98 throw (::com::sun::star::uno::RuntimeException
);
99 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::script::browse::XBrowseNode
> > SAL_CALL
getChildNodes( )
100 throw (::com::sun::star::uno::RuntimeException
);
101 virtual sal_Bool SAL_CALL
hasChildNodes( )
102 throw (::com::sun::star::uno::RuntimeException
);
103 virtual sal_Int16 SAL_CALL
getType( )
104 throw (::com::sun::star::uno::RuntimeException
);
107 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( )
108 throw (::com::sun::star::uno::RuntimeException
);
111 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XIntrospectionAccess
> SAL_CALL
getIntrospection( )
112 throw (::com::sun::star::uno::RuntimeException
);
113 virtual ::com::sun::star::uno::Any SAL_CALL
invoke(
114 const ::rtl::OUString
& aFunctionName
,
115 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aParams
,
116 ::com::sun::star::uno::Sequence
< sal_Int16
>& aOutParamIndex
,
117 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aOutParam
)
118 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::script::CannotConvertException
,
119 ::com::sun::star::reflection::InvocationTargetException
, ::com::sun::star::uno::RuntimeException
);
120 virtual void SAL_CALL
setValue( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
)
121 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::script::CannotConvertException
,
122 ::com::sun::star::reflection::InvocationTargetException
, ::com::sun::star::uno::RuntimeException
);
123 virtual ::com::sun::star::uno::Any SAL_CALL
getValue( const ::rtl::OUString
& aPropertyName
)
124 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
125 virtual sal_Bool SAL_CALL
hasMethod( const ::rtl::OUString
& aName
)
126 throw (::com::sun::star::uno::RuntimeException
);
127 virtual sal_Bool SAL_CALL
hasProperty( const ::rtl::OUString
& aName
)
128 throw (::com::sun::star::uno::RuntimeException
);
131 //.........................................................................
132 } // namespace basprov
133 //.........................................................................
135 #endif // SCRIPTING_BASMETHNODE_HXX