Update ooo320-m1
[ooovba.git] / dbaccess / source / core / dataaccess / documentcontainer.hxx
blobbcf074b9dd27108f339042bfd9632c930817be81
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: documentcontainer.hxx,v $
10 * $Revision: 1.15 $
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_COREDATAACCESS_DOCUMENTCONTAINER_HXX_
32 #define _DBA_COREDATAACCESS_DOCUMENTCONTAINER_HXX_
34 #ifndef _DBA_CORE_DEFINITIONCONTAINER_HXX_
35 #include "definitioncontainer.hxx"
36 #endif
37 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
38 #include <cppuhelper/implbase4.hxx>
39 #endif
40 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
41 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
44 #include <com/sun/star/frame/XComponentLoader.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMECONTAINER_HPP_
47 #include <com/sun/star/container/XHierarchicalNameContainer.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
50 #include <com/sun/star/embed/XTransactedObject.hpp>
51 #endif
52 #ifndef COMPHELPER_PROPERTYSTATECONTAINER_HXX
53 #include <comphelper/propertystatecontainer.hxx>
54 #endif
55 #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
56 #include <comphelper/proparrhlp.hxx>
57 #endif
58 #ifndef _DBASHARED_APITOOLS_HXX_
59 #include "apitools.hxx"
60 #endif
62 //........................................................................
63 namespace dbaccess
65 //........................................................................
66 typedef ::cppu::ImplHelper4 < ::com::sun::star::frame::XComponentLoader
67 , ::com::sun::star::lang::XMultiServiceFactory
68 , ::com::sun::star::container::XHierarchicalNameContainer
69 , ::com::sun::star::embed::XTransactedObject
70 > ODocumentContainer_Base;
71 //==========================================================================
72 //= ODocumentContainer - collections of database documents (reports/forms)
73 //==========================================================================
74 class ODocumentContainer : public ODefinitionContainer
75 , public ODocumentContainer_Base
76 , public ::comphelper::OPropertyStateContainer
77 , public ::comphelper::OPropertyArrayUsageHelper< ODocumentContainer >
79 sal_Bool m_bFormsContainer;
81 public:
82 /** constructs the container.<BR>
84 ODocumentContainer(
85 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB
86 , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer
87 ,const TContentPtr& _pImpl
88 , sal_Bool _bFormsContainer
91 // ::com::sun::star::uno::XInterface
92 DECLARE_XINTERFACE( )
93 // com::sun::star::lang::XTypeProvider
94 DECLARE_TYPEPROVIDER( );
95 // ::com::sun::star::lang::XServiceInfo
96 DECLARE_SERVICE_INFO();
98 // XComponentLoader
99 virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL loadComponentFromURL( const ::rtl::OUString& URL, const ::rtl::OUString& TargetFrameName, sal_Int32 SearchFlags, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
101 // ::com::sun::star::lang::XMultiServiceFactory
102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
104 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
106 // XCommandProcessor
107 virtual ::com::sun::star::uno::Any SAL_CALL execute( const ::com::sun::star::ucb::Command& aCommand, sal_Int32 CommandId, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& Environment ) throw (::com::sun::star::uno::Exception, ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException) ;
109 // XHierarchicalNameAccess
110 virtual ::com::sun::star::uno::Any SAL_CALL getByHierarchicalName( const ::rtl::OUString& _sName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
111 virtual sal_Bool SAL_CALL hasByHierarchicalName( const ::rtl::OUString& _sName ) throw (::com::sun::star::uno::RuntimeException);
113 // XHierarchicalNameContainer
114 virtual void SAL_CALL insertByHierarchicalName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
115 virtual void SAL_CALL removeByHierarchicalName( const ::rtl::OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
117 // XNameContainer
118 virtual void SAL_CALL removeByName( const ::rtl::OUString& _rName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
120 // XHierarchicalNameReplace
121 virtual void SAL_CALL replaceByHierarchicalName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
123 // ::com::sun::star::beans::XPropertySet
124 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
126 // XTransactedObject
127 virtual void SAL_CALL commit( ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL revert( ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
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 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
136 // helper
137 ::rtl::Reference<OContentHelper> getContent(const ::rtl::OUString& _sName) const;
138 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getContainerStorage() const;
140 protected:
141 virtual ~ODocumentContainer();
143 /** OContentHelper
145 virtual ::rtl::OUString determineContentType() const;
147 // ODefinitionContainer
148 virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > createObject(
149 const ::rtl::OUString& _rName
152 virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const;
154 // OPropertyArrayUsageHelper
155 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
158 //........................................................................
159 } // namespace dbaccess
160 //........................................................................
162 #endif // _DBA_COREDATAACCESS_DOCUMENTCONTAINER_HXX_