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_COREDATAACCESS_DOCUMENTCONTAINER_HXX_
25cdf0e10cSrcweir #define _DBA_COREDATAACCESS_DOCUMENTCONTAINER_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _DBA_CORE_DEFINITIONCONTAINER_HXX_
28cdf0e10cSrcweir #include "definitioncontainer.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE5_HXX_
31cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
34cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
37cdf0e10cSrcweir #include <com/sun/star/frame/XComponentLoader.hpp>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMECONTAINER_HPP_
40cdf0e10cSrcweir #include <com/sun/star/container/XHierarchicalNameContainer.hpp>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAME_HPP_
43cdf0e10cSrcweir #include <com/sun/star/container/XHierarchicalName.hpp>
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
46cdf0e10cSrcweir #include <com/sun/star/embed/XTransactedObject.hpp>
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir #ifndef COMPHELPER_PROPERTYSTATECONTAINER_HXX
49cdf0e10cSrcweir #include <comphelper/propertystatecontainer.hxx>
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
52cdf0e10cSrcweir #include <comphelper/proparrhlp.hxx>
53cdf0e10cSrcweir #endif
54cdf0e10cSrcweir #ifndef _DBASHARED_APITOOLS_HXX_
55cdf0e10cSrcweir #include "apitools.hxx"
56cdf0e10cSrcweir #endif
57cdf0e10cSrcweir 
58cdf0e10cSrcweir //........................................................................
59cdf0e10cSrcweir namespace dbaccess
60cdf0e10cSrcweir {
61cdf0e10cSrcweir //........................................................................
62cdf0e10cSrcweir typedef ::cppu::ImplHelper5 <	::com::sun::star::frame::XComponentLoader
63cdf0e10cSrcweir 						    ,	::com::sun::star::lang::XMultiServiceFactory
64cdf0e10cSrcweir 						    ,	::com::sun::star::container::XHierarchicalNameContainer
65cdf0e10cSrcweir 						    ,	::com::sun::star::container::XHierarchicalName
66cdf0e10cSrcweir 						    ,	::com::sun::star::embed::XTransactedObject
67cdf0e10cSrcweir 						    >	ODocumentContainer_Base;
68cdf0e10cSrcweir //==========================================================================
69cdf0e10cSrcweir //= ODocumentContainer -	collections of database documents (reports/forms)
70cdf0e10cSrcweir //==========================================================================
71cdf0e10cSrcweir class ODocumentContainer	: public ODefinitionContainer
72cdf0e10cSrcweir 							, public ODocumentContainer_Base
73cdf0e10cSrcweir 							, public ::comphelper::OPropertyStateContainer
74cdf0e10cSrcweir 							, public ::comphelper::OPropertyArrayUsageHelper< ODocumentContainer >
75cdf0e10cSrcweir {
76cdf0e10cSrcweir 	sal_Bool		m_bFormsContainer;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir public:
79cdf0e10cSrcweir 	/** constructs the container.<BR>
80cdf0e10cSrcweir 	*/
81cdf0e10cSrcweir 	ODocumentContainer(
82cdf0e10cSrcweir 		  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB
83cdf0e10cSrcweir 		, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&	_xParentContainer
84cdf0e10cSrcweir 		,const TContentPtr& _pImpl
85cdf0e10cSrcweir 		, sal_Bool _bFormsContainer
86cdf0e10cSrcweir 		);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	// ::com::sun::star::uno::XInterface
89cdf0e10cSrcweir 	DECLARE_XINTERFACE( )
90cdf0e10cSrcweir 	// com::sun::star::lang::XTypeProvider
91cdf0e10cSrcweir 	DECLARE_TYPEPROVIDER( );
92cdf0e10cSrcweir 	// ::com::sun::star::lang::XServiceInfo
93cdf0e10cSrcweir 	DECLARE_SERVICE_INFO();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	// XComponentLoader
96cdf0e10cSrcweir 	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);
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	// ::com::sun::star::lang::XMultiServiceFactory
99cdf0e10cSrcweir     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);
100cdf0e10cSrcweir     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);
101cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	// XCommandProcessor
104cdf0e10cSrcweir 	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) ;
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	// XHierarchicalNameAccess
107cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL getByHierarchicalName( const ::rtl::OUString& _sName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasByHierarchicalName( const ::rtl::OUString& _sName ) throw (::com::sun::star::uno::RuntimeException);
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	// XHierarchicalNameContainer
111cdf0e10cSrcweir 	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);
112cdf0e10cSrcweir     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);
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	// XHierarchicalName
115cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getHierarchicalName(  ) throw (::com::sun::star::uno::RuntimeException);
116cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL composeHierarchicalName( const ::rtl::OUString& aRelativeName ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     // XNameContainer
119cdf0e10cSrcweir     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);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	// XHierarchicalNameReplace
122cdf0e10cSrcweir 	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);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	// ::com::sun::star::beans::XPropertySet
125cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 	// XTransactedObject
128cdf0e10cSrcweir 	virtual void SAL_CALL commit(  ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
129cdf0e10cSrcweir     virtual void SAL_CALL revert(  ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     // XRename
132cdf0e10cSrcweir 	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);
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	// OPropertySetHelper
135cdf0e10cSrcweir 	virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	// helper
138cdf0e10cSrcweir 	::rtl::Reference<OContentHelper> getContent(const ::rtl::OUString& _sName) const;
139cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getContainerStorage() const;
140cdf0e10cSrcweir 
141cdf0e10cSrcweir protected:
142cdf0e10cSrcweir 	virtual ~ODocumentContainer();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     /** OContentHelper
145cdf0e10cSrcweir     */
146cdf0e10cSrcweir     virtual ::rtl::OUString determineContentType() const;
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     // ODefinitionContainer
149cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > createObject(
150cdf0e10cSrcweir 		const ::rtl::OUString& _rName
151cdf0e10cSrcweir 	);
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 	// OPropertyArrayUsageHelper
156cdf0e10cSrcweir     virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
157cdf0e10cSrcweir };
158cdf0e10cSrcweir 
159cdf0e10cSrcweir //........................................................................
160cdf0e10cSrcweir }	// namespace dbaccess
161cdf0e10cSrcweir //........................................................................
162cdf0e10cSrcweir 
163cdf0e10cSrcweir #endif // _DBA_COREDATAACCESS_DOCUMENTCONTAINER_HXX_
164cdf0e10cSrcweir 
165