Debian Codegraph @

basic/source/inc/propacc.hxx

raw
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 #pragma once
20
21 #include <com/sun/star/beans/PropertyValue.hpp>
22 #include <com/sun/star/beans/XPropertySet.hpp>
23 #include <com/sun/star/beans/XPropertySetInfo.hpp>
24 #include <com/sun/star/beans/XPropertyAccess.hpp>
25 #include <comphelper/propertysetinfo.hxx>
26 #include <cppuhelper/implbase.hxx>
27
28 #include <vector>
29
30 typedef std::vector<css::beans::PropertyValue> SbPropertyValueArr_Impl;
31 typedef std::vector<comphelper::PropertyMapEntry> SbPropertyInfoArr_Impl;
32
33 typedef ::cppu::WeakImplHelper< css::beans::XPropertySet,
34 css::beans::XPropertyAccess > SbPropertyValuesHelper;
35
36
37 class SbPropertyValues final : public SbPropertyValuesHelper
38 {
39 SbPropertyValueArr_Impl m_aPropVals;
40 SbPropertyInfoArr_Impl m_aPropInfos;
41 css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo;
42
43 private:
44 size_t GetIndex_Impl( const OUString &rPropName ) const;
45
46 public:
47 SbPropertyValues();
48 virtual ~SbPropertyValues() override;
49
50 // XPropertySet
51 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
52 getPropertySetInfo() override;
53 virtual void SAL_CALL setPropertyValue(
54 const OUString& aPropertyName,
55 const css::uno::Any& aValue) override;
56 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
57 virtual void SAL_CALL addPropertyChangeListener(
58 const OUString& aPropertyName,
59 const css::uno::Reference< css::beans::XPropertyChangeListener >& ) override;
60 virtual void SAL_CALL removePropertyChangeListener(
61 const OUString& aPropertyName,
62 const css::uno::Reference< css::beans::XPropertyChangeListener >& ) override;
63 virtual void SAL_CALL addVetoableChangeListener(
64 const OUString& aPropertyName,
65 const css::uno::Reference< css::beans::XVetoableChangeListener >& ) override;
66 virtual void SAL_CALL removeVetoableChangeListener(
67 const OUString& aPropertyName,
68 const css::uno::Reference< css::beans::XVetoableChangeListener >& ) override;
69
70 // XPropertyAccess
71 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() override;
72 virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue >& PropertyValues_) override;
73 };
74
75 class SbxArray;
76
77 void RTL_Impl_CreatePropertySet( SbxArray& rPar );
78
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */