1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <definitioncontainer.hxx>
23 #include <cppuhelper/implbase5.hxx>
24 #include <connectivity/CommonTools.hxx>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/frame/XComponentLoader.hpp>
27 #include <com/sun/star/container/XHierarchicalNameContainer.hpp>
28 #include <com/sun/star/container/XHierarchicalName.hpp>
29 #include <com/sun/star/embed/XStorage.hpp>
30 #include <com/sun/star/embed/XTransactedObject.hpp>
31 #include <comphelper/propertystatecontainer.hxx>
32 #include <comphelper/proparrhlp.hxx>
33 #include <rtl/ref.hxx>
34 #include <apitools.hxx>
38 typedef ::cppu::ImplHelper5
< css::frame::XComponentLoader
39 , css::lang::XMultiServiceFactory
40 , css::container::XHierarchicalNameContainer
41 , css::container::XHierarchicalName
42 , css::embed::XTransactedObject
43 > ODocumentContainer_Base
;
44 // ODocumentContainer - collections of database documents (reports/forms)
45 class ODocumentContainer
: public ODefinitionContainer
46 , public ODocumentContainer_Base
47 , public ::comphelper::OPropertyStateContainer
48 , public ::comphelper::OPropertyArrayUsageHelper
< ODocumentContainer
>
50 bool m_bFormsContainer
;
53 /** constructs the container.<BR>
56 const css::uno::Reference
< css::uno::XComponentContext
>& _xORB
57 , const css::uno::Reference
< css::uno::XInterface
>& _xParentContainer
58 ,const TContentPtr
& _pImpl
59 , bool _bFormsContainer
62 // css::uno::XInterface
65 virtual css::uno::Sequence
<css::uno::Type
> SAL_CALL
getTypes() override
;
66 virtual css::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId() override
;
68 // css::lang::XServiceInfo
69 DECLARE_SERVICE_INFO();
72 virtual css::uno::Reference
< css::lang::XComponent
> SAL_CALL
loadComponentFromURL( const OUString
& URL
, const OUString
& TargetFrameName
, sal_Int32 SearchFlags
, const css::uno::Sequence
< css::beans::PropertyValue
>& Arguments
) override
;
74 // css::lang::XMultiServiceFactory
75 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
createInstance( const OUString
& aServiceSpecifier
) override
;
76 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
createInstanceWithArguments( const OUString
& ServiceSpecifier
, const css::uno::Sequence
< css::uno::Any
>& Arguments
) override
;
77 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAvailableServiceNames( ) override
;
80 virtual css::uno::Any SAL_CALL
execute( const css::ucb::Command
& aCommand
, sal_Int32 CommandId
, const css::uno::Reference
< css::ucb::XCommandEnvironment
>& Environment
) override
;
82 // XHierarchicalNameAccess
83 virtual css::uno::Any SAL_CALL
getByHierarchicalName( const OUString
& _sName
) override
;
84 virtual sal_Bool SAL_CALL
hasByHierarchicalName( const OUString
& _sName
) override
;
86 // XHierarchicalNameContainer
87 virtual void SAL_CALL
insertByHierarchicalName( const OUString
& aName
, const css::uno::Any
& aElement
) override
;
88 virtual void SAL_CALL
removeByHierarchicalName( const OUString
& Name
) override
;
91 virtual OUString SAL_CALL
getHierarchicalName( ) override
;
92 virtual OUString SAL_CALL
composeHierarchicalName( const OUString
& aRelativeName
) override
;
95 virtual void SAL_CALL
removeByName( const OUString
& _rName
) override
;
97 // XHierarchicalNameReplace
98 virtual void SAL_CALL
replaceByHierarchicalName( const OUString
& aName
, const css::uno::Any
& aElement
) override
;
100 // css::beans::XPropertySet
101 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
104 virtual void SAL_CALL
commit( ) override
;
105 virtual void SAL_CALL
revert( ) override
;
108 virtual void SAL_CALL
rename( const OUString
& newName
) override
;
110 // OPropertySetHelper
111 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
114 ::rtl::Reference
<OContentHelper
> getContent(const OUString
& _sName
) const;
115 css::uno::Reference
< css::embed::XStorage
> getContainerStorage() const;
118 virtual ~ODocumentContainer() override
;
122 virtual OUString
determineContentType() const override
;
124 // ODefinitionContainer
125 virtual css::uno::Reference
< css::ucb::XContent
> createObject(
126 const OUString
& _rName
129 virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle
, css::uno::Any
& _rDefault
) const override
;
131 // OPropertyArrayUsageHelper
132 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const override
;
135 } // namespace dbaccess
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */