1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_COMPHELPER_PROPERTYCONTAINER_HXX
21 #define INCLUDED_COMPHELPER_PROPERTYCONTAINER_HXX
23 #include <comphelper/propertycontainerhelper.hxx>
24 #include <cppuhelper/propshlp.hxx>
25 #include <com/sun/star/uno/Type.hxx>
26 #include <comphelper/comphelperdllapi.h>
33 /** a OPropertySetHelper implementation which is just a simple container for properties represented
34 by class members, usually in a derived class.
36 A restriction of this class is that no value conversions are made on a setPropertyValue call. Though
37 the base class supports this with the convertFastPropertyValue method, the OPropertyContainer accepts only
38 values which already have the correct type, it's unable to convert, for instance, a long to a short.
40 class COMPHELPER_DLLPUBLIC OPropertyContainer
41 :public cppu::OPropertySetHelper
42 ,public OPropertyContainerHelper
45 // this dtor is needed otherwise we can get a wrong delete operator
46 virtual ~OPropertyContainer();
49 OPropertyContainer(::cppu::OBroadcastHelper
& _rBHelper
);
51 /// for scripting : the types of the interfaces supported by this class
53 /// @throws css::uno::RuntimeException
54 static css::uno::Sequence
< css::uno::Type
> getBaseTypes();
56 // OPropertySetHelper overridables
57 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
58 css::uno::Any
& rConvertedValue
,
59 css::uno::Any
& rOldValue
,
61 const css::uno::Any
& rValue
) override
;
63 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(
65 const css::uno::Any
& rValue
68 using OPropertySetHelper::getFastPropertyValue
;
69 virtual void SAL_CALL
getFastPropertyValue(
70 css::uno::Any
& rValue
,
74 // disambiguate a base class method (XFastPropertySet)
75 virtual void SAL_CALL
setFastPropertyValue( sal_Int32 nHandle
, const css::uno::Any
& rValue
) override
;
79 } // namespace comphelper
82 #endif // INCLUDED_COMPHELPER_PROPERTYCONTAINER_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */