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 
24 #ifndef DBACCESS_SOURCE_SDBTOOLS_CONNECTION_TABLENAME_HXX
25 #define DBACCESS_SOURCE_SDBTOOLS_CONNECTION_TABLENAME_HXX
26 
27 #ifndef DBACCESS_CONNECTION_DEPENDENT_HXX
28 #include "connectiondependent.hxx"
29 #endif
30 
31 /** === begin UNO includes === **/
32 #ifndef _COM_SUN_STAR_SDB_TOOLS_XTABLENAME_HPP_
33 #include <com/sun/star/sdb/tools/XTableName.hpp>
34 #endif
35 /** === end UNO includes === **/
36 
37 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
38 #include <cppuhelper/implbase1.hxx>
39 #endif
40 
41 #include <memory>
42 
43 //........................................................................
44 namespace sdbtools
45 {
46 //........................................................................
47 
48 	//====================================================================
49 	//= TableName
50 	//====================================================================
51     typedef ::cppu::WeakImplHelper1 <   ::com::sun::star::sdb::tools::XTableName
52                                     >   TableName_Base;
53     struct TableName_Impl;
54     /** default implementation for XTableName
55     */
56     class TableName :public TableName_Base
57                     ,public ConnectionDependentComponent
58 	{
59     private:
60         ::std::auto_ptr< TableName_Impl >   m_pImpl;
61 
62     public:
63         /** constructs the instance
64 
65             @param _rContext
66                 the component's context
67             @param  _rxConnection
68                 the connection to work with. Will be held weak. Must not be <NULL/>.
69 
70             @throws ::com::sun::star::lang::NullPointerException
71                 if _rxConnection is <NULL/>
72         */
73         TableName(
74             const ::comphelper::ComponentContext& _rContext,
75             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
76         );
77 
78         // XTableName
79         virtual ::rtl::OUString SAL_CALL getCatalogName() throw (::com::sun::star::uno::RuntimeException);
80         virtual void SAL_CALL setCatalogName( const ::rtl::OUString& _catalogname ) throw (::com::sun::star::uno::RuntimeException);
81         virtual ::rtl::OUString SAL_CALL getSchemaName() throw (::com::sun::star::uno::RuntimeException);
82         virtual void SAL_CALL setSchemaName( const ::rtl::OUString& _schemaname ) throw (::com::sun::star::uno::RuntimeException);
83         virtual ::rtl::OUString SAL_CALL getTableName() throw (::com::sun::star::uno::RuntimeException);
84         virtual void SAL_CALL setTableName( const ::rtl::OUString& _tablename ) throw (::com::sun::star::uno::RuntimeException);
85         virtual ::rtl::OUString SAL_CALL getNameForSelect() throw (::com::sun::star::uno::RuntimeException);
86         virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getTable() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
87         virtual void SAL_CALL setTable( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _table ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
88         virtual ::rtl::OUString SAL_CALL getComposedName( ::sal_Int32 Type, ::sal_Bool _Quote ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
89         virtual void SAL_CALL setComposedName( const ::rtl::OUString& ComposedName, ::sal_Int32 Type ) throw (::com::sun::star::uno::RuntimeException);
90 
91     protected:
92         virtual ~TableName();
93 
94     private:
95         TableName();                                // never implemented
96         TableName( const TableName& );              // never implemented
97         TableName& operator=( const TableName& );   // never implemented
98     };
99 
100 //........................................................................
101 } // namespace sdbtools
102 //........................................................................
103 
104 #endif // DBACCESS_SOURCE_SDBTOOLS_CONNECTION_TABLENAME_HXX
105 
106