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_ITEMCONTAINER_HXX
21 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_ITEMCONTAINER_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/beans/PropertyValue.hpp>
30 #include <com/sun/star/lang/XUnoTunnel.hpp>
32 #include <rtl/ustring.hxx>
33 #include <cppuhelper/implbase1.hxx>
36 #include <fwidllapi.h>
40 class ConstItemContainer
;
41 class FWI_DLLPUBLIC ItemContainer
: public ::cppu::WeakImplHelper1
< ::com::sun::star::container::XIndexContainer
>
43 friend class ConstItemContainer
;
46 ItemContainer( const ShareableMutex
& );
47 ItemContainer( const ConstItemContainer
& rConstItemContainer
, const ShareableMutex
& rMutex
);
48 ItemContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rItemAccessContainer
, const ShareableMutex
& rMutex
);
49 virtual ~ItemContainer();
51 // XInterface, XTypeProvider
54 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& GetUnoTunnelId() throw();
55 static ItemContainer
* GetImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rxIFace
) throw();
58 virtual void SAL_CALL
insertByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
59 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
;
61 virtual void SAL_CALL
removeByIndex( sal_Int32 Index
)
62 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
65 virtual void SAL_CALL
replaceByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
66 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
;
69 virtual sal_Int32 SAL_CALL
getCount()
70 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
73 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
76 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
77 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
79 return cppu::UnoType
<com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>>::get();
82 virtual sal_Bool SAL_CALL
hasElements()
83 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 void copyItemContainer( const std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> >& rSourceVector
, const ShareableMutex
& rMutex
);
88 com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
> deepCopyContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rSubContainer
, const ShareableMutex
& rMutex
);
90 mutable ShareableMutex m_aShareMutex
;
91 std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> > m_aItemVector
;
96 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_ITEMCONTAINER_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */