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 _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
25 #define _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
26 
27 #ifndef _DBA_CORE_COMMANDBASE_HXX_
28 #include "commandbase.hxx"
29 #endif
30 #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_
31 #include <comphelper/propertycontainer.hxx>
32 #endif
33 #ifndef _DBASHARED_APITOOLS_HXX_
34 #include "apitools.hxx"
35 #endif
36 #ifndef _COMPHELPER_UNO3_HXX_
37 #include <comphelper/uno3.hxx>
38 #endif
39 #ifndef _COM_SUN_STAR_SDBCX_XRENAME_HPP_
40 #include <com/sun/star/sdbcx/XRename.hpp>
41 #endif
42 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
43 #include <cppuhelper/implbase1.hxx>
44 #endif
45 #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
46 #include <comphelper/proparrhlp.hxx>
47 #endif
48 #ifndef _DBA_CORE_DATASETTINGS_HXX_
49 #include "datasettings.hxx"
50 #endif
51 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
52 #include <com/sun/star/container/XNameAccess.hpp>
53 #endif
54 #ifndef DBA_CONTENTHELPER_HXX
55 #include "ContentHelper.hxx"
56 #endif
57 #ifndef DBA_COREDATAACESS_COMPONENTDEFINITION_HXX
58 #include "ComponentDefinition.hxx"
59 #endif
60 
61 
62 //........................................................................
63 namespace dbaccess
64 {
65 //........................................................................
66 
67 //=========================================================================
68 //= OCommandDefinition - a database "document" which describes a query
69 //=========================================================================
70 	class OCommandDefinition_Impl : public OComponentDefinition_Impl
71 								  ,public OCommandBase
72 	{
73 	public:
74 	};
75 
76 typedef ::cppu::ImplHelper1	<	::com::sun::star::sdbcx::XRename
77 								>	OCommandDefinition_Base;
78 class OCommandDefinition;
79 typedef ::comphelper::OPropertyArrayUsageHelper< OCommandDefinition >
80 						OCommandDefinition_PROP;
81 
82 
83 class OCommandDefinition	:public OComponentDefinition
84 							,public OCommandDefinition_Base
85 							,public OCommandDefinition_PROP
86 {
87 protected:
88 	virtual ~OCommandDefinition();
89 
90 	OCommandDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
91 		,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&	_xParentContainer
92 		,const TContentPtr& _pImpl
93 		);
94 
getCommandDefinition() const95     inline const OCommandDefinition_Impl& getCommandDefinition() const { return dynamic_cast< const OCommandDefinition_Impl& >( *m_pImpl.get() ); }
getCommandDefinition()96     inline       OCommandDefinition_Impl& getCommandDefinition()       { return dynamic_cast<       OCommandDefinition_Impl& >( *m_pImpl.get() ); }
97 
98 public:
99 
100 	OCommandDefinition(
101 			 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContainer
102 			,const ::rtl::OUString& _rElementName
103 			,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
104 			,const TContentPtr& _pImpl
105 		);
106 
107 // com::sun::star::lang::XTypeProvider
108 	DECLARE_TYPEPROVIDER( );
109 
110 // ::com::sun::star::uno::XInterface
111 	DECLARE_XINTERFACE( )
112 
113 // ::com::sun::star::lang::XServiceInfo
114 	virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
115 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
116 
117 // ::com::sun::star::lang::XServiceInfo - static methods
118 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException );
119 	static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException );
120 	static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
121 		Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
122 
123 	// XRename
124 	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);
125 
126 	// OPropertySetHelper
127 	DECLARE_PROPERTYCONTAINER_DEFAULTS( );
128 
129 private:
130 	// helper
131 	void registerProperties();
132 };
133 
134 //........................................................................
135 }	// namespace dbaccess
136 //........................................................................
137 
138 #endif // _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
139 
140 
141