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