1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2e2212a7SAndrew Rist  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2e2212a7SAndrew Rist  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19*2e2212a7SAndrew Rist  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
25cdf0e10cSrcweir #define _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _DBA_CORE_COMMANDBASE_HXX_
28cdf0e10cSrcweir #include "commandbase.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_
31cdf0e10cSrcweir #include <comphelper/propertycontainer.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _DBASHARED_APITOOLS_HXX_
34cdf0e10cSrcweir #include "apitools.hxx"
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _COMPHELPER_UNO3_HXX_
37cdf0e10cSrcweir #include <comphelper/uno3.hxx>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBCX_XRENAME_HPP_
40cdf0e10cSrcweir #include <com/sun/star/sdbcx/XRename.hpp>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE1_HXX_
43cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
46cdf0e10cSrcweir #include <comphelper/proparrhlp.hxx>
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir #ifndef _DBA_CORE_DATASETTINGS_HXX_
49cdf0e10cSrcweir #include "datasettings.hxx"
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
52cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
53cdf0e10cSrcweir #endif
54cdf0e10cSrcweir #ifndef DBA_CONTENTHELPER_HXX
55cdf0e10cSrcweir #include "ContentHelper.hxx"
56cdf0e10cSrcweir #endif
57cdf0e10cSrcweir #ifndef DBA_COREDATAACESS_COMPONENTDEFINITION_HXX
58cdf0e10cSrcweir #include "ComponentDefinition.hxx"
59cdf0e10cSrcweir #endif
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 
62cdf0e10cSrcweir //........................................................................
63cdf0e10cSrcweir namespace dbaccess
64cdf0e10cSrcweir {
65cdf0e10cSrcweir //........................................................................
66cdf0e10cSrcweir 
67cdf0e10cSrcweir //=========================================================================
68cdf0e10cSrcweir //= OCommandDefinition - a database "document" which describes a query
69cdf0e10cSrcweir //=========================================================================
70cdf0e10cSrcweir 	class OCommandDefinition_Impl : public OComponentDefinition_Impl
71cdf0e10cSrcweir 								  ,public OCommandBase
72cdf0e10cSrcweir 	{
73cdf0e10cSrcweir 	public:
74cdf0e10cSrcweir 	};
75cdf0e10cSrcweir 
76cdf0e10cSrcweir typedef ::cppu::ImplHelper1	<	::com::sun::star::sdbcx::XRename
77cdf0e10cSrcweir 								>	OCommandDefinition_Base;
78cdf0e10cSrcweir class OCommandDefinition;
79cdf0e10cSrcweir typedef ::comphelper::OPropertyArrayUsageHelper< OCommandDefinition >
80cdf0e10cSrcweir 						OCommandDefinition_PROP;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 
83cdf0e10cSrcweir class OCommandDefinition	:public OComponentDefinition
84cdf0e10cSrcweir 							,public OCommandDefinition_Base
85cdf0e10cSrcweir 							,public OCommandDefinition_PROP
86cdf0e10cSrcweir {
87cdf0e10cSrcweir protected:
88cdf0e10cSrcweir 	virtual ~OCommandDefinition();
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	OCommandDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
91cdf0e10cSrcweir 		,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&	_xParentContainer
92cdf0e10cSrcweir 		,const TContentPtr& _pImpl
93cdf0e10cSrcweir 		);
94cdf0e10cSrcweir 
getCommandDefinition() const95cdf0e10cSrcweir     inline const OCommandDefinition_Impl& getCommandDefinition() const { return dynamic_cast< const OCommandDefinition_Impl& >( *m_pImpl.get() ); }
getCommandDefinition()96cdf0e10cSrcweir     inline       OCommandDefinition_Impl& getCommandDefinition()       { return dynamic_cast<       OCommandDefinition_Impl& >( *m_pImpl.get() ); }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir public:
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	OCommandDefinition(
101cdf0e10cSrcweir 			 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContainer
102cdf0e10cSrcweir 			,const ::rtl::OUString& _rElementName
103cdf0e10cSrcweir 			,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
104cdf0e10cSrcweir 			,const TContentPtr& _pImpl
105cdf0e10cSrcweir 		);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir // com::sun::star::lang::XTypeProvider
108cdf0e10cSrcweir 	DECLARE_TYPEPROVIDER( );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir // ::com::sun::star::uno::XInterface
111cdf0e10cSrcweir 	DECLARE_XINTERFACE( )
112cdf0e10cSrcweir 
113cdf0e10cSrcweir // ::com::sun::star::lang::XServiceInfo
114cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
115cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
116cdf0e10cSrcweir 
117cdf0e10cSrcweir // ::com::sun::star::lang::XServiceInfo - static methods
118cdf0e10cSrcweir 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException );
119cdf0e10cSrcweir 	static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException );
120cdf0e10cSrcweir 	static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
121cdf0e10cSrcweir 		Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 	// XRename
124cdf0e10cSrcweir 	virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	// OPropertySetHelper
127cdf0e10cSrcweir 	DECLARE_PROPERTYCONTAINER_DEFAULTS( );
128cdf0e10cSrcweir 
129cdf0e10cSrcweir private:
130cdf0e10cSrcweir 	// helper
131cdf0e10cSrcweir 	void registerProperties();
132cdf0e10cSrcweir };
133cdf0e10cSrcweir 
134cdf0e10cSrcweir //........................................................................
135cdf0e10cSrcweir }	// namespace dbaccess
136cdf0e10cSrcweir //........................................................................
137cdf0e10cSrcweir 
138cdf0e10cSrcweir #endif // _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 
141