LibreOffice Module framework (master) 1
rootitemcontainer.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/container/XIndexAccess.hpp>
26#include <com/sun/star/lang/XSingleComponentFactory.hpp>
27#include <com/sun/star/beans/PropertyValue.hpp>
28
29#include <rtl/ustring.hxx>
33
34#include <vector>
35
36namespace framework
37{
38class ConstItemContainer;
39
40typedef ::cppu::WeakImplHelper<
41 css::container::XIndexContainer,
42 css::lang::XSingleComponentFactory > RootItemContainer_BASE;
43
44class RootItemContainer final : private cppu::BaseMutex,
48{
49 friend class ConstItemContainer;
50
51 public:
53 RootItemContainer( const css::uno::Reference< css::container::XIndexAccess >& rItemAccessContainer );
54 virtual ~RootItemContainer() override;
55
56 // XInterface
57 virtual void SAL_CALL acquire() noexcept override
58 { OWeakObject::acquire(); }
59 virtual void SAL_CALL release() noexcept override
60 { OWeakObject::release(); }
61 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& type) override;
62
63 // XTypeProvider
64 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
65
66 // XIndexContainer
67 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
68
69 virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override;
70
71 // XIndexReplace
72 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
73
74 // XIndexAccess
75 virtual sal_Int32 SAL_CALL getCount() override;
76
77 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
78
79 // XElementAccess
80 virtual css::uno::Type SAL_CALL getElementType() override
81 {
83 }
84
85 virtual sal_Bool SAL_CALL hasElements() override;
86
87 // XSingleComponentFactory
88 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithContext( const css::uno::Reference< css::uno::XComponentContext >& Context ) override;
89 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const css::uno::Sequence< css::uno::Any >& Arguments, const css::uno::Reference< css::uno::XComponentContext >& Context ) override;
90
91 private:
92 // OPropertySetHelper
93 virtual sal_Bool SAL_CALL convertFastPropertyValue ( css::uno::Any& aConvertedValue ,
94 css::uno::Any& aOldValue ,
95 sal_Int32 nHandle ,
96 const css::uno::Any& aValue ) override;
97 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
98 const css::uno::Any& aValue ) override;
100 virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue ,
101 sal_Int32 nHandle ) const override;
102 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
103 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
104
105 static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor();
106
109
110 css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer );
111
113 std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector;
114 OUString m_aUIName;
115};
116
117}
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) SAL_OVERRIDE
RootItemContainer(const css::uno::Reference< css::container::XIndexAccess > &rItemAccessContainer)
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &aValue, sal_Int32 nHandle) const override
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
virtual sal_Bool SAL_CALL hasElements() override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &aValue) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector
RootItemContainer(const RootItemContainer &)=delete
virtual void SAL_CALL removeByIndex(sal_Int32 Index) override
virtual void SAL_CALL insertByIndex(sal_Int32 Index, const css::uno::Any &Element) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext(const css::uno::Sequence< css::uno::Any > &Arguments, const css::uno::Reference< css::uno::XComponentContext > &Context) override
static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor()
RootItemContainer & operator=(const RootItemContainer &)=delete
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &aConvertedValue, css::uno::Any &aOldValue, sal_Int32 nHandle, const css::uno::Any &aValue) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Reference< css::container::XIndexAccess > deepCopyContainer(const css::uno::Reference< css::container::XIndexAccess > &rSubContainer)
virtual void SAL_CALL release() noexcept override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &type) override
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithContext(const css::uno::Reference< css::uno::XComponentContext > &Context) override
virtual ~RootItemContainer() override
This acts like a rtl::Reference<osl::Mutex>
::cppu::WeakImplHelper< css::container::XIndexContainer, css::lang::XSingleComponentFactory > RootItemContainer_BASE
unsigned char sal_Bool