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 .
20 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_ROOTITEMCONTAINER_HXX
21 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_ROOTITEMCONTAINER_HXX
23 #include <macros/generic.hxx>
24 #include <macros/xinterface.hxx>
25 #include <macros/xtypeprovider.hxx>
26 #include <helper/shareablemutex.hxx>
28 #include <com/sun/star/container/XIndexContainer.hpp>
29 #include <com/sun/star/container/XIndexAccess.hpp>
30 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
31 #include <com/sun/star/beans/PropertyValue.hpp>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/lang/XUnoTunnel.hpp>
35 #include <rtl/ustring.hxx>
36 #include <cppuhelper/basemutex.hxx>
37 #include <cppuhelper/implbase3.hxx>
38 #include <cppuhelper/propshlp.hxx>
41 #include <fwidllapi.h>
45 class ConstItemContainer
;
47 typedef ::cppu::WeakImplHelper3
<
48 css::container::XIndexContainer
,
49 css::lang::XSingleComponentFactory
,
50 css::lang::XUnoTunnel
> RootItemContainer_BASE
;
52 class RootItemContainer
: private cppu::BaseMutex
,
53 public ::cppu::OBroadcastHelper
,
54 public ::cppu::OPropertySetHelper
,
55 public RootItemContainer_BASE
57 friend class ConstItemContainer
;
60 FWI_DLLPUBLIC
RootItemContainer();
61 FWI_DLLPUBLIC
RootItemContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rItemAccessContainer
);
62 virtual FWI_DLLPUBLIC
~RootItemContainer();
65 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
66 { OWeakObject::acquire(); }
67 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
68 { OWeakObject::release(); }
69 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& type
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
75 static FWI_DLLPUBLIC
const ::com::sun::star::uno::Sequence
< sal_Int8
>& GetUnoTunnelId() throw();
76 static FWI_DLLPUBLIC RootItemContainer
* GetImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rxIFace
) throw();
77 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& rIdentifier
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual void SAL_CALL
insertByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
81 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 virtual void SAL_CALL
removeByIndex( sal_Int32 Index
)
84 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual void SAL_CALL
replaceByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
88 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual sal_Int32 SAL_CALL
getCount()
92 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
94 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
95 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
99 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
101 return cppu::UnoType
<com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>>::get();
104 virtual sal_Bool SAL_CALL
hasElements()
105 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 // XSingleComponentFactory
108 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
createInstanceWithContext( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& Context
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
createInstanceWithArgumentsAndContext( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& Arguments
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& Context
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 // OPropertySetHelper
113 virtual sal_Bool SAL_CALL
convertFastPropertyValue ( com::sun::star::uno::Any
& aConvertedValue
,
114 com::sun::star::uno::Any
& aOldValue
,
116 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::lang::IllegalArgumentException
) SAL_OVERRIDE
;
117 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
,
118 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::uno::Exception
, std::exception
) SAL_OVERRIDE
;
119 using cppu::OPropertySetHelper::getFastPropertyValue
;
120 virtual void SAL_CALL
getFastPropertyValue( com::sun::star::uno::Any
& aValue
,
121 sal_Int32 nHandle
) const SAL_OVERRIDE
;
122 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
123 virtual ::com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 static const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
> impl_getStaticPropertyDescriptor();
128 RootItemContainer
& operator=( const RootItemContainer
& ) SAL_DELETED_FUNCTION
;
129 RootItemContainer( const RootItemContainer
& ) SAL_DELETED_FUNCTION
;
131 com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
> deepCopyContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rSubContainer
);
133 mutable ShareableMutex m_aShareMutex
;
134 std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> > m_aItemVector
;
140 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_ROOTITEMCONTAINER_HXX
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */