1*caf5cd79SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*caf5cd79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*caf5cd79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*caf5cd79SAndrew Rist  * distributed with this work for additional information
6*caf5cd79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*caf5cd79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*caf5cd79SAndrew Rist  * "License"); you may not use this file except in compliance
9*caf5cd79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*caf5cd79SAndrew Rist  *
11*caf5cd79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*caf5cd79SAndrew Rist  *
13*caf5cd79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*caf5cd79SAndrew Rist  * software distributed under the License is distributed on an
15*caf5cd79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*caf5cd79SAndrew Rist  * KIND, either express or implied.  See the License for the
17*caf5cd79SAndrew Rist  * specific language governing permissions and limitations
18*caf5cd79SAndrew Rist  * under the License.
19*caf5cd79SAndrew Rist  *
20*caf5cd79SAndrew Rist  *************************************************************/
21*caf5cd79SAndrew Rist 
22*caf5cd79SAndrew Rist 
23cdf0e10cSrcweir #include "precompiled_connectivity.hxx"
24cdf0e10cSrcweir #include <com/sun/star/util/XStringSubstitution.hpp>
25cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
26cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
27cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
28cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp>
29cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace connectivity
32cdf0e10cSrcweir {
33cdf0e10cSrcweir     typedef ::cppu::WeakImplHelper3< ::com::sun::star::util::XStringSubstitution
34cdf0e10cSrcweir                                     ,::com::sun::star::lang::XServiceInfo
35cdf0e10cSrcweir                                     ,::com::sun::star::lang::XInitialization > ParameterSubstitution_BASE;
36cdf0e10cSrcweir     class ParameterSubstitution : public ParameterSubstitution_BASE
37cdf0e10cSrcweir     {
38cdf0e10cSrcweir         ::osl::Mutex                                                                    m_aMutex;
39cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >    m_xContext;
40cdf0e10cSrcweir         ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XConnection >     m_xConnection;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir         ParameterSubstitution( const ParameterSubstitution& );
43cdf0e10cSrcweir         ParameterSubstitution& operator=( const ParameterSubstitution& );
44cdf0e10cSrcweir     public:
45cdf0e10cSrcweir 
46cdf0e10cSrcweir         static ::rtl::OUString getImplementationName_Static(  ) throw(::com::sun::star::uno::RuntimeException);
47cdf0e10cSrcweir         static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(  ) throw (::com::sun::star::uno::RuntimeException);
48cdf0e10cSrcweir         static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >  & xContext);
49cdf0e10cSrcweir     protected:
50cdf0e10cSrcweir         ParameterSubstitution(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
~ParameterSubstitution()51cdf0e10cSrcweir         virtual ~ParameterSubstitution(){}
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         // XServiceInfo
54cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
55cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
56cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
57cdf0e10cSrcweir         // XInitialization
58cdf0e10cSrcweir 		virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
59cdf0e10cSrcweir 
60cdf0e10cSrcweir         // XStringSubstitution
61cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL substituteVariables( const ::rtl::OUString& aText, ::sal_Bool bSubstRequired ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL reSubstituteVariables( const ::rtl::OUString& aText ) throw (::com::sun::star::uno::RuntimeException);
63cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
64cdf0e10cSrcweir     };
65cdf0e10cSrcweir // ==================================
66cdf0e10cSrcweir } // connectivity
67cdf0e10cSrcweir // ==================================
68