1*6998d047SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*6998d047SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*6998d047SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*6998d047SAndrew Rist  * distributed with this work for additional information
6*6998d047SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*6998d047SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*6998d047SAndrew Rist  * "License"); you may not use this file except in compliance
9*6998d047SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*6998d047SAndrew Rist  *
11*6998d047SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*6998d047SAndrew Rist  *
13*6998d047SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*6998d047SAndrew Rist  * software distributed under the License is distributed on an
15*6998d047SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6998d047SAndrew Rist  * KIND, either express or implied.  See the License for the
17*6998d047SAndrew Rist  * specific language governing permissions and limitations
18*6998d047SAndrew Rist  * under the License.
19*6998d047SAndrew Rist  *
20*6998d047SAndrew Rist  *************************************************************/
21*6998d047SAndrew Rist 
22*6998d047SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SCRIPTING_BASMETHNODE_HXX
25cdf0e10cSrcweir #define SCRIPTING_BASMETHNODE_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "bcholder.hxx"
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
29cdf0e10cSrcweir #include <com/sun/star/script/XInvocation.hpp>
30cdf0e10cSrcweir #include <com/sun/star/script/browse/XBrowseNode.hpp>
31cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
32cdf0e10cSrcweir #include <comphelper/proparrhlp.hxx>
33cdf0e10cSrcweir #include <comphelper/propertycontainer.hxx>
34cdf0e10cSrcweir #include <comphelper/uno3.hxx>
35cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class SbMethod;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 
41cdf0e10cSrcweir //.........................................................................
42cdf0e10cSrcweir namespace basprov
43cdf0e10cSrcweir {
44cdf0e10cSrcweir //.........................................................................
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     //	----------------------------------------------------
47cdf0e10cSrcweir     //	class BasicMethodNodeImpl
48cdf0e10cSrcweir     //	----------------------------------------------------
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     typedef ::cppu::WeakImplHelper2<
51cdf0e10cSrcweir         ::com::sun::star::script::browse::XBrowseNode,
52cdf0e10cSrcweir         ::com::sun::star::script::XInvocation > BasicMethodNodeImpl_BASE;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     class BasicMethodNodeImpl : public BasicMethodNodeImpl_BASE,
55cdf0e10cSrcweir                                 public ::scripting_helper::OMutexHolder,
56cdf0e10cSrcweir                                 public ::scripting_helper::OBroadcastHelperHolder,
57cdf0e10cSrcweir                                 public ::comphelper::OPropertyContainer,
58cdf0e10cSrcweir                                 public ::comphelper::OPropertyArrayUsageHelper< BasicMethodNodeImpl >
59cdf0e10cSrcweir     {
60cdf0e10cSrcweir     private:
61cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >    m_xContext;
62cdf0e10cSrcweir 	::rtl::OUString m_sScriptingContext;
63cdf0e10cSrcweir         SbMethod* m_pMethod;
64cdf0e10cSrcweir         bool m_bIsAppScript;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir         // properties
67cdf0e10cSrcweir         ::rtl::OUString m_sURI;
68cdf0e10cSrcweir         sal_Bool m_bEditable;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     protected:
71cdf0e10cSrcweir         // OPropertySetHelper
72cdf0e10cSrcweir         virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(  );
73cdf0e10cSrcweir 
74cdf0e10cSrcweir         // OPropertyArrayUsageHelper
75cdf0e10cSrcweir         virtual ::cppu::IPropertyArrayHelper* createArrayHelper(  ) const;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     public:
78cdf0e10cSrcweir         BasicMethodNodeImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
79cdf0e10cSrcweir             const ::rtl::OUString& sScriptingContext,
80cdf0e10cSrcweir             SbMethod* pMethod, bool isAppScript = true );
81cdf0e10cSrcweir         virtual ~BasicMethodNodeImpl();
82cdf0e10cSrcweir 
83cdf0e10cSrcweir         // XInterface
84cdf0e10cSrcweir         DECLARE_XINTERFACE()
85cdf0e10cSrcweir 
86cdf0e10cSrcweir         // XTypeProvider
87cdf0e10cSrcweir         DECLARE_XTYPEPROVIDER()
88cdf0e10cSrcweir 
89cdf0e10cSrcweir         // XBrowseNode
90cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getName(  )
91cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
92cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > > SAL_CALL getChildNodes(  )
93cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir         virtual sal_Bool SAL_CALL hasChildNodes(  )
95cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir         virtual sal_Int16 SAL_CALL getType(  )
97cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
98cdf0e10cSrcweir 
99cdf0e10cSrcweir         // XPropertySet
100cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  )
101cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir         // XInvocation
104cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  )
105cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL invoke(
107cdf0e10cSrcweir             const ::rtl::OUString& aFunctionName,
108cdf0e10cSrcweir             const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
109cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
110cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam )
111cdf0e10cSrcweir             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::script::CannotConvertException,
112cdf0e10cSrcweir                    ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException);
113cdf0e10cSrcweir         virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
114cdf0e10cSrcweir             throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::script::CannotConvertException,
115cdf0e10cSrcweir                    ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException);
116cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName )
117cdf0e10cSrcweir             throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
118cdf0e10cSrcweir         virtual sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName )
119cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
120cdf0e10cSrcweir         virtual sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName )
121cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
122cdf0e10cSrcweir     };
123cdf0e10cSrcweir 
124cdf0e10cSrcweir //.........................................................................
125cdf0e10cSrcweir }	// namespace basprov
126cdf0e10cSrcweir //.........................................................................
127cdf0e10cSrcweir 
128cdf0e10cSrcweir #endif // SCRIPTING_BASMETHNODE_HXX
129