1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef CONNECTIVITY_HVIEW_HXX
29 #define CONNECTIVITY_HVIEW_HXX
30 
31 #include "connectivity/sdbcx/VView.hxx"
32 
33 /** === begin UNO includes === **/
34 #include <com/sun/star/sdbcx/XAlterView.hpp>
35 /** === end UNO includes === **/
36 
37 #include <comphelper/uno3.hxx>
38 #include <cppuhelper/implbase1.hxx>
39 
40 //........................................................................
41 namespace connectivity { namespace hsqldb
42 {
43 //........................................................................
44 
45 	//====================================================================
46 	//= HView
47 	//====================================================================
48     typedef ::connectivity::sdbcx::OView                                HView_Base;
49     typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XAlterView >  HView_IBASE;
50     class HView :public HView_Base
51                 ,public HView_IBASE
52 	{
53     public:
54         HView(
55             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
56             sal_Bool _bCaseSensitive,
57             const ::rtl::OUString& _rSchemaName,
58             const ::rtl::OUString& _rName
59         );
60 
61         // UNO
62         DECLARE_XINTERFACE()
63         DECLARE_XTYPEPROVIDER()
64 
65         // XAlterView
66         virtual void SAL_CALL alterCommand( const ::rtl::OUString& NewCommand ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
67 
68     protected:
69         virtual ~HView();
70 
71     protected:
72         // OPropertyContainer
73         virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
74 
75     private:
76         /** retrieves the current command of the View
77 
78             @throws ::com::sun::star::lang::WrappedTargetException
79                 if an error occurs while retrieving the command from the database and
80                 <arg>_bAllowSQLExceptin</arg> is <FALSE/>
81             @throws ::com::sun::star::sdbc::SQLException
82                 if an error occurs while retrieving the command from the database and
83                 <arg>_bAllowSQLException</arg> is <TRUE/>
84         */
85         ::rtl::OUString impl_getCommand_throw( bool _bAllowSQLException ) const;
86 
87     private:
88         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
89     private:
90         using HView_Base::getFastPropertyValue;
91 	};
92 
93 //........................................................................
94 } } // namespace connectivity::hsqldb
95 //........................................................................
96 
97 #endif // CONNECTIVITY_HVIEW_HXX
98