LibreOffice Module framework (master) 1
itemcontainer.hxx
Go to the documentation of this file.
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
23
24#include <com/sun/star/container/XIndexContainer.hpp>
25#include <com/sun/star/beans/PropertyValue.hpp>
26
28
29#include <vector>
30
31namespace framework
32{
33class ConstItemContainer;
34class ItemContainer final : public ::cppu::WeakImplHelper< css::container::XIndexContainer>
35{
36 friend class ConstItemContainer;
37
38 public:
40 ItemContainer( const ConstItemContainer& rConstItemContainer, const ShareableMutex& rMutex );
41 ItemContainer( const css::uno::Reference< css::container::XIndexAccess >& rItemAccessContainer, const ShareableMutex& rMutex );
42 virtual ~ItemContainer() override;
43
44 // XInterface, XTypeProvider
45
46 // XIndexContainer
47 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
48
49 virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override;
50
51 // XIndexReplace
52 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
53
54 // XIndexAccess
55 virtual sal_Int32 SAL_CALL getCount() override;
56
57 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
58
59 // XElementAccess
60 virtual css::uno::Type SAL_CALL getElementType() override
61 {
63 }
64
65 virtual sal_Bool SAL_CALL hasElements() override;
66
67 private:
68 void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector, const ShareableMutex& rMutex );
69 css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer, const ShareableMutex& rMutex );
70
72 std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector;
73};
74
75}
76
77/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
ItemContainer(const css::uno::Reference< css::container::XIndexAccess > &rItemAccessContainer, const ShareableMutex &rMutex)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual ~ItemContainer() override
virtual sal_Int32 SAL_CALL getCount() override
css::uno::Reference< css::container::XIndexAccess > deepCopyContainer(const css::uno::Reference< css::container::XIndexAccess > &rSubContainer, const ShareableMutex &rMutex)
virtual void SAL_CALL insertByIndex(sal_Int32 Index, const css::uno::Any &Element) override
ShareableMutex m_aShareMutex
virtual css::uno::Type SAL_CALL getElementType() override
ItemContainer(const ShareableMutex &)
virtual void SAL_CALL removeByIndex(sal_Int32 Index) override
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
virtual sal_Bool SAL_CALL hasElements() override
void copyItemContainer(const std::vector< css::uno::Sequence< css::beans::PropertyValue > > &rSourceVector, const ShareableMutex &rMutex)
std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector
This acts like a rtl::Reference<osl::Mutex>
unsigned char sal_Bool