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