/src/libreoffice/framework/inc/uielement/constitemcontainer.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
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> |
26 | | |
27 | | #include <rtl/ustring.hxx> |
28 | | #include <rtl/ref.hxx> |
29 | | #include <cppuhelper/implbase.hxx> |
30 | | #include <cppuhelper/propshlp.hxx> |
31 | | |
32 | | #include <vector> |
33 | | |
34 | | namespace framework |
35 | | { |
36 | | |
37 | | class ItemContainer; |
38 | | class ConstItemContainer final : public ::cppu::WeakImplHelper< |
39 | | css::container::XIndexAccess, |
40 | | css::beans::XFastPropertySet, |
41 | | css::beans::XPropertySet > |
42 | | { |
43 | | friend class RootItemContainer; |
44 | | friend class ItemContainer; |
45 | | |
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; |
51 | | |
52 | | // XIndexAccess |
53 | | virtual sal_Int32 SAL_CALL getCount() override; |
54 | | |
55 | | virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; |
56 | | |
57 | | // XElementAccess |
58 | | virtual css::uno::Type SAL_CALL getElementType() override |
59 | 0 | { |
60 | 0 | return cppu::UnoType<css::uno::Sequence< css::beans::PropertyValue >>::get(); |
61 | 0 | } |
62 | | |
63 | | virtual sal_Bool SAL_CALL hasElements() override; |
64 | | |
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; |
73 | | |
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; |
77 | | |
78 | | private: |
79 | | static ::cppu::IPropertyArrayHelper& getInfoHelper(); |
80 | | static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); |
81 | | |
82 | | void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector ); |
83 | | static rtl::Reference< ConstItemContainer > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer ); |
84 | | |
85 | | std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector; |
86 | | OUString m_aUIName; |
87 | | }; |
88 | | |
89 | | } |
90 | | |
91 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |