merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / core / dataaccess / commanddefinition.hxx
blobcf6c1a7369a51437aaecd19e2902e5541b89be65
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: commanddefinition.hxx,v $
10 * $Revision: 1.18 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
32 #define _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_
34 #ifndef _DBA_CORE_COMMANDBASE_HXX_
35 #include "commandbase.hxx"
36 #endif
37 #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_
38 #include <comphelper/propertycontainer.hxx>
39 #endif
40 #ifndef _DBASHARED_APITOOLS_HXX_
41 #include "apitools.hxx"
42 #endif
43 #ifndef _COMPHELPER_UNO3_HXX_
44 #include <comphelper/uno3.hxx>
45 #endif
46 #ifndef _COM_SUN_STAR_SDBCX_XRENAME_HPP_
47 #include <com/sun/star/sdbcx/XRename.hpp>
48 #endif
49 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
50 #include <cppuhelper/implbase1.hxx>
51 #endif
52 #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
53 #include <comphelper/proparrhlp.hxx>
54 #endif
55 #ifndef _DBA_CORE_DATASETTINGS_HXX_
56 #include "datasettings.hxx"
57 #endif
58 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
59 #include <com/sun/star/container/XNameAccess.hpp>
60 #endif
61 #ifndef DBA_CONTENTHELPER_HXX
62 #include "ContentHelper.hxx"
63 #endif
64 #ifndef DBA_COREDATAACESS_COMPONENTDEFINITION_HXX
65 #include "ComponentDefinition.hxx"
66 #endif
69 //........................................................................
70 namespace dbaccess
72 //........................................................................
74 //=========================================================================
75 //= OCommandDefinition - a database "document" which describes a query
76 //=========================================================================
77 class OCommandDefinition_Impl : public OComponentDefinition_Impl
78 ,public OCommandBase
80 public:
83 typedef ::cppu::ImplHelper1 < ::com::sun::star::sdbcx::XRename
84 > OCommandDefinition_Base;
85 class OCommandDefinition;
86 typedef ::comphelper::OPropertyArrayUsageHelper< OCommandDefinition >
87 OCommandDefinition_PROP;
90 class OCommandDefinition :public OComponentDefinition
91 ,public OCommandDefinition_Base
92 ,public OCommandDefinition_PROP
94 protected:
95 virtual ~OCommandDefinition();
97 OCommandDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
98 ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer
99 ,const TContentPtr& _pImpl
102 inline const OCommandDefinition_Impl& getCommandDefinition() const { return dynamic_cast< const OCommandDefinition_Impl& >( *m_pImpl.get() ); }
103 inline OCommandDefinition_Impl& getCommandDefinition() { return dynamic_cast< OCommandDefinition_Impl& >( *m_pImpl.get() ); }
105 public:
107 OCommandDefinition(
108 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContainer
109 ,const ::rtl::OUString& _rElementName
110 ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
111 ,const TContentPtr& _pImpl
114 // com::sun::star::lang::XTypeProvider
115 DECLARE_TYPEPROVIDER( );
117 // ::com::sun::star::uno::XInterface
118 DECLARE_XINTERFACE( )
120 // ::com::sun::star::lang::XServiceInfo
121 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
122 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
124 // ::com::sun::star::lang::XServiceInfo - static methods
125 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException );
126 static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException );
127 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
128 Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
130 // XRename
131 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);
133 // OPropertySetHelper
134 DECLARE_PROPERTYCONTAINER_DEFAULTS( );
136 private:
137 // helper
138 void registerProperties();
141 //........................................................................
142 } // namespace dbaccess
143 //........................................................................
145 #endif // _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_