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 _COMPHELPER_PROPERTYCONTAINER_HXX_
21 #define _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"
28 //.........................................................................
31 //.........................................................................
33 //==========================================================================
34 //= OPropertyContainer
35 //==========================================================================
36 typedef ::cppu::OPropertySetHelper OPropertyContainer_Base
;
37 /** a OPropertySetHelper implementation which is just a simple container for properties represented
38 by class members, usually in a derived class.
40 A restriction of this class is that no value conversions are made on a setPropertyValue call. Though
41 the base class supports this with the convertFastPropertyValue method, the OPropertyContainer accepts only
42 values which already have the correct type, it's unable to convert, for instance, a long to a short.
44 class COMPHELPER_DLLPUBLIC OPropertyContainer
45 :public OPropertyContainer_Base
46 ,public OPropertyContainerHelper
49 // this dtor is needed otherwise we can get a wrong delete operator
50 virtual ~OPropertyContainer();
53 OPropertyContainer(::cppu::OBroadcastHelper
& _rBHelper
);
55 /// for scripting : the types of the interfaces supported by this class
56 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (::com::sun::star::uno::RuntimeException
);
58 // OPropertySetHelper overridables
59 virtual sal_Bool SAL_CALL
convertFastPropertyValue(
60 ::com::sun::star::uno::Any
& rConvertedValue
,
61 ::com::sun::star::uno::Any
& rOldValue
,
63 const ::com::sun::star::uno::Any
& rValue
)
64 throw (::com::sun::star::lang::IllegalArgumentException
);
66 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(
68 const ::com::sun::star::uno::Any
& rValue
70 throw (::com::sun::star::uno::Exception
);
72 using OPropertyContainer_Base::getFastPropertyValue
;
73 virtual void SAL_CALL
getFastPropertyValue(
74 ::com::sun::star::uno::Any
& rValue
,
78 // disambiguate a base class method (XFastPropertySet)
79 virtual void SAL_CALL
setFastPropertyValue( sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
)
80 throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
83 //.........................................................................
84 } // namespace comphelper
85 //.........................................................................
87 #endif // _COMPHELPER_PROPERTYCONTAINER_HXX_
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */