Branch libreoffice-5-0-4
[LibreOffice.git] / scripting / source / basprov / basmethnode.hxx
blobae45a30828d2144dfc4ddc06cc98013ce4592604
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SCRIPTING_SOURCE_BASPROV_BASMETHNODE_HXX
21 #define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASMETHNODE_HXX
23 #include "bcholder.hxx"
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/script/XInvocation.hpp>
26 #include <com/sun/star/script/browse/XBrowseNode.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <comphelper/proparrhlp.hxx>
29 #include <comphelper/propertycontainer.hxx>
30 #include <comphelper/uno3.hxx>
31 #include <cppuhelper/implbase2.hxx>
34 class SbMethod;
38 namespace basprov
43 // class BasicMethodNodeImpl
46 typedef ::cppu::WeakImplHelper2<
47 ::com::sun::star::script::browse::XBrowseNode,
48 ::com::sun::star::script::XInvocation > BasicMethodNodeImpl_BASE;
50 class BasicMethodNodeImpl : public BasicMethodNodeImpl_BASE,
51 public ::scripting_helper::OMutexHolder,
52 public ::scripting_helper::OBroadcastHelperHolder,
53 public ::comphelper::OPropertyContainer,
54 public ::comphelper::OPropertyArrayUsageHelper< BasicMethodNodeImpl >
56 private:
57 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
58 OUString m_sScriptingContext;
59 SbMethod* m_pMethod;
60 bool m_bIsAppScript;
62 // properties
63 OUString m_sURI;
64 bool m_bEditable;
66 protected:
67 // OPropertySetHelper
68 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) SAL_OVERRIDE;
70 // OPropertyArrayUsageHelper
71 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
73 public:
74 BasicMethodNodeImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
75 const OUString& sScriptingContext,
76 SbMethod* pMethod, bool isAppScript = true );
77 virtual ~BasicMethodNodeImpl();
79 // XInterface
80 DECLARE_XINTERFACE()
82 // XTypeProvider
83 DECLARE_XTYPEPROVIDER()
85 // XBrowseNode
86 virtual OUString SAL_CALL getName( )
87 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > > SAL_CALL getChildNodes( )
89 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
90 virtual sal_Bool SAL_CALL hasChildNodes( )
91 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 virtual sal_Int16 SAL_CALL getType( )
93 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 // XPropertySet
96 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
97 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 // XInvocation
100 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > SAL_CALL getIntrospection( )
101 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 virtual ::com::sun::star::uno::Any SAL_CALL invoke(
103 const OUString& aFunctionName,
104 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
105 ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
106 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam )
107 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::script::CannotConvertException,
108 ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 virtual void SAL_CALL setValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
110 throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::script::CannotConvertException,
111 ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 virtual ::com::sun::star::uno::Any SAL_CALL getValue( const OUString& aPropertyName )
113 throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 virtual sal_Bool SAL_CALL hasMethod( const OUString& aName )
115 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 virtual sal_Bool SAL_CALL hasProperty( const OUString& aName )
117 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 } // namespace basprov
124 #endif // INCLUDED_SCRIPTING_SOURCE_BASPROV_BASMETHNODE_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */