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 CONNECTIVITY_HVIEW_HXX
25 #define CONNECTIVITY_HVIEW_HXX
26 
27 #include "connectivity/sdbcx/VView.hxx"
28 
29 /** === begin UNO includes === **/
30 #include <com/sun/star/sdbcx/XAlterView.hpp>
31 /** === end UNO includes === **/
32 
33 #include <comphelper/uno3.hxx>
34 #include <cppuhelper/implbase1.hxx>
35 
36 //........................................................................
37 namespace connectivity { namespace hsqldb
38 {
39 //........................................................................
40 
41 	//====================================================================
42 	//= HView
43 	//====================================================================
44     typedef ::connectivity::sdbcx::OView                                HView_Base;
45     typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XAlterView >  HView_IBASE;
46     class HView :public HView_Base
47                 ,public HView_IBASE
48 	{
49     public:
50         HView(
51             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
52             sal_Bool _bCaseSensitive,
53             const ::rtl::OUString& _rSchemaName,
54             const ::rtl::OUString& _rName
55         );
56 
57         // UNO
58         DECLARE_XINTERFACE()
59         DECLARE_XTYPEPROVIDER()
60 
61         // XAlterView
62         virtual void SAL_CALL alterCommand( const ::rtl::OUString& NewCommand ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
63 
64     protected:
65         virtual ~HView();
66 
67     protected:
68         // OPropertyContainer
69         virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
70 
71     private:
72         /** retrieves the current command of the View
73 
74             @throws ::com::sun::star::lang::WrappedTargetException
75                 if an error occurs while retrieving the command from the database and
76                 <arg>_bAllowSQLExceptin</arg> is <FALSE/>
77             @throws ::com::sun::star::sdbc::SQLException
78                 if an error occurs while retrieving the command from the database and
79                 <arg>_bAllowSQLException</arg> is <TRUE/>
80         */
81         ::rtl::OUString impl_getCommand_throw( bool _bAllowSQLException ) const;
82 
83     private:
84         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
85     private:
86         using HView_Base::getFastPropertyValue;
87 	};
88 
89 //........................................................................
90 } } // namespace connectivity::hsqldb
91 //........................................................................
92 
93 #endif // CONNECTIVITY_HVIEW_HXX
94