Update git submodules
[LibreOffice.git] / framework / inc / uielement / constitemcontainer.hxx
blobae820c29b10f8113640df4a537e802cbda8786e3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <com/sun/star/beans/PropertyValue.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/beans/XFastPropertySet.hpp>
25 #include <com/sun/star/container/XIndexAccess.hpp>
27 #include <rtl/ustring.hxx>
28 #include <cppuhelper/implbase.hxx>
29 #include <cppuhelper/propshlp.hxx>
31 #include <vector>
33 namespace framework
36 class RootItemContainer;
37 class ItemContainer;
38 class ConstItemContainer final : public ::cppu::WeakImplHelper<
39 css::container::XIndexAccess,
40 css::beans::XFastPropertySet,
41 css::beans::XPropertySet >
43 friend class RootItemContainer;
44 friend class ItemContainer;
46 public:
47 ConstItemContainer();
48 ConstItemContainer( const ItemContainer& rtemContainer );
49 ConstItemContainer( const css::uno::Reference< css::container::XIndexAccess >& rSourceContainer, bool bFastCopy = false );
50 virtual ~ConstItemContainer() override;
52 // XIndexAccess
53 virtual sal_Int32 SAL_CALL getCount() override;
55 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
57 // XElementAccess
58 virtual css::uno::Type SAL_CALL getElementType() override
60 return cppu::UnoType<css::uno::Sequence< css::beans::PropertyValue >>::get();
63 virtual sal_Bool SAL_CALL hasElements() override;
65 // XPropertySet
66 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
67 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
68 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
69 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
70 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
71 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
72 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
74 // XFastPropertySet
75 virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const css::uno::Any& aValue ) override;
76 virtual css::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) override;
78 private:
79 static ::cppu::IPropertyArrayHelper& getInfoHelper();
80 static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor();
82 void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector );
83 static css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer );
85 std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector;
86 OUString m_aUIName;
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */